Use After Free

Use-after-free exploitation: dangling refs, reclaim/spray, type confusion, C++ vptr hijack, kernel pool UAF notes.

netvar1337 4efa949 969 B Updated

File contents

Use-after-free (UAF)

Root patterns

  • Explicit free/delete then use
  • Callback after teardown
  • Iterator into cleared container
  • Refcount underflow → premature destroy (integer-overflow underflow)

Exploit path

  1. Stabilize free trigger
  2. Identify dangling object type/size
  3. Spray same-size controlled allocations
  4. Corrupt virtual function table / function ptr / length+buffer
  5. Call path that trusts dangling object

C++ tips

  • vptr first qword/qword on MSVC/Itanium layouts — confirm
  • Fake vtable in controlled spray; ensure RX or pivot to stack ROP if DEP

Kernel pool UAF (high level)

  • Pool backend/lookaside differences
  • Quota/process context
  • Prefer data-only (token) when SMEP/SMAP/CIG

Pair with

heap-exploitation, kernel-dev, c-review.

netvar1337/unleash/tree/main/contrib/skills/use-after-free commit 4efa9499d4

Frequently asked questions

npx skillmds@latest add netvar1337/use-after-free