Lion Cipher Lab

Exploit the heap with the House of Botcake (bypass the tcache double-free key by routing through the unsorted bin)

Why it matters

The two earlier tcache labs each stopped short of one wall. The use-after-free lab reused a freed chunk without ever re-freeing it; the poisoning lab corrupted a freed chunk's fd but never freed the same chunk twice -- both deliberately, because glibc 2.29 added a defence that makes the naive move (free the same tcache chunk twice) abort instantly with 'free(): double free detected in tcache'. That defence is a per-chunk `key` stamped on every tcache insertion; free() checks it and refuses a repeat. House of Botcake is the technique that walks around that check instead of through it, and the…

What you'll learn

Steps in this lab

  1. Read this first: your own container, your own program, authorized-only
  2. The wall this climbs: the tcache double-free key (glibc 2.29)
  3. The trick in one breath: fill the tcache, consolidate, then re-free
  4. Pin glibc with Docker -- the version is the whole game
  5. Write the vulnerable target -- a slot allocator with a UAF write and an aligned function pointer
  6. Compile with mitigations off for teaching -- and note what stays ON
  7. Watch the double-free get ACCEPTED in pwndbg (tcachebins)
  8. Fire the exploit: overlap the tcached victim, poison its fd, land the write
  9. When it fails, and do it better: version sensitivity and the real fixes

Open the full interactive lab →