Lion Cipher Lab
Find the filesystem inside a firmware image you built yourself, with binwalk
- Penetration Testing / Red Team
- Intermediate
- ~75 min
- Free · no account required
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
- building a small squashfs filesystem and wrapping it in a header and padding like a real firmware image
- running a binwalk signature scan and reading the decimal and hexadecimal offsets it prints
- using the v3 flags (-e extract, -E entropy, -d output folder, -M recursive) and knowing v3 differs from older v2 guides
- telling padding, compressed data and sealed (encrypted or random-looking) data apart by entropy
- carving a region out of a file by offset with dd and listing it with unsquashfs
- finding hard-coded credentials in extracted configuration files and explaining the fix
Steps in this lab
- What a firmware image is, and why you build one before you open one
- Make a tiny root filesystem with a fake secret in it
- Wrap it in a header, padding and a sealed blob to make firmware.bin
- Look for the signature yourself first
- Run binwalk's signature scan
- Read the entropy to learn what each region is
- Extract the filesystem with binwalk
- Carve it by hand with dd to prove you understood the offsets
- Hunt for hard-coded secrets in the extracted files
- When binwalk is not enough, and how a pro does it better
Open the full interactive lab →