gdb <binary>Loads a program without running it.
Example
gdb ./vulnThe GNU Debugger: set breakpoints, step through code, inspect memory and registers. Pair with GEF or pwndbg for exploit development.
sudo apt install gdbgdb <binary>Loads a program without running it.
Example
gdb ./vulngdb -q --args <binary> <args>Loads it with command-line arguments; -q skips the banner.
Example
gdb -q --args ./vuln AAAAgdb -p <pid>Attaches to a running process.
Example
sudo gdb -p 1337gdb <binary> <core>Opens a core dump to see where a crash happened.
Example
gdb ./server core.1337gdb -batch -ex "<cmd>" <binary>Runs commands non-interactively and exits.
Example
gdb -batch -ex "disassemble main" ./vulnrunStarts the program (r). run < input.txt feeds a file to stdin.
startRuns to the start of main and stops.
continueResumes until the next breakpoint (c).
stepiExecutes one machine instruction, entering calls (si). nexti (ni) steps over calls.
step / nextSource-level stepping into or over function calls when debug symbols exist.
finishRuns until the current function returns.
break <location>Sets a breakpoint on a function, file:line or address (b *0x401136).
Example
break mainbreak <function> if <condition>Conditional breakpoint.
Example
break strcmp if $rdi != 0watch <expr>Stops when a memory location changes.
Example
watch *(int*)0x404040info breakpointsLists breakpoints; delete <n> removes one.
catch syscall <name>Stops on a system call.
Example
catch syscall execveinfo registersAll general-purpose registers (i r). info registers rip for one.
x/<n><fmt> <addr>Examines memory: n units in a format — x hex, s string, i instructions, g giant (8-byte) words.
Example
x/32gx $rspx/10i $ripThe next ten instructions.
disassemble <function>Disassembles a function.
Example
disassemble mainset disassembly-flavor intelIntel syntax instead of AT&T; put it in ~/.gdbinit.
backtraceThe call stack (bt).
info proc mappingsThe process memory map — find libc and stack base addresses.
print <expr>Evaluates an expression, such as the address of a libc function.
Example
print systemset {int}<addr> = <value>Writes to memory.
Example
set {int}0x404040 = 1set lt;reg> = <value>Changes a register — for example to flip a check’s result.
Example
set $rax = 0checksecShows NX, PIE, RELRO, canary and Fortify status of the binary.
pattern create <n>Generates a cyclic pattern to find the offset that overwrites the return address.
Example
pattern create 200pattern search $rspFinds the offset of the pattern in a register or memory after a crash.
vmmapColour-coded memory map with permissions.
telescope $rsp 20Dereferences stack values recursively (pwndbg).
A complete command-line reverse-engineering framework: disassemble, debug, patch and analyse binaries for many architectures.
Traces the system calls and signals of a process — see which files it opens, what it sends and why it fails.
Displays information about object files: headers, sections, symbols and disassembly. Part of GNU binutils.
The NSA’s open-source reverse-engineering suite with a powerful decompiler; scriptable headless analysis from the command line.