Published on

Pwn Learning Path #0: From Stack Frames to Advanced Exploitation

Authors
  • avatar
    Name
    Muhammad Huzaifa
    Twitter

IMPORTANT

Everything in this series is practiced on local labs, CTF challenges, and systems I own or have explicit permission to test.

I am learning pwn by building and debugging small Linux x86_64 programs. The goal is not to collect payloads. It is to understand exactly why control flow changes, what each stack value does, and why an exploit succeeds or crashes.

This post is the index for that journey. I will keep extending it as I move from stack basics into mitigations, format strings, heap exploitation, reversing, and advanced topics.

How I am learning

My loop for every lab is simple:

  1. Build and run the program normally.
  2. Check the binary and its mitigations.
  3. Read the source, then confirm it in disassembly.
  4. Reproduce the crash in GDB.
  5. Identify the bug, offset, primitive, and target.
  6. Build the smallest payload that proves the idea.
  7. Run it again outside GDB.
  8. Explain what changed in registers and memory.

The core commands stay deliberately boring and repeatable:

file ./chall
checksec ./chall
readelf -a ./chall
objdump -d -M intel ./chall
nm -an ./chall
gdb ./chall

That repetition is useful. It turns initial reconnaissance into a habit instead of a checklist I have to remember under pressure.

Current series

PartTopicMain lesson
0RoadmapBuild a practical, repeatable learning loop
1Stack framesRead calls, registers, local variables, and saved return addresses
2Basic ret2winOverwrite saved RIP and reuse an existing function
3ret2win with one argumentSet rdi with pop rdi; ret
4ret2win with two argumentsControl rdi and rsi in one ROP chain
5ret2win with three argumentsApply the AMD64 calling convention to rdx
6Cyclic offset discoveryMeasure the saved RIP offset instead of guessing
7Stack alignmentDiagnose movaps crashes and repair alignment
8Compiler-generated SSE alignmentSee the same failure in ordinary compiled C
9My first ret2libc leakLeak libc, calculate its base, and plan system("/bin/sh")

The first eight labs are complete. Part 9 is my current checkpoint, so that post documents the model and the two-stage plan without pretending I have finished the learner exploit.

The longer path

The current labs cover the beginning of stack exploitation. The full roadmap continues through six broad phases:

  • foundations: C memory, x86_64 assembly, ELF files, GDB, and pwntools;
  • stack exploitation: overflows, ROP, ret2libc, leaks, and mitigation-aware payloads;
  • format strings and linking internals;
  • heap exploitation across relevant glibc versions;
  • reversing unfamiliar and stripped binaries;
  • advanced topics such as SROP, ret2dlresolve, fuzzing, and kernel basics.

My target is practical independence: find the bug, describe the primitive, choose an exploit direction, and debug failure without immediately reaching for a walkthrough.

The labs and full curriculum live in my PWN-path repository.

Next

Part 1: learning to read stack frames in GDB →