Lion Cipher Lab

Hijack a file stream on modern glibc: File Stream-Oriented Programming with House of Apple 2 (borrow _IO_wfile_jumps to survive _IO_vtable_check)

Why it matters

For years the fastest heap-to-shell path was a hook: overwrite __malloc_hook or __free_hook with system (or a one-gadget) and let the next allocation call it. glibc 2.34 REMOVED both hooks. That single change promoted FILE-stream hijacking from a party trick to a PRIMARY modern control-flow primitive: the C stdio structures are still full of function pointers glibc calls on your behalf, and every process has open streams that get flushed at exit. The classic form of this -- the forged-vtable FSOP you met in the House of Orange lab -- is dead on any glibc >= 2.24, because _IO_vtable_check /…

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: why the House-of-Orange FSOP vtable forge now aborts
  3. The idea in one breath: borrow _IO_wfile_jumps, abuse the unvalidated wide vtable
  4. Pin glibc 2.35 with Docker -- and confirm the mitigation you are bypassing is ON
  5. Write the toy: a FILE you fully control, leaked addresses, and an exit() trigger
  6. Compile with mitigations off for teaching -- and note what stays ON
  7. Build the fake _IO_FILE: every field, and the branch it satisfies
  8. Fire it, and get the shell -- a call glibc made from its own exit path
  9. When it fails, and do it better: why FSOP matters now, and what still stops it

Open the full interactive lab →