Binary Exploitation
10101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010
Quick
//find offset by trial and error or gdb/gef
python3 -c 'print ("A" * 64)'
gdb
pattern create
run
'paste pattern'
pattern search $rsp
//find libc base
ldd vulnerableSoftware
//find callable system in memory
//The -s flag tells readelf to search for symbols, for example functions.
readelf -s /lib/x86_64-linux-gnu/libc.so.6 | grep system
//find /bin/sh string
//The option -a tells it to scan the entire file; -t x tells it to output the offset in hex.
strings -a -t x /lib/x86_64-linux-gnu/libc.so.6 | grep /bin/sh
//To passing the parameter in after the return pointer
//you will have to use a pop rdi;
//ret gadget to put it into the RDI register
ROPgadget --binary vulnerableSoftware | grep rdi
//Besides those functions the return address were should be included.
objdump -d vulnerableSoftware | grep ret
i386-32-little
Address space layout randomization (ASLR)
Global Offset Table (GOT)
ASLR Bypass - Ret2lib
Steps


Buffer Overflow
Find overflow - Cyclic patterns
Python script - Cyclic pattern + injection

Shellcode
Last updated