Lion Cipher Lab

Recover a deleted file by walking the ext4 filesystem on disk — superblock, inode, extent tree, and the journal

Why it matters

"Deleting" a file almost never means erasing its data. On every mainstream filesystem, unlink is a bookkeeping operation: the filesystem marks the space free and drops the name, and the bytes sit exactly where they were until something else claims and overwrites that space. That single fact is the entire foundation of file-recovery AND of digital forensics — and the entire reason 'I deleted it' is not the same sentence as 'it is gone.' But the details are filesystem-specific, and ext4 — the default on most Linux systems and Android — has a design choice that trips up people who learned…

What you'll learn

Steps in this lab

  1. The one fact this whole lab rests on — and the forensic prime directive
  2. Build a real ext4 filesystem inside a file, and mount it
  3. Write a known 'canary' file and fingerprint it
  4. Read the SUPERBLOCK with dumpe2fs
  5. Walk the directory, stat the inode, and read the EXTENT TREE
  6. Delete the file — then watch ext4 erase the inode's map
  7. Recovery route A — read the raw data blocks with dd
  8. Recovery route B — mine the ext4 JOURNAL for the old inode
  9. Now DESTROY the recovery — prove the failure mode that beats everyone
  10. The named failure modes, said plainly
  11. Judgment — how a pro does it, and when NOT to do it by hand
  12. What you actually built

Open the full interactive lab →