C Buffer Overflow, Heap/Stack Corruption and Analysis

  Рет қаралды 54,144

Engineer Man

Engineer Man

Күн бұрын

Пікірлер: 50
@ShaneLeeCoding
@ShaneLeeCoding 5 жыл бұрын
Thanks for making this so clear and giving the example. I'd managed to understand the basic concept before I saw your video, but I'd never really seen any examples. Thanks Engineer Man.
@gregoryfenn1462
@gregoryfenn1462 5 жыл бұрын
Great little explanation of buffer overflows and a little insight into the stack/heap distinction too, packed neatly into a short 5 min vid! Thanks :)
@Djzaamir
@Djzaamir 6 жыл бұрын
One of the best on BufferOverFlow
@1810Chopiano
@1810Chopiano 3 жыл бұрын
Really fantastic. Thanks so much. Maybe the best and most succinct explanation I've heard yet.
@alazawi03
@alazawi03 7 ай бұрын
OMG! so great explanation, time saving, but i wish if you went into heap aswell! good job!
@user-ep3ye5bw8h
@user-ep3ye5bw8h 7 жыл бұрын
Nice videos have been watching most of them. Keep up the good content!
@EngineerMan
@EngineerMan 7 жыл бұрын
Glad you're enjoying them!
@jockillfull
@jockillfull 6 жыл бұрын
Hi! I really do like your work keep on!! I just had one question : Why the first buffer is modified in the second case? Because it his "behind" in term of placement in the memory it shouldn't change... O.o
@balkon646
@balkon646 7 жыл бұрын
Thank you for this video. I recently fount out about your channel in Reddit and it's really awesome. Most of the tutorials are stuck in beginner level. Your content is going great, keep up the good work. And, I am trying to learn socket programming in C, if you were to do socket programming that would be great :)
@EngineerMan
@EngineerMan 7 жыл бұрын
Thanks for the kind words. I do need to do more advanced topics as I feel I'm neglecting that audience a little. I've been working on a small toy web server as a personal side project here: github.com/ebrian/bserve There's a lot of fundamentals for sockets. I'll certainly do an Engineer Man video on the subject, too. Enjoy!
@balkon646
@balkon646 7 жыл бұрын
Thanks for replying this fast and linking your project. I will look into it :) For advanced topics I would want to see some memory allocating and memory padding on structs. I saw this topic in "Deep C" slideshow on slideshare, but I couldn't understand it really. And there are a lot of 32-bit, 64-bit arcitechture differences on memory allocating so it would be a good topic too, I think.
@walrusboy91
@walrusboy91 7 жыл бұрын
why don't you fucking google your questions instead of begging for free content.
@EngineerMan
@EngineerMan 7 жыл бұрын
Hello friend, he's not begging. I make mention at the end of all my videos to make requests if people have them. No worries :)
@amlamarra
@amlamarra 7 жыл бұрын
Because Engineer Man can provide a better tutorial than 99% of what's out there on the Internet.
@happychuckprogramming6048
@happychuckprogramming6048 5 жыл бұрын
awesome work, Engineer Man. Keep it coming !!
@orange.grapes
@orange.grapes 3 жыл бұрын
This playlist is awesome. Q: is the void pointer cast on lines 26 and 26 of the video necessary? Malloc returns a void pointer
@humane123
@humane123 Жыл бұрын
Thanks for the simple explanation
@chrisnocker3437
@chrisnocker3437 6 жыл бұрын
Hey mate, I'm watching the C playlist and I think the first and second videos should be switched in order. Great content! Thanks.
@EngineerMan
@EngineerMan 6 жыл бұрын
I'll check it out. The C playlist is more of a way to just categorize everything. That one wasn't meant to be in any particular order. If it does appear to be in any order, that's purely by luck lol.
@raymondtan9112
@raymondtan9112 5 жыл бұрын
Can you create the video for Heap as well? I copied your code and play around with it and can't get to overflow condition in my 32 bit Ubuntu
@ColinPittendrigh
@ColinPittendrigh 3 жыл бұрын
What about manipulating heap overflow in order to actually execute spurious codes?
@austin2994
@austin2994 6 жыл бұрын
Wanted to see the heap corruption example. Also a core dump analysis video in future
@Chanchothecorgi
@Chanchothecorgi 3 жыл бұрын
I am trying this on sublime text, and using the code provided in your github. When I run this, I get illegal instruction 4 ( and I tried it with the no stack. any idea? Thanks!
@starlwe
@starlwe 4 жыл бұрын
I'm curious, what editor are you using in linux?
@pranavrao6370
@pranavrao6370 4 жыл бұрын
Could you explain Stack and Heap specifically?
@Joker9586
@Joker9586 7 жыл бұрын
Thanks a lot for these videos, i'm currently into Linux programming and learning Posix standard. I'm enjoying these videos. I wish you could do more about Linux syscalls and tools like message queues, pipes, Fifos, signals and so on
@EngineerMan
@EngineerMan 7 жыл бұрын
My pleasure! The focus on this channel has narrowed down to C and Linux, so definitely expect to see videos covering subject matter related to those topics in the future!
@Joker9586
@Joker9586 7 жыл бұрын
Thanks, I don't see lots of good tutorials on this topic out there.
@BananaHammyForYou
@BananaHammyForYou 6 жыл бұрын
Cool video, totally don't know about any of this and it's really interesting. Can you do a video on how to diagnose memory corruption or maybe how to use debugging tools? The Devs at my company have made a bunch of fragile junk and can't seem to fix it and I want to try my hand at it. I'd say I'm probably a novice with no Assembly knowledge.
@nimaMotlagh-z8c
@nimaMotlagh-z8c 8 ай бұрын
It was perfect Thank you so much
@BinaryAdventure
@BinaryAdventure 4 жыл бұрын
It's not quite correct that running a few bytes past the end of the stack buffer, triggering the segfault, is actually coming from the OS. The default stack size is around 1MB and this overflow is running into memory which is still allocated to the process... It's just out of bounds of the buffer. The stack grows downward in memory address and this copy would overflow in the memory-upwards direction, which would definitely still be in the process' allocated stack space and not in the memory space of another process or OS.
@giridharprasath10
@giridharprasath10 4 жыл бұрын
that is why it is called as corruption yeah canaries would be set to crash the program, but without canaries? it would overwrite stack metadata and code execution can happen
@aidanabregov1412
@aidanabregov1412 Жыл бұрын
What’s the difference between stacks and heaps? Great video.
@graham12345dd
@graham12345dd Жыл бұрын
Excellent!
@taoyeahright
@taoyeahright 4 жыл бұрын
why is authorized only 0x10+0xC or 28 bytes away instead of 32 bytes, signed integers for 32 bit should be 32 bytes no?
@electrowizard2658
@electrowizard2658 Жыл бұрын
simple and great !!
@manolov4074
@manolov4074 5 жыл бұрын
Hey Everyone ! I have a question . If the OS is not going to allow you to overwrite to other bytes ,other than the ones u are allowed to , why would this be a problem? We need to be carefull with our projects , but what is the problem if the OS is going to stop anything that will try to destroy it ? Thanks in advance
@EngineerMan
@EngineerMan 5 жыл бұрын
The problem is that vulnerable programs could be used to do malicious things. Imagine if SSH was vulnerable to heap corruption allowing people to log in without credentials. While this doesn't harm the system, per se, it doesn't allow an unknown party to take control of a machine.
@manolov4074
@manolov4074 5 жыл бұрын
@@EngineerMan Oooo Yes , Yes . Now i get the idea . Its not always about the system . Thank you a lot Engineering Man . I find your videos very usefull ! Having in mind the quick and powerfull replay is also a plus . U won a new subscriber :) Keep up the good work Engineering MAN !!! Greetings from Bulgaria , and thanks again !
@collinsd70
@collinsd70 6 жыл бұрын
Why does the compiler not detect this when compiling???
@studentcommenter5858
@studentcommenter5858 6 жыл бұрын
As he said, even though there was buffer overflow he was still accessing the space of the same program. Compiler is going to throw an error when he tries to access the memory space of some other program.
@aglimitless
@aglimitless 4 жыл бұрын
Why some games in my phone closed due to stack corruption...
@savinodamato6090
@savinodamato6090 4 жыл бұрын
i hope that will be helpfull for Nocera's exam
@erbkgupta8679
@erbkgupta8679 5 жыл бұрын
Graet!
@spatialnasir
@spatialnasir Жыл бұрын
Succinct. Thanks so much.
@clashwithtim74
@clashwithtim74 4 жыл бұрын
600 likes
@ammarsyaf3035
@ammarsyaf3035 6 жыл бұрын
your room is so empty
@EngineerMan
@EngineerMan 6 жыл бұрын
It's technically my dining room, but I just assume use it as an office.
Running a Buffer Overflow Attack - Computerphile
17:30
Computerphile
Рет қаралды 2 МЛН
Pointers and dynamic memory - stack vs heap
17:26
mycodeschool
Рет қаралды 1,5 МЛН
УНО Реверс в Амонг Ас : игра на выбывание
0:19
Фани Хани
Рет қаралды 1,3 МЛН
Thank you mommy 😊💝 #shorts
0:24
5-Minute Crafts HOUSE
Рет қаралды 33 МЛН
how do hackers exploit buffers that are too small?
8:25
Low Level
Рет қаралды 206 М.
Strings can get you hacked! (buffer overflows, strcpy, and gets)
9:04
The Call Stack and Stack Overflows (example in C)
12:56
Jacob Sorber
Рет қаралды 47 М.
WHY IS THE STACK SO FAST?
13:46
Core Dumped
Рет қаралды 185 М.
What is a mutex in C? (pthread_mutex)
9:18
CodeVault
Рет қаралды 173 М.
Stack vs Heap Memory - Simple Explanation
5:28
Alex Hyett
Рет қаралды 266 М.
How They Hack: Buffer Overflow & GDB Analysis - James Lyne
16:06
Buffer Overflow 101: Ep 1 - x86 Memory Fundamentals
8:43
flipthebit
Рет қаралды 13 М.
find memory errors quickly. (-fsanitize, addresssanitizer)
9:44
Jacob Sorber
Рет қаралды 19 М.
УНО Реверс в Амонг Ас : игра на выбывание
0:19
Фани Хани
Рет қаралды 1,3 МЛН