<!-- Copyright (c) 2026 defconxt. All rights reserved. -->
<!-- Licensed under AGPL-3.0 — see LICENSE file for details. -->
<!-- NERF is a trademark of defconxt. -->
---
name: analyzing-firmware-images
description: >-
  Analyze firmware images to extract filesystems, identify embedded credentials, discover vulnerabilities, and map hardware interfaces.
domain: cybersecurity
subdomain: reverse-engineering
tags:
  - firmware
  - binwalk
  - iot
  - embedded
  - filesystem-extraction
version: "1.0"
author: defconxt
license: AGPL-3.0
metadata:
  mitre-attack: ["T1542"]
  cwe: ["CWE-798"]
  tools: ["binwalk", "firmware-mod-kit", "FACT", "ubi_reader", "jefferson"]
---

# Analyzing Firmware Images

## Overview

Analyze firmware images to extract filesystems, identify embedded credentials, discover vulnerabilities, and map hardware interfaces.

## Prerequisites

| Tool / Requirement | Details |
|---|---|
| `binwalk` | Security tooling |
| `firmware-mod-kit` | Security tooling |
| `FACT` | Security tooling |
| `ubi_reader` | Security tooling |
| `jefferson` | Security tooling |
| Isolated lab environment for testing | Environment requirement |
| Authorization and signed Rules of Engagement (RoE) | Environment requirement |
| Relevant target samples or systems acquired through authorized channels | Environment requirement |

## Quick Reference

```bash
# Extract firmware filesystem
binwalk -e firmware.bin
binwalk --dd='.*' firmware.bin

# Analyze firmware entropy
binwalk -E firmware.bin

# Mount extracted filesystem
sudo mount -o loop extracted/squashfs-root.img /mnt/fw

# Search for credentials
grep -r "password\|secret\|key" /mnt/fw/etc/
find /mnt/fw -name "*.conf" -exec grep -l "pass" {} \;
```

## Workflow

### Step 1: Preparation and Reconnaissance

```bash
# Identify target and gather initial intelligence
file ./target_sample
binwalk --version 2>/dev/null || echo "Install binwalk"

# Set up working directory
mkdir -p /tmp/analyzing-firmware-images/{output,logs,artifacts}
```

### Step 2: Primary Analysis

```bash
# Execute primary analysis with binwalk
# Refer to Quick Reference above for detailed commands
echo "[*] Running Analyzing Firmware Images with binwalk..."

# Log all operations
script -q /tmp/analyzing-firmware-images/logs/session.log
```

### Step 3: Deep Investigation

```bash
# Apply firmware-mod-kit for secondary analysis
echo "[*] Deep investigation with firmware-mod-kit..."

# Cross-reference findings
diff /tmp/analyzing-firmware-images/output/primary.json /tmp/analyzing-firmware-images/output/secondary.json
```

### Step 4: Documentation and Reporting

```bash
# Generate structured findings report
cat <<'EOF' > /tmp/analyzing-firmware-images/output/report.json
{
  "technique": "analyzing-firmware-images",
  "domain": "reverse-engineering",
  "tools_used": ["binwalk", "firmware-mod-kit"],
  "findings": [],
  "recommendations": []
}
EOF
```

## Detection

```yaml
title: Firmware Images Detection
id: 42eddd8c-776f-4b7d-9f25-af9c2638a62e
status: experimental
description: Detects suspicious activity related to analyzing firmware images techniques in reverse engineering context
logsource:
  category: process_creation
  product: windows
detection:
  selection:
    CommandLine: "*analyzing*firmware*"
  condition: selection
level: medium
tags:
  - attack.t1542
  - attack.defense_evasion
falsepositives:
  - Malware analysis sandbox performing automated binary inspection
```


**Detection Opportunities**

| Indicator | Source | Detection Logic |
|---|---|---|
| Firmware Images Detection | windows/process_creation | Sigma rule (medium) |
| ATT&CK Coverage | MITRE ATT&CK | T1542 |

## Verification

- [ ] Environment and tools verified and operational
- [ ] Target samples acquired through authorized channels
- [ ] Primary analysis completed with findings documented
- [ ] Secondary validation performed with independent tooling
- [ ] All artifacts preserved in structured output directory
- [ ] Detection opportunities documented for blue team

## References

- [MITRE ATT&CK T1542](https://attack.mitre.org/techniques/T1542) — Related technique
- [binwalk Documentation](https://binwalk.org/) — Primary tooling
- [firmware-mod-kit Reference](https://firmware-mod-kit.org/) — Secondary tooling
