SPI 103: Firmware Analysis
Now that we've successfully dumped the . bin file from the SPI flash chip, the next step is to analyze it. This process helps uncover the contents of the firmware like file systems, configuration files, scripts, and potentially sensitive data.
Before doing any advanced analysis, we identify what type of file we're dealing with using the file command:
file TL-WR840N.binThis gives us a basic classification whether it's just data, a compressed archive, or contains a known file system like SquashFS.

This means the file does not have a standard file header recognized by file. We’ll need deeper inspection.
Sometimes firmware contains plain-text strings (e.g., usernames, URLs, or paths). To extract them:
strings TL-WR840N.bin | lessThis will give you readable content embedded in the binary, including references to:
192.168.0.1/etc/config/ or /bin/shThese are strong indicators that this binary includes a Linux-based embedded firmware.

Next, we use Binwalk, a powerful tool to locate and extract embedded filesystems from binary blobs.
sudo apt install binwalk
binwalk TL-WR840N.bin
To extract these embedded filesystems automatically:
binwalk -e TL-WR840N.binThis creates a directory like _TL-WR840N.bin.extracted/ containing the extracted
filesystem. You can explore it using normal commands:
cd _TL-WR840N.bin.extractedlsThen navigate the file system structure:
cd squashfs-rootlsLook for directories like /etc, /www, or /bin.

Once extracted, you can:
Look inside configuration files:
cat etc/passwd cat etc/shadowCheck for scripts:
ls bin/ ls sbin//etc/passwd Note: The file may not contain password hashes those are usually in
/etc/shadow.
If you want a quick automated overview, use Firmwalker, a script that scans extracted firmware directories for interesting files like:
Once you’ve extracted the root filesystem using Binwalk:
git clone https://github.com/craigz28/firmwalker.gitcd firmwalker./firmwalker.sh ../_TL-WR840N.bin.extracted/squashfs-root

This outputs a categorized list of findings, like:
In this final post, we explored how to dig into a raw firmware dump using both manual and automated tools. With tools like strings, binwalk, and firmwalker, you now know how to: