| name | performing-firmware-extraction-with-binwalk |
| description | Use when performing firmware image extraction and analysis using binwalk to identify embedded filesystems, compressed archives, bootloaders, kernel images, and cryptographic material. Covers entropy analysis for detecting encrypted or compressed regions, recursive extraction of nested archives, SquashFS/CramFS/JFFS2 filesystem mounting, and string analysis for credential and configuration discovery. |
| domain | cybersecurity |
| tags | ["firmware","binwalk","extraction","entropy","IoT-security","reverse-engineering"] |
| subdomain | firmware-analysis |
| version | 1.0.0 |
| author | oyi77 |
| license | Apache-2.0 |
| nist_csf | ["ID.RA-01","PR.PS-01","DE.AE-02"] |
Performing Firmware Extraction With Binwalk
Overview
Cybersecurity skill for performing firmware extraction with binwalk. Follows industry best practices and security standards.
When to Use
Trigger phrases:
-
"performing firmware extraction with binwalk"
-
"Performs firmware image extraction and analysis using binwalk to identify embedd"
-
Analyzing IoT device firmware downloaded from vendor sites or extracted from flash chips
-
Reverse engineering router, camera, or embedded device firmware for vulnerability research
-
Identifying embedded filesystems (SquashFS, CramFS, JFFS2, UBIFS) within firmware blobs
-
Detecting encrypted or compressed regions using entropy analysis
-
Extracting hardcoded credentials, API keys, certificates, or configuration files from firmware
-
Performing security assessments of embedded devices in authorized penetration tests
Do not use for analyzing standard desktop application binaries or malware samples that are not firmware images; use dedicated malware analysis tools instead.
When NOT to Use
- When you lack proper authorization for testing
- For production systems without change management
- When the task requires legal or compliance expertise beyond technical scope
Prerequisites
- binwalk v3.x installed (
pip install binwalk3 or from system package manager)
- Python 3.8+ with standard libraries (struct, math, hashlib, subprocess)
- SquashFS tools (
unsquashfs) for mounting extracted SquashFS filesystems
- Jefferson for JFFS2 filesystem extraction (
pip install jefferson)
- Sasquatch for non-standard SquashFS variants used by vendors like TP-Link and D-Link
strings utility (GNU binutils) for string extraction
- Optional: firmware-mod-kit for repacking modified firmware images
Workflow
import re
IOC_PATTERNS = {
"ip": r"\b(?:\d{1,3}\.){3}\d{1,3}\b",
"domain": r"\b[a-z0-9-]+\.[a-z]{2,}\b",
"hash_md5": ,
: ,
}
() -> :
{k: re.findall(v, text) k, v IOC_PATTERNS.items()}