Lion Cipher Lab

Find the filesystem inside a firmware image you built yourself, with binwalk

Why it matters

A router, camera or printer update is just one big file. Inside it sit a bootloader, a kernel and a filesystem full of scripts and config files, and vendors have a long history of leaving shared passwords and keys in them. Anyone can unpack that file in a minute. If you defend or assess devices, you need to do the same before an attacker does, and you need to know when the file will not open (because it is encrypted) and say so honestly. Building your own image first means you know what the right answer looks like.

What you'll learn

Steps in this lab

  1. What a firmware image is, and why you build one before you open one
  2. Make a tiny root filesystem with a fake secret in it
  3. Wrap it in a header, padding and a sealed blob to make firmware.bin
  4. Look for the signature yourself first
  5. Run binwalk's signature scan
  6. Read the entropy to learn what each region is
  7. Extract the filesystem with binwalk
  8. Carve it by hand with dd to prove you understood the offsets
  9. Hunt for hard-coded secrets in the extracted files
  10. When binwalk is not enough, and how a pro does it better

Open the full interactive lab →

Keep learning