Lion Cipher Lab

Reverse an undocumented binary file format from three samples and write a safe parser for it

Why it matters

Analysts constantly meet data they have no documentation for: a log written by a vendor appliance, a cache file from an app, a config blob inside a firmware image, a custom file a program writes to disk. Being able to work out the layout from a few samples turns an opaque blob into evidence you can search, timeline and explain. The same skill is how researchers find parser bugs: a program that trusts the length fields in a file it did not write is a classic source of crashes and security flaws. In this lab you reverse a format that you generate yourself, so every answer is checkable, and you…

What you'll learn

Steps in this lab

  1. The situation: an unknown file and no documentation
  2. Generate the samples, then hide the generator
  3. First look: file, strings and a hex dump
  4. Compare two samples to find the count and the timestamp
  5. Find the record layout
  6. Identify the trailer: guess the checksum
  7. Crack c.dat: a flag, a key and a known-plaintext crib
  8. Write the parser and write down the format note
  9. Try to break your own parser: truncation and lying lengths
  10. Check yourself against the vendor, and what a pro does differently
  11. Clean up

Open the full interactive lab →

Keep learning