performing-firmware-extraction-with-binwalk
하는 일
이 도구는 전자기기의 내부 소프트웨어인 펌웨어를 분석합니다. 그 안에 숨겨진 파일을 추출하고 살펴보며, 비밀번호, 설정, 시스템 부분 같은 중요한 정보를 찾습니다.
사용하는 경우
- ✓인터넷에서 내려받은 라우터나 카메라의 펌웨어를 조사할 때.
- ✓기기 소프트웨어 안에 숨겨진 비밀번호나 보안 키를 찾고 싶을 때.
- ✓기기 소프트웨어가 어떻게 동작하는지 이해하거나 취약점을 찾기 위해 분석하는 경우.
스킬 링크
https://github.com/mukul975/Anthropic-Cybersecurity-Skills/blob/main/skills/performing-firmware-extraction-with-binwalk/SKILL.md복사해서 AI(Claude, ChatGPT, Cursor)에 붙여넣고 지침을 따르도록 요청하세요.
사용 방법
가장 쉬운 방법입니다. 메시지를 복사해 AI에 붙여넣으세요. AI가 스킬을 읽고 지침을 따릅니다.
바로 붙여넣을 수 있는 메시지
Claude Code, Codex, Cursor용입니다. 프로젝트 폴더에서 실행하면 스킬이 설치됩니다.
SKILL.md를 다운로드해 에이전트의 스킬 폴더에 넣으세요.
AI에게 요청하는 예시
“이 기기의 펌웨어를 분석해서 비밀번호나 접근 키가 있는지 찾아 주세요.”
매주 새 스킬 5개. 읽는 데 1분.
작동 방식
도구는 ‘binwalk’라는 프로그램으로 펌웨어를 스캔합니다. 파일 시스템이나 압축된 데이터처럼 내부에 숨겨진 여러 종류의 파일을 찾아내 추출하므로 직접 살펴볼 수 있습니다.
기술 내용 (원본 SKILL.md)
작성자의 영어 원문을 GitHub에서 그대로 가져왔습니다.
Performing Firmware Extraction with Binwalk
When to Use
- 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.
Prerequisites
- binwalk v3.x installed (
pip install binwalk3or 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
stringsutility (GNU binutils) for string extraction- Optional: firmware-mod-kit for repacking modified firmware images
Workflow
Step 1: Initial Firmware Reconnaissance
Perform a signature scan to identify embedded file types and their offsets:
# Basic signature scan - identify all recognized file types
binwalk firmware.bin
# Scan with verbose output showing confidence levels
binwalk -v firmware.bin
# Scan for specific file types only
binwalk -y "squashfs" firmware.bin
binwalk -y "gzip\|lzma\|xz" firmware.bin
# Opcode scan to identify CPU architecture
binwalk -A firmware.bin
# Scan for raw strings to find version info, URLs, credentials
binwalk -R "password" firmware.bin
binwalk -R "http://" firmware.bin
Step 2: Entropy Analysis
Analyze entropy to identify encrypted, compressed, and plaintext regions:
# Generate entropy plot
binwalk -E firmware.bin
# Entropy with specific block size for higher resolution
binwalk -E -K 256 firmware.bin
# Combined entropy and signature scan
binwalk -BE firmware.bin
Interpreting entropy values:
- 0.0 - 1.0: Empty or padding regions (null bytes, 0xFF fill)
- 1.0 - 5.0: Plaintext data, code, ASCII strings, configuration
- 5.0 - 7.0: Compressed data (gzip, LZMA, zlib)
- 7.0 - 7.99: Strongly compressed or encrypted data
- ~8.0: Maximum entropy, likely encrypted or random data
Step 3: Extract Embedded Files
Extract all identified components from the firmware image:
# Automatic extraction of known file types
binwalk -e firmware.bin
# Recursive extraction (matryoshka mode) for nested archives
binwalk -Me firmware.bin
# Recursive extraction with depth limit
binwalk -Me -d 5 firmware.bin
# Extract specific file type with custom handler
binwalk -D "squashfs filesystem:squashfs:unsquashfs %e" firmware.bin
# Manual extraction of data at a known offset
dd if=firmware.bin of=extracted.squashfs bs=1 skip=327680 count=4194304
Step 4: Mount and Inspect Extracted Filesystems
Mount extracted filesystems for deep inspection:
# Mount SquashFS filesystem
mkdir /tmp/squashfs_root
unsquashfs -d /tmp/squashfs_root extracted.squashfs
# Mount CramFS filesystem
mkdir /tmp/cramfs_root
mount -t cramfs -o loop extracted.cramfs /tmp/cramfs_root
# Extract JFFS2 filesystem
jefferson extracted.jffs2 -d /tmp/jffs2_root
# Inspect the extracted filesystem
ls -la /tmp/squashfs_root/
find /tmp/squashfs_root -name "*.conf" -o -name "*.cfg" -o -name "*.key"
find /tmp/squashfs_root -name "passwd" -o -name "shadow"
Step 5: String Analysis and Credential Discovery
Search extracted filesystem and raw firmware for sensitive data:
# Extract all printable strings
strings -a firmware.bin > all_strings.txt
strings -n 12 firmware.bin | sort -u > long_strings.txt
# Search for credentials and secrets
grep -rni "password\|passwd\|secret\|api_key\|token" /tmp/squashfs_root/etc/
grep -rni "BEGIN.*PRIVATE KEY" /tmp/squashfs_root/
# Find hardcoded URLs and endpoints
grep -rnoE "https?://[a-zA-Z0-9./?=_-]+" /tmp/squashfs_root/
# Search for certificate files
find /tmp/squashfs_root -name "*.pem" -o -name "*.crt" -o -name "*.key" -o -name "*.p12"
# Identify busybox and service versions
strings /tmp/squashfs_root/bin/busybox | grep "BusyBox v"
…
자주 묻는 질문
펌웨어란 무엇인가요?
라우터, TV, 카메라 같은 전자기기에 미리 설치되어 있는 소프트웨어입니다. 기기의 기본 기능을 제어합니다.
엔트로피 분석이란 무엇인가요?
펌웨어 안의 데이터가 얼마나 ‘무작위’이거나 ‘예측할 수 없는’지 측정하는 방법입니다. 무작위성이 높다는 것은 보통 암호화되었거나 압축되었다는 뜻입니다.
SquashFS 같은 파일 시스템은 무엇인가요?
펌웨어에서 파일을 정리하고 압축하는 방식으로, 작은 기기에서 흔히 쓰입니다. 이 도구는 이런 파일 시스템을 열고 내용을 추출하는 방법을 알고 있습니다.
상세 정보
작성자의 원본 설명
Performs 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. Activate
인기도
- GitHub 스타
- 35k
- 순위
- #8231
- 라이선스
- Apache-2.0
- 업데이트
- 2026. 8. 31.
댓글
- …
이 저장소의 다른 스킬
abusing-dpapi-for-credential-access
35kAI 에이전트에게 특정 작업을 위한 준비된 지침을 제공해, 더 잘하고 더 빠르게 처리하도록 합니다.
abusing-shadow-credentials-for-privesc
35kAI 에이전트가 명확하고 잘 구성된 텍스트를 쓰도록 가르칩니다.
achieving-cmmc-level-2-compliance
35kCMMC Level 2 규정 준수를 위한 환경을 준비하도록 돕습니다. 보안 요구 사항을 구현하고 필요한 문서를 관리합니다.
acquiring-disk-image-with-dd-and-dcfldd
35k에이전트가 하드 드라이브의 정확한 복사본을 만들도록 돕습니다. 조사 중 정보가 손실되거나 변경되지 않도록 하는 데 유용합니다.
비슷한 스킬
test-driven-development
311k에이전트가 기능이나 수정을 만들기 전에 실패하는 테스트를 먼저 쓰고, 그것을 통과시키는 가장 작은 코드를 작성하도록 가르칩니다.
verification-before-completion
311k에이전트가 작업, 수정, 빌드가 완료되었거나 통과했다고 말하기 전에 실제 점검을 실행하고 결과를 읽도록 가르칩니다.
migrate-to-shoehorn
310k테스트 파일의 위험한 타입 캐스팅을 shoehorn 라이브러리로 바꿔, 테스트가 일부 데이터만 써도 타입 검사를 통과하도록 돕습니다.