Turning a memory-corruption bug in a compiled program into control of what it executes. The pwn category of CTFs, the foundation of vulnerability research, and the practical reason “rewrite it in a memory-safe language” is a security argument.

Every note assumes the authorization in rules of engagement. This is lab, CTF, and authorised-testing material — the techniques are identical to a crime, and the authorisation is the whole difference.

The one idea: an exploit is a chain — a bug gives you a small primitive (a read, a write, one controlled register), and exploitation is composing primitives into control of RIP. Modern defences didn’t fix the bugs; they made the chaining harder, so the era shifted from injecting code to reusing the target’s own code.

Why this exists

The vault covered offensive security (ethical-hacking) but treated binary exploitation as a single bullet. It’s what OSCP-adjacent work and most CTF pwn demands, and it’s the natural application of C, computer architecture and OS — so it earns a section.

Reading order

01–02 are the base case; 04–05 are the modern reality. Read in order — each note is a defence added on top of the last, and its bypass.

  1. process-memory-and-why-it-breaks — [Intermediate] — the memory map, the register set, the bug taxonomy, and why memory-unsafe languages made this a discipline
  2. the-stack-and-buffer-overflows — [Intermediate] — the classic exploit mechanically: overwrite the return address, find the offset with a cyclic pattern, ret2win
  3. shellcode — [Intermediate] — the payload, its three strange constraints (no nulls, position-independent, tiny), and why it’s decreasingly injected as raw bytes
  4. modern-mitigations — [Intermediate] — NX, canaries, ASLR, PIE, RELRO — what each stops, what each doesn’t, and reading checksec as a recipe
  5. bypassing-mitigations — [Advanced] — ret2libc, the info-leak that defeats ASLR, and ROP: writing a program in the target’s own gadgets
  6. format-strings-and-the-heap — [Advanced] — the bug that gives a read and a write for free, and use-after-free, which runs the modern real-world scene
  7. the-toolkit-and-practice — [Intermediate] — pwntools, pwndbg, ROPgadget, and the ladder of places to practise legally

If you only take three things

  1. checksec first. The mitigations enabled are the spec of which technique you need (04).
  2. Modern exploitation reuses code, it doesn’t inject it — NX forced ROP, ASLR forced the leak-first pattern (05).
  3. Develop every exploit locally against process(), so hitting the real target is one line (07).
↑ Back to Cybersecurity