Gdb
Basics
r~ run programni~ step to next instructionc~ coninue execution of program to breakpoint or end of program if no breakpoint is setb *main~ add a breakpoint at mainb *0xdeadbeef~ add a breakpoint at a specific addresinfo break~ list all breakpointsdelete breakpoint <number>~ delete breakpoint with providednumberbreakpoint identifierx/30gx $rsp~ display first 30 values, after a stack pointerx/s 0x0000000040080e~ display a string at provided addresdisass main~ disassembly provided functionx/4i 0x0000000000401393~ get 4 instructions on provided address
Show all secitons of a file
info file
Display current state of registers
info registers
List all maped memory regions
info proc mappings
Check protections used on a file
issue command checksec
Canary~NX~PIE~Fortify~ nobody knowsRelRO~
ROP gadgedts
~/.local/bin/ROPgadget --binary a.out- registers:
rdi~ first argumentrsi~ second argument
HEAP
vis~ show heap visuallyheap~ display chunksbins~ diplay TCACHE, FASTBIN, UNSORTED BIN pointers
If binary is stripped
info file -> break at entry point