मुख्य सामग्री पर जाएँ
Skillpedia
सिक्योरिटी6.5k · #14094

binwalk-extract

यह क्या करती है

यह गाइड फ़र्मवेयर इमेज को उनके फ़ाइल सिस्टम में खोलने का तरीका बताती है, ताकि उनकी समीक्षा हो सके। यह उन सुरक्षा विश्लेषकों के लिए है जो अधिकृत फ़र्मवेयर पर काम करते हैं।

कब इस्तेमाल करें

  • ✓जब आपके पास कच्चा फ़र्मवेयर इमेज हो और समीक्षा के लिए उसका फ़ाइल सिस्टम निकालना हो।
  • ✓जब फ़र्मवेयर इमेज में कंप्रेस्ड या एन्क्रिप्टेड हिस्से लगें और आपको उन्हें अलग पहचानना हो।
  • ✓जब फ़र्मवेयर इमेज का फ़ाइल सिस्टम फ़ॉर्मेट मानक न हो और खास टूल चाहिए।

Skill का लिंक

https://github.com/BitterSecurity/Decepticon/blob/main/packages/decepticon/decepticon/skills/standard/iot/binwalk-extract/SKILL.md

इसे कॉपी करके अपने AI (Claude, ChatGPT या Cursor) में पेस्ट करें और निर्देशों का पालन करने को कहें।

कैसे इस्तेमाल करें

सबसे आसान तरीका: मैसेज कॉपी करके अपने AI में पेस्ट करें। वह skill पढ़कर निर्देशों का पालन करेगा।

पेस्ट करने के लिए तैयार मैसेज

इस skill से मेरी मदद करो: https://github.com/BitterSecurity/Decepticon/blob/main/packages/decepticon/decepticon/skills/standard/iot/binwalk-extract/SKILL.md इस लिंक की SKILL.md फ़ाइल पढ़ो और मेरे काम में उसके निर्देशों का पालन करो।
क्या आप चाहते हैं कि आपका AI ऐसी skills खुद ढूँढे?मुफ़्त Skillpedia MCP इंस्टॉल करें: बस एक लाइन, और हर काम से पहले यह 15,000+ skills में खोजता है।1 मिनट में इंस्टॉल करें →

AI से क्या माँगें: उदाहरण

“मेरे पास हमारे एक डिवाइस का फ़र्मवेयर इमेज है। क्या आप इसे खोलकर बता सकते हैं कि फ़ाइल सिस्टम में क्या है?”

हर हफ़्ते 5 नई skills, 1 मिनट में पढ़ें।

यह कैसे काम करती है

एजेंट इमेज में ज्ञात फ़ाइल सिग्नेचर खोजता है, एंट्रॉपी मापकर कंप्रेस्ड या एन्क्रिप्टेड हिस्से पहचानता है, और पढ़ने योग्य फ़ाइल सिस्टम निकालता है।

तकनीकी सामग्री (मूल SKILL.md)

लेखक का मूल टेक्स्ट, अंग्रेज़ी में, सीधे GitHub से।

Firmware Extraction with binwalk

Turn a raw binary image into a navigable filesystem tree. binwalk handles most common containers; firmware-mod-kit covers special-case squashfs variants; manual mounting handles the rest.

Prerequisites

  • Raw firmware binary (from firmware-acquisition skill).
  • Tools: binwalk (≥ 2.3), sasquatch (non-standard squashfs decompressor), jefferson (JFFS2 extractor), ubireader (UBI/UBIFS), mtd-utils, firmware-mod-kit (FMK), 7-zip, lzma, xz-utils.
# Kali / Debian install
sudo apt-get install -y binwalk firmware-mod-kit mtd-utils
pip3 install jefferson ubireader

# sasquatch (handles non-standard squashfs compression: LZMA, XZ, ZLIB with vendor patches)
git clone https://github.com/devttys0/sasquatch && cd sasquatch
./build.sh && sudo cp sasquatch /usr/local/bin/

Step 1 — Identify + Entropy Survey

FW=/workspace/evidence/iot/<target>/firmware/flash_full.bin

# Quick filetype + offset scan
binwalk "$FW"

# Entropy analysis: flat line near 1.0 = encrypted/compressed; structured = filesystem
binwalk -E "$FW"
# Output plot to PNG for report
binwalk -E --save "$FW"     # saves <fw>.png beside the binary

# High entropy region with no signature = encrypted blob — note offset + size
# Low-to-medium entropy with known FS signature = squashfs/jffs2/cramfs — extract

Reading the entropy graph

Entropy range Interpretation
0.0–0.3 Mostly zero-fill / padding — skip
0.5–0.8 Structured data (FS headers, ELF) — extract
0.8–0.95 Compressed data (gzip, lzma, zlib) — normal
0.95–1.0 flat AES/RSA encrypted or already-compressed blob — flag for key hunt

Step 2 — Recursive Extraction

OUTDIR=/workspace/evidence/iot/<target>/extracted

# Recursive extraction (-M), follow symlinks (-r), output to dedicated dir (-C)
binwalk -eM -C "$OUTDIR" "$FW"

# Inspect what was carved
find "$OUTDIR" -maxdepth 4 -type f | head -60
ls -lah "$OUTDIR"/_*

Common extraction outputs

_flash_full.bin.extracted/
  squashfs-root/          ← mounted squashfs rootfs
  40          ← raw uImage kernel (strip 64-byte header for vmlinuz)
  40.7z       ← carved archive at offset 0x40
  A00000      ← raw block at offset 0xA00000

Step 3 — Squashfs (standard + vendor variants)

