[Intermediate] — the tools you’ll actually use, and the ladder of places to practise legally.

The core tools

checksec — the first command, every time. Which mitigations are on → which technique you need → mitigations.

gdb + pwndbg (or GEF) — the debugger, made usable. Vanilla gdb is painful; pwndbg adds register/stack/flag views on every stop, heap inspection, and cyclic:

pwndbg> checksec
pwndbg> cyclic 200            # generate a pattern
pwndbg> run                  # crash it
pwndbg> cyclic -l 0x6161616c # find the offset from what landed in RIP
pwndbg> vmmap                # the memory map — where everything is loaded
pwndbg> got                  # the GOT, for overwrite targets
pwndbg> heap / bins          # heap chunk and bin state

pwntools — the Python exploitation framework. It is the single biggest force multiplier here:

from pwn import *
context.binary = elf = ELF("./vuln")     # sets arch/endianness automatically
p = process("./vuln")                    # or remote("host", 1337) for the real target
p.recvuntil(b"name: ")
p.sendline(flat(b"A"*72, p64(win)))      # flat() + p64() build the payload
p.interactive()                          # drop into the shell you popped

p64/u64 (endianness), cyclic (offsets), ROP (chain building), fmtstr_payload (format strings), shellcraft (shellcode), and process↔remote symmetry (develop locally, then change one line to hit the target) — this is why every writeup uses it.

ROPgadget / ropper — find gadgets: ROPgadget --binary ./vuln | grep "pop rdi".

one_gadget — finds a single libc address that pops a shell on its own (a execve("/bin/sh") call with the right register state pre-satisfied). Often turns a multi-step ret2libc into a one-liner.

Ghidra / IDA / Binary Ninja — decompilers, for when you don’t have source. Ghidra is free and excellent → reverse the binary to find the bug and the win function.

objdump -d, readelf, nm, strings, ltrace, strace — the classic inspection kit.

The exploit-development loop

1. checksec            → which mitigations → which technique
2. reverse / read source → find the bug and the primitives
3. cyclic              → find the offset
4. build locally with pwntools against process()
5. leak if needed (ASLR/canary/PIE)
6. build the ROP/ret2libc chain
7. switch process() → remote() → same exploit, real target
8. p.interactive()     → the flag

Step 7 is the payoff of pwntools’ design — a working local exploit becomes a remote one by changing one line.

Where to practise, in order

This is a skill sport — the notes are the map, these are the reps. In rough difficulty order:

PlatformWhat it’s for
🟢picoCTFThe gentlest on-ramp. Binary exploitation category, guided
🟢ROP EmporiumPurpose-built for exactly this ladder — ret2win → ret2libc → ROP → format-independent chains, one concept per challenge, same binary across archs
🟢pwn.collegeA full free university course (ASU) — memory, shellcode, ROP, heap, kernel. The most structured path that exists
🟡how2heapThe canonical heap-technique catalogue, runnable and annotated
🟡NightmareA free intro-to-binary-exploitation CTF course, problem by problem
🟡HackTheBoxpwn challenges, plus full machines
🔴Live CTFs (CTFtime)Where it stops being exercises — real, timed, novel

Start with ROP Emporium and pwn.college. Between them they cover this entire folder, in order, with a runnable target for each step.

Set up a practice environment

# Kali/Ubuntu
sudo apt install gdb python3-pip
pip install pwntools
git clone https://github.com/pwndbg/pwndbg && cd pwndbg && ./setup.sh
 
# a first vulnerable binary, defences off:
gcc -fno-stack-protector -z execstack -no-pie -o vuln vuln.c
echo 0 | sudo tee /proc/sys/kernel/randomize_va_space   # ASLR off, for learning ONLY

Turn defences off to learn the base case, then turn them back on one at a time — this maps exactly onto the mitigations note, and feeling each one break your exploit is the fastest way to understand what it does.

Everything here is for binaries you own, deliberately-vulnerable practice targets, CTFs, and systems you have written authorisation to test → rules of engagement. The techniques are identical whether the context is a CTF or a crime; the authorisation is the entire difference, and there is no grey area.

Where this leads

  • Vulnerability research — finding the bugs in the first place, with fuzzing (AFL++, libFuzzer) and reversing. This is where the field is going — exploiting known bugs is a solved craft; finding them is the frontier and the highest-paid work
  • Browser and kernel exploitation — the deep end: type confusion, JIT bugs, kernel UAF. Enormous bounties (Pwn2Own), years to master
  • The defensive payoff — understanding exactly how these work makes you far better at detection, at reading crash dumps, and at arguing for memory-safe languages with evidence

Key insight

Binary exploitation is learned at the keyboard, not on the page — pwntools plus pwndbg plus ROP Emporium plus pwn.college is the entire toolchain and curriculum. The workflow is fixed (checksec → find the bug → cyclic → build locally → leak → chain → go remote), and the single highest-leverage habit is developing every exploit against a local process() so switching to remote() is one line. The reps are the point; the notes only tell you which technique the checksec output is asking for.

Source: [reference] — Aug 2026.

↑ Back to Binary Exploitation