Simplebof This is the note of the buffer overflow class.

Simplebof This is the note of the buffer overflow class.

Simplebof This is the note of the buffer overflow class.
Check Environment :
– uname -a

[Compilations]
+ With ASLR, Stack protector, DEP, TURNED OFF
gcc -fno-stack-protector -z execstack bof.c -o bof

Having Problem to Compile bof.c?
bof.c: In function ‘print’:
bof.c:6:2: warning: incompatible implicit declaration of built-in function ‘strcpy’
strcpy(buf, str);
Resolved!
– vi bof.c
– Just type #include <string.h>

[Usage]:

Start Debugging Using gdb. This post author has been debug using gef:
– gdb -q bof | For reading symbol
– r \python sploit.py | Starting program sploit.py
– breakpoint : entry-break

Reading symbol and Debugging using gef

Reading symbol and Debugging using gef

bof.c Script:

sploit.py Script:

sploit2.py Script:

Or download original Script

Download : simplebof.zip
Source : https://github.com/kurisuryu