SQFS=$(find "$OUTDIR" -name "*.squashfs" -o -name "squashfs-root.img" 2>/dev/null | head -1)

# Standard unsquashfs
unsquashfs -d /tmp/squashfs_root "$SQFS"

# Non-standard (Broadcom LZMA, TP-Link XZ, vendor-patched):
sasquatch -d /tmp/squashfs_root "$SQFS"

# If both fail, force a specific compression type:
sasquatch -p 1 -le -d /tmp/squashfs_root "$SQFS"   # little-endian
sasquatch -p 1 -be -d /tmp/squashfs_root "$SQFS"   # big-endian

# Verify extraction
ls /tmp/squashfs_root/{bin,etc,lib,usr,var} 2>/dev/null

Step 4 — JFFS2

JFFS2_IMG=$(find "$OUTDIR" -name "*.jffs2" 2>/dev/null | head -1)

# Method A: jefferson (Python, handles most variants)
jefferson "$JFFS2_IMG" -d /tmp/jffs2_root

# Method B: kernel loop mount (requires modprobe jffs2 + mtdram)
sudo modprobe mtdram total_size=65536 erase_size=256
sudo modprobe mtdblock
sudo dd if="$JFFS2_IMG" of=/dev/mtd0
sudo mount -t jffs2 /dev/mtdblock0 /mnt/jffs2

Step 5 — UBIFS (NAND-based devices)

UBI_IMG=$(find "$OUTDIR" -name "*.ubi" -o -name "*.ubifs" 2>/dev/null | head -1)

# ubireader_extract_files: most direct path
ubireader_extract_files -o /tmp/ubifs_root "$UBI_IMG"

# For raw UBI volume images, ubiextract:
sudo modprobe ubi
sudo ubiattach -m 0 -d 0 /dev/ubi_ctrl
sudo mount -t ubifs /dev/ubi0_0 /mnt/ubifs

Step 6 — Manual Carving (when binwalk misses)

# Find filesystem magic bytes manually
python3 -c "
import sys
data = open('$FW','rb').read()
sigs = {b'hsqs': 'SquashFS LE', b'sqsh': 'SquashFS BE',
        b'\\x19\\x85': 'JFFS2', b'UBI#': 'UBI', b'\\x27\\x05\\x19\\x56': 'uImage'}
for sig, name in sigs.items():
    off = 0
    while True:
        idx = data.find(sig, off)
        if idx == -1: break
        print(f'  {name} @ 0x{idx:08x}')
        off = idx + 1"

# Carve a specific region for separate analysis
dd if="$FW" bs=1 skip=$((0xA00000)) count=$((0x600000)) of=/tmp/carved_rootfs.bin

# Run binwalk on the carved piece
binwalk -eM -C /tmp/carved_extract /tmp/carved_rootfs.bin

Step 7 — Nested Archive Handling

# Device firmware often wraps: .zip/.tar → signed header → lz
अक्सर पूछे जाने वाले सवाल

एंट्रॉपी विश्लेषण क्या है?

यह मापता है कि डेटा कितना अनियमित है, जिससे संरचित फ़ाइल सिस्टम और एन्क्रिप्टेड ब्लॉब में अंतर पता चलता है।

निकालने का काम कौन सा टूल करता है?

गाइड binwalk का उपयोग करती है, और खास फ़ाइल सिस्टम फ़ॉर्मेट के लिए दूसरे टूल भी।

निकालने के बाद क्या करना है?

गाइड निकाली गई फ़ाइलों की स्टैटिक समीक्षा की ओर इशारा करती है, जैसे हार्डकोडेड क्रेडेंशियल की जाँच।

जानकारी

लेखक का मूल विवरण

Firmware image extraction with binwalk and firmware-mod-kit — recursive archive carving, squashfs/jffs2/ubifs mounting, entropy analysis to detect packed/encrypted regions, and nested container handling. Entry point for all static filesystem analysis after a raw binary image is acquired.

repo: BitterSecurity/Decepticon

लोकप्रियता

GitHub स्टार
6.5k
रैंकिंग में स्थान
#14094
लाइसेंस
Apache-2.0
अपडेट की गई
1/11/2026

क्या यह skill काम की है?

0

लॉग इन करें वोट करने के लिए।

कमेंट

  • …

इस repository की और skills

detector-overview

6.5k

यह आपके एजेंट को स्कैनर से चिह्नित कोड पढ़ने और तय करने में मदद करती है कि कौन सी जगहें असली सुरक्षा बग हैं और कौन सी गलत चेतावनी।

कोडिंगसिक्योरिटी

exploiter-overview

6.5k

यह आपके एजेंट को कई पक्की सुरक्षा कमज़ोरियों को एक परीक्षण श्रृंखला में जोड़ने और जाँचने में मदद करती है कि वह श्रृंखला कितनी दूर तक पहुँच सकती है।

कोडिंगसिक्योरिटी

llm-redteam-overview

6.5k

यह आपके एजेंट को परीक्षण के लिए सही AI रेड-टीम गाइड खोजने में मदद करती है, प्रॉम्प्ट इंजेक्शन से लेकर मॉडल के दुरुपयोग तक 15 रणनीति समूहों में।

कोडिंगसिक्योरिटी

aatmf-t01-prompt-injection

6.5k

समझाती है कि प्रॉम्प्ट इंजेक्शन क्या है, जिसमें छिपे निर्देश AI सिस्टम के नियम बदलने की कोशिश करते हैं, ताकि सुरक्षा परीक्षक उसकी जाँच कर सकें।

कोडिंगसिक्योरिटी

मिलती-जुलती skills