extract_firmwareHow to REA Embedded Firmware: Binwalk Header Scanning & SquashFS Extraction
Extract and audit IoT router, automotive, and embedded device firmware: scan binary flash ROMs for magic signatures, unpack SquashFS, CramFS, and JFFS2 filesystems, and hand off extracted ARM/MIPS binaries to decompilers.
In this official REA guide for Embedded Firmware Images, AI coding agents (Claude Code, Cursor, Windsurf) execute 'rea extract ./router_firmware.bin --provider binwalk --json' to safely extract file layout, symbols, and code logic without launching unverified binaries.
The Problem & Target Artifact
IoT security testing: You dumped the SPI flash chip of an IP camera or Wi-Fi router. You need to extract the Linux root filesystem, locate the web management daemon, and audit its authentication logic.
Natural Language Agent Instructions
Copy and paste this prompt directly into your AI coding agent when REA is registered via Model Context Protocol (MCP):
Scan and extract ./router_firmware.bin using Binwalk. Extract the root filesystem, locate the web server executable (httpd), and list all default configuration files in /etc.Run REA Analysis Command
Execute the following command in your terminal or inspect the MCP JSON-RPC call executed by your agent:
rea extract ./router_firmware.bin --provider binwalk --jsonWhat REA Extracts & Returns
Extracted Firmware Partition Layout
The verified findings and synthesized clean-room structures generated from this investigation:
{
"image": "router_firmware.bin",
"partitions": [
{ "offset": "0x00000000", "description": "u-boot bootloader", "size": "0x00040000" },
{ "offset": "0x00040000", "description": "Linux kernel image (LZMA)", "size": "0x00180000" },
{
"offset": "0x001c0000",
"description": "SquashFS filesystem (little-endian, version 4.0)",
"extracted_path": "/artifacts/squashfs-root",
"target_binaries": ["/bin/httpd", "/sbin/rc"]
}
]
}Signature Carving & Safe Sandboxed Extraction
REA invokes Binwalk or Unblob within an isolated directory tree. It validates file magic bytes and compression headers (LZMA, gzip, zstandard) to establish partition offsets, then recursively unpacks nested filesystems while enforcing a strict destination depth cap to protect against ZIP-bomb/tar-bomb path traversal exploits.