GDB
GNU Debugger
Configuration
GDB Enhanced Features (GEF)
bash -c "$(curl -fsSL https://gef.blah.cat/sh)"Pwntools
p = process('./garbage')
gdb.attach(p)Initial Analysis
Check Binary Protections
NX ENABLEDβ Needret2libcorROP(no shellcode on stack)CANARYβ Can't overflow return address directlyPIE ENABLEDβ Addresses change every run (harder exploitation)ASLRβ Library addresses randomize
View Memory Layout
What to look for:
Stack permissions
libcbase addressExecutable regions
Disassemble Main Functions
What to look for:
Calls to dangerous functions
Buffer allocations
Function calls and their arguments
Finding String Constants in Binary Comparisons
The Pattern to Look For
Dynamic Analysis
If you want to see the comparison in action:
When breakpoint hits, examine the arguments:
Skip Illegal instructions by patching UD2 with NOP
Keep going:
patchβcontinueβpatchβcontinueOnce all ud2s are patched, program runs without crashes
Last updated