Buffer Overflow Primer Part 1 (Smashing the Stack)

TheSecurityTube · 60K views · 2012 · 26:19

Open on YouTube

Security & hackingC, C++, Rust, Go & systems languagestutorial

Why Stack Overflow recommends it

Stack Overflow users link it as the tutorial they are following when they get stuck reproducing the buffer overflow demo in GDB on their own machines.

Recommended by 0 people across 0 different months, 2015 to 2016.

What it is

A 26-minute tutorial from TheSecurityTube, part of the Buffer Overflow Primer series, that walks through classic stack smashing on 32-bit Linux. It uses a small C program with gets(), GDB, and inspection of registers such as ESP to show how overflowing a buffer can redirect execution.

What people said

Cites Zareena Naz · 2015-02 · Stack Overflow · on “viewing stack overflow register error”

I am trying to view the esp register in order to understand how stack overflow take place. I have used x/8xw $esp command to view the register, but kept getting error that Cannot access memory at 0xffffffffffffdf30 . Can some one please tell me what the problem might be. I am using Linux 3.13. I am following the below link to understand registers and stack overflow. Everything else is working apart from the above mentioned command. In the video at 10:32 the author can display the esp register, but when I do on my machine, I cant. [this video]

Cites TechJ · 2015-12 · Stack Overflow · on “GDB throws error while stepping into at breakpoint”

I am trying to follow a video tutoial on buffer overflow from this link [this video] and below is the code which I am trying. #include <stdio.h> GetInput() { char buffer[8]; gets(buffer); puts(buffer); } main() { GetInput(); return 0; } I am getting an isssue in gdb debugging, while I step onto i.e at line 7, I get the below error: _IO_gets (buf=0xbffff458 "k\204\004\b") at iogets.c:33 33 iogets.c: No such file or directory. I am following exactly the same steps as mentioned in the tutorial. I am using 32 bit Kali linux on virtual box Can anyone help me to get through this problem.

Cites qre0ct · 2016-01 · Stack Overflow · on “Unable to get buffer overflow working”

I am trying to learn about buffer overflow attacks and wanted to see a working demo of the same. I have been following many online resources to understand the same. For example, this [this video] has proven really helpful so far. I understand the concept of buffer overflow clearly, however, I am unable to get the demo working. I am on a 64-bit Mac, running 32-bit Ubuntu in VirtualBox (the machine where I am experimenting with buffer overflow). I have disabled ASLR on Ubuntu for the sake of playing around with the buffer overflow. I have a simple C program, demo.c, taken from the video link mentioned above : # include<stdio.h> CanNeverExecute() { printf("I can never execute"); } GetInput() { char