WCU / Cybersecurity
~/CSC 472/Class 09/KP 18
Class 09 · KP 18 / 25

A Disciplined Heap Workflow

allocated chunksizeheaderuser datafreed chunk (tcache)sizeheaderfd → next freereused by UAFUse-after-free: the pointer still works after free — read, or overwrite fd.
glibc heap: a dangling pointer to a freed chunk becomes a read/write primitive.
  • Map the program's heap use: which sizes are allocated, when they are freed, and whether freed pointers are reused.
  • Find the bug: UAF, double-free, or overflow — and the input that triggers it.
  • Confirm the layout in pwndbg: sizes, bins, adjacency.
  • Choose a primitive: arbitrary write via poisoning, or type confusion via UAF/double-free.
  • Pick a target: GOT entry, return address, function pointer (hooks on older glibc).
  • Escalate to shell and verify.
Key Takeaway

Heap exploitation is methodical: layout, bug, primitive, target, payload — validated at each step in the debugger.