Lion Cipher Lab

Recover deleted rows from a SQLite WAL and freelist (forensic carving)

Why it matters

SQLite is the most deployed database on earth: it is inside your web browser's history, your phone's text and chat apps, and countless desktop programs. When a suspect 'deletes' messages, SQLite usually does not actually erase them -- the bytes linger in the file's unused space, in freed pages, and in the -wal journal. Knowing how to carve those rows back out, by reading the file format directly instead of trusting a SELECT, is a core digital-forensics skill. It also teaches the discipline that keeps evidence admissible: work on a copy, and never let the database quietly checkpoint or VACUUM…

What you'll learn

Steps in this lab

  1. When you reach for this -- and when it will not work
  2. How to run Python from a cold start (zero assumptions)
  3. The SQLite file format you actually need
  4. The -wal sidecar, and why it is a goldmine
  5. Build the evidence database (a fake deleted chat)
  6. Carve the deleted rows out of the -wal by hand
  7. The freelist path: carving whole recycled pages
  8. The honest negative: watch VACUUM destroy the evidence
  9. How a pro does it differently

Open the full interactive lab →