Course contentsShow
← Security
Lesson 2761 of 3,05252. Embedded and IoT SecurityFree lesson

Firmware Binary Analysis and Unpacking

Using binwalk, firmware-mod-kit, and other tools to identify file systems, compression, and extract embedded components.

Firmware Binary Analysis and Unpacking

You'll learn how to dissect and extract the internal components hidden within firmware binaries using specialized reverse engineering tools.

What Is Firmware Binary Analysis?

Once you've extracted firmware from a device (our previous lesson), you're left with a binary blob—essentially a compressed, layered archive containing file systems, bootloaders, kernels, applications, and configuration files. Firmware binary analysis is the process of identifying what's inside this blob and unpacking it into analyzable components. Think of it like receiving a matryoshka doll: you need to identify each layer's material and mechanism before you can open it and see what's nested inside.

Core Tools for Unpacking

binwalk is the Swiss Army knife of firmware analysis. It scans binaries for known file signatures (magic bytes) to identify embedded file systems (squashfs, cramfs, JFFS2), compression formats (gzip, LZMA), bootloaders, and executable code. Running binwalk -e firmware.bin automatically extracts recognized components.

firmware-mod-kit (FMK) extends this by rebuilding firmware after modification—useful for testing or patching vulnerabilities.

Other essential tools include:

  • dd for manual extraction at specific offsets
  • unsquashfs for squashfs file systems
  • jefferson for JFFS2 file systems
  • entropy analysis (via binwalk -E) to identify encrypted or compressed sections

The Analysis Workflow

Start with binwalk firmware.bin to map the binary structure. Look for filesystem boundaries, compression headers, and kernel images. Extract components using automatic or manual methods, then analyze individual files for hardcoded credentials, vulnerable services, or backdoors.

Key Takeaway: Firmware binary analysis uses tools like binwalk and firmware-mod-kit to identify compression, file systems, and embedded components within firmware blobs, transforming opaque binaries into analyzable directory structures ripe for security assessment.