firmware-emulation
БесплатноБез исполняемых скриптовНе проверенComprehensive firmware dynamic analysis and emulation using QEMU (user-mode and system-mode), GDB debugging, network traffic analysis, and automated tools…
от lza6★ 19 звёзд на GitHubОб этом скилле
Firmware Dynamic Analysis & Emulation
Run extracted firmware in controlled environments for dynamic analysis, debugging, and vulnerability testing. This skill provides comprehensive workflows for both automated and manual emulation approaches.
Emulation Strategy Decision Tree
Before starting emulation, determine the best approach:
Use AUTOMATED (Firmadyne/FirmAE) when:
- Analyzing multiple router/IoT firmware images quickly
- Need quick initial assessment
- Firmware is Linux-based embedded system
- You want network services automatically configured
- Time-constrained analysis
Use USER-MODE (qemu-user) when:
- Running individual binaries from extracted firmware
- Need quick testing of specific executables
- Debugging single applications
- Fuzzing specific binaries
- Full system emulation is overkill
Use SYSTEM-MODE (qemu-system) when:
- Need a guest kernel and modeled device environment
- Analyzing kernel-level behavior
- Require hardware supported by a specific QEMU board model (GPIO/MTD are not generic substitutes)
- Automated tools failed
- Advanced debugging of boot process needed
- Custom firmware with non-standard init
Examples with sudo, TAP/iptables or chroot assume a disposable Linux analysis
VM. Chroot and QEMU user-mode are not security boundaries and share the host
kernel/network. Keep debugger listeners inside that VM; QEMU's GDB stub has no
authentication. -L supplies an interpreter prefix, not an isolated rootfs.
Interactive foreign shells need suitable binfmt_misc registration for subsequent
execve calls, or each foreign executable must be launched through QEMU.
Prerequisites
Install Required Tools
# QEMU (all architectures)
sudo apt-get install qemu-system qemu-user-static qemu-user
# Cross-architecture debugging
sudo apt-get install gdb-multiarch
# Network tools
sudo apt-get install bridge-utils uml-utilities tcpdump wireshark tshark
# Filesystem tools
sudo apt-get install squashfs-tools mtd-utils
# Optional but recommended
pip3 install python-magic scapy
# See firmware-extraction for standalone Binwalk 3.1.0; automated frameworks
# may instead require the legacy Python Binwalk API in a separate environment.
# For Firmadyne/FirmAE
sudo apt-get install postgresql python3-psycopg2
Verify Installation
# Check QEMU versions
qemu-arm --version
qemu-system-arm --version
# Check GDB
gdb-multiarch --version
# List available QEMU machines
qemu-system-arm -M help
qemu-system-mips -M help
Workflow Overview
Follow this systematic approach for firmware emulation:
- Strategy Selection - Automated vs manual (use decision tree)
- Preparation - Extract firmware, identify architecture
- Initial Emulation - Try automated tools first
- Manual Emulation - If automated fails, use QEMU directly
- Debugging - GDB integration for deep analysis
- Network Analysis - Traffic capture and protocol analysis
- Vulnerability Testing - Fuzzing and exploitation
- Documentation - Record findings and techniques
Path 1: Automated Emulation (Quick Start)
Try automated tools for supported Linux firmware; success depends on the corpus, architecture, kernel and hardware assumptions.
Step 1: Prepare Firmware
# Ensure firmware is extracted
# Use firmware-extraction skill if needed
ls -la squashfs-root/
# Note firmware details
file vmlinux # Kernel if present
cat squashfs-root/etc/version # Firmware version
Step 2: Run FirmAE
FirmAE is recommended over Firmadyne (better success rate).
cd /path/to/FirmAE
# Automated analysis
sudo ./run.sh -r "Brand" /path/to/firmware.bin
# Wait for completion (5-15 minutes typically)
# FirmAE will:
# - Extract filesystem
# - Detect architecture
# - Create QEMU image
# - Boot firmware
# - Run network analysis
Step 3: Access Running Firmware
# Check FirmAE output for IP address
# Typical: 192.168.0.1 or 192.168.1.1
# Scan for open services
nmap -p- -A 192.168.0.1
# Access web interface
curl http://192.168.0.1/
# Or open in browser
# Try telnet/SSH
telnet 192.168.0.1
ssh [email protected]
Step 4: Analyze Network Traffic
# Check scratch/<IMAGE_ID>/ for logs; capture explicitly if a pcap is needed.
# Or capture live
sudo tcpdump -i tap1_0 -w analysis.pcap
# Analyze in Wireshark
wireshark analysis.pcap
When Automated Fails
If FirmAE/Firmadyne doesn't boot the firmware:
- Check console output for errors
- Inspect FirmAE's architecture-detection script and its detected architecture;
run.sh -ameans analysis, not architecture selection - Review
/path/to/FirmAE/scratch/<ID>/for logs - Proceed to Path 2 (Manual Emulation)
Reference: See references/automated-emulation.md for complete Firmadyne/FirmAE guide.
Path 2: Manual User-Mode Emulation
Run individual binaries without full system emulation.
Step 1: Setup Chroot Environment
# Mount extracted filesystem
sudo
Установить firmware-emulation в Claude Code и Claude Desktop
Зарегайся, чтобы установить скилл
Создай бесплатный аккаунт, чтобы открыть команду установки и сохранить скилл в библиотеку.
- Открой команду установки в одну строку
- Сохраняй скиллы в синхронизируемую библиотеку
- Уведомления, когда скиллы обновляются
Разрешённые инструменты
Инструменты, которые скиллу разрешено вызывать.
Без ограничений — скилл может использовать любой инструмент.
Вложенные файлы
FAQ
Что делает скилл firmware-emulation?
Comprehensive firmware dynamic analysis and emulation using QEMU (user-mode and system-mode), GDB debugging, network traffic analysis, and automated tools (Firmadyne/FirmAE). Use when the agent needs to run extracted firmware for dynamic analysis. Covers: (1) Deciding between automated vs manual emulation approaches, (2) QEMU user-mode emulation for individual binaries, (3) QEMU system-mode emulation for full firmware stack, (4) Advanced GDB debugging with gdb-multiarch, (5) Network traffic capture and protocol analysis, (6) MITM attacks and traffic manipulation, (7) Automated emulation with Firmadyne/FirmAE, (8) Troubleshooting boot failures and network issues. Requires extracted firmware (use firmware-extraction skill first). Complements firmware-static-analysis skill with runtime behavior observation.
Как установить скилл firmware-emulation?
Скопируй папку скилла в ~/.claude/skills (вкладка Claude Code выше делает это одной командой), либо поставь как плагин.
Скилл firmware-emulation запускает скрипты?
Нет, скилл состоит только из инструкций (SKILL.md), без исполняемых скриптов.
Похожие скиллы
skill-creator
Create new skills, modify and improve existing skills, and measure skill performance. Use when users want to create a skill from scratch, edit, or optimize an…
от Anthropicdiscernment-nudge
After you give a substantive answer or draft that the user may act on — advice or recommendations, drafted artifacts such as goals, plans, pitches, proposals…
от Anthropicdata-consolidate
Joins the plant's scheduled exports and connector data into one working dataset — ERP items (NetSuite or Infor M3), sales orders, production work orders…
от Anthropicinspection-to-capa
Runs the quality chain end to end: writes the nonconformance against the requirement it violates, searches history at the moment of writing to say whether…
от Anthropic