Challenge Overview
Challenge: Silicon Data Sleuthing
Category: Forensics
Difficulty: Easy
Points: 975
Solves: 8
In this challenge, we analyze a recovered OpenWrt router firmware image to extract sensitive configuration data. The challenge demonstrates the importance of understanding firmware extraction techniques and the security implications of overlay filesystems in embedded Linux devices.
Challenge Description
In the dust and sand surrounding the vault, you unearth a rusty PCB… You try to read the etched print, it says Open…W…RT, a router! You hand it over to the hardware gurus and to their surprise the ROM Chip is intact! They manage to read the data off the tarnished silicon and they give you back a firmware image. It’s now your job to examine the firmware and maybe recover some useful information that will be important for unlocking and bypassing some of the vault’s countermeasures!
Questions to Answer
- What version of OpenWRT runs on the router?
- What is the Linux kernel version?
- What’s the hash of the root account’s password?
- What is the PPPoE username?
- What is the PPPoE password?
- What is the WiFi SSID?
- What is the WiFi Password?
- What are the 3 WAN ports that redirect traffic from WAN → LAN?
Preliminary inspection
We first want to know the file we have:
| |
| |
Filesystems Identified (why they matter)
- SquashFS: A compressed, read-only filesystem designed for embedded systems. It minimizes storage footprint (here, xz-compressed) and holds factory-default files under
/rom. Because it is immutable, it cannot be changed at runtime. - JFFS2 (Journaling Flash File System v2): A writable filesystem for raw flash (NOR/NAND) with wear-leveling and journaling. On OpenWrt, JFFS2 is mounted as the overlay (
/overlay) and merged over/romto form the live root (/). User changes (passwords, network configs, firewall rules) persist here across reboots.
In practice, OpenWrt combines both via overlayfs: the immutable SquashFS provides the base system, while JFFS2 stores all runtime modifications. This is why sensitive data (e.g., the real root password hash and custom firewall DNAT redirects) are found in the JFFS2 overlay rather than the SquashFS.
Carving SquashFS by signature (“hsqs”)
To locate the SquashFS superblock inside the raw dump, we search for its magic string:
| |
-a: Treat binary as text for matching.-b: Print the byte offset of each match.-o: Print only the matching part (here,hsqs).
SquashFS uses the ASCII magic hsqs at the start of its superblock (little-endian representation of the filesystem signature). The output 4375240:hsqs tells us the superblock begins at byte offset 4,375,240.
We then carve the filesystem starting at that offset to the end of the file:
| |
if: input file (the full chip dump).of: output file (the carved SquashFS image).bs=1: Use a 1-byte block size soskipis in exact bytes.skip=4375240: Skip precisely to the SquashFS superblock.
Tip: Using bs=1 avoids off-by-block errors (default dd blocks are 512 bytes). After carving, verify with file squashfs.img (should report a SquashFS v4 image), then extract with unsquashfs.
Solution
Step 1: Firmware Analysis & Extraction
Initial analysis reveals the firmware image contains multiple filesystems:
| |
Extract the firmware:
| |
This creates two key components:
- SquashFS (
0.squashfs): Read-only root filesystem - JFFS2 (
393D38.jffs2): Writable overlay partition
Step 2: Understanding the Filesystem Hierarchy
OpenWrt uses an overlay filesystem architecture:
/rom→ SquashFS (read-only, factory defaults)/→ JFFS2 (read-write, user modifications)
This allows configuration changes to persist across reboots without modifying the immutable ROM.
Step 3: Extract JFFS2 Overlay
Use jefferson to unpack the JFFS2 partition:
| |
The JFFS2 partition contains:
upper/: Overlay filesystem (modified files)work/: JFFS2 working directory
Step 4: Extract Sysupgrade Archive
Within the overlay, find sysupgrade.tgz - the backup containing all configuration:
| |
This exposes the etc/ directory with all configuration files.
Answering the Questions
1. OpenWrt Version
| |
Answer: 23.05.0
2. Linux Kernel Version
| |
Answer: 5.15.134
3. Root Password Hash
This is the key insight: the SquashFS shadow file is empty (root:::...), but the overlay contains the actual hash:
| |
Answer: root:$1$YfuRJudo$cXCiIJXn9fWLIt8WY2Okp1:19804:0:99999:7:::
Why this matters: The root filesystem is immutable; password changes are stored in the JFFS2 overlay. This is how users can modify passwords without corrupting the factory image.
4 & 5. PPPoE Credentials
Located in UCI (Unified Configuration Interface) config:
| |
Answers:
- Username:
yohZ5ah - Password:
ae-h+i$i^Ngohroorie!bieng6kee7oh
6 & 7. WiFi SSID and Password
Located in wireless configuration:
| |
Answers:
- SSID:
VLT-AP01 - Password:
french-halves-vehicular-favorable
8. WAN Redirect Ports
The firewall configuration contains DNAT rules mapping WAN ports to internal LAN services:
| |
Answer: 1778,2289,8088 (numerically sorted)
Key Takeaways
Overlay Filesystems: Understanding how OpenWrt uses SquashFS + JFFS2 overlays is critical for firmware forensics.
Configuration Persistence: Mutable data (passwords, network settings) is stored in writable overlays, not the immutable ROM.
Firmware Extraction Tools:
binwalk: Identify and extract embedded filesystemsjefferson: Unpack JFFS2 partitions- Standard archiving tools (
tar,gunzip) for config backups
Security Implications: Router firmware often contains plaintext credentials. Proper access controls and encryption are essential.
Tools Used
binwalk- Firmware analysis and extractionjefferson- JFFS2 extractiontar- Archive extraction- Standard Unix utilities (
cat,grep,strings)