Chuyển đến nội dung
Skillpedia
Bảo mật6.5k · #14098

firmware-acquisition

Skill này làm gì

Hướng dẫn này nói về cách đội bảo mật lấy ảnh firmware từ thiết bị họ được ủy quyền rà soát, bắt đầu từ các phương pháp ít xâm lấn nhất. Dành cho nhóm sản phẩm và bảo mật làm đánh giá ở mức phần cứng.

Khi nào nên dùng

  • ✓Khi một nhóm sản phẩm cần ảnh firmware của chính thiết bị để rà soát bảo mật.
  • ✓Khi một rà soát được ủy quyền cần firmware từ thiết bị mà không phụ thuộc vào nhà cung cấp.
  • ✓Khi một thiết bị có cổng gỡ lỗi có thể để lộ firmware hoặc console của nó.

Liên kết skill

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

Sao chép rồi dán vào AI của bạn (Claude, ChatGPT hoặc Cursor) và nhờ nó làm theo hướng dẫn.

Cách dùng

Cách dễ nhất: sao chép tin nhắn và dán vào AI của bạn. AI sẽ đọc skill và làm theo hướng dẫn.

Tin nhắn có sẵn để dán

Hãy dùng skill này để giúp tôi: https://github.com/BitterSecurity/Decepticon/blob/main/packages/decepticon/decepticon/skills/standard/iot/firmware-acquisition/SKILL.md Đọc tệp SKILL.md tại liên kết đó và làm theo hướng dẫn cho việc của tôi.
Bạn muốn AI tự tìm những skill như thế này?Cài MCP Skillpedia miễn phí: chỉ một dòng, và AI sẽ tìm trong 15.000+ skill trước mỗi việc.Cài đặt trong 1 phút →

Ví dụ cách nhờ AI

“Chúng tôi cần một bản sao firmware của một trong các thiết bị của chính mình cho một đợt rà soát bảo mật. Các cách ít xâm lấn nhất để lấy nó là gì?”

5 skill mới mỗi tuần. Đọc chỉ 1 phút.

Cách hoạt động

Agent bắt đầu bằng tải xuống từ nhà cung cấp và lưu lượng cập nhật, rồi chỉ chuyển sang đọc phần cứng khi cần, và kiểm tra hash của mỗi ảnh trước khi phân tích.

Nội dung kỹ thuật (SKILL.md gốc)

Lấy nguyên văn từ GitHub, do tác giả viết bằng tiếng Anh.

Firmware Acquisition

Acquire a binary image of the target's firmware before any static analysis. Work through the acquisition tiers in order — cheapest and least invasive first. Each tier degrades hardware less and preserves the device's operational state.

Prerequisites

  • Device PCB photographed (top + bottom). Mark: SoC part number, flash chip marking, debug pad pattern (UART = 4-pin row; JTAG = TAP header or test points).
  • Identify flash type from silkscreen or datasheet: SPI NOR (SOIC-8/WSON), SPI NAND, eMMC (BGA-153/169), parallel NOR/NAND.
  • Bench tools staged: CH341A programmer + SOIC-8 clip, BusPirate / J-Link / SEGGER J-Trace, USB-UART adapter (CP2102 / FT232), multimeter for UART baud sniffing.

Tier 0 — Vendor Portal / OTA Proxy (no hardware needed)

0a. Vendor download portal

# Check common firmware CDN patterns
curl -sI "https://firmware.vendor.com/latest/<model>.bin"
curl -sI "https://downloads.vendor.com/firmware/<model>/<version>.tar.gz"

# Scrape firmware release page for direct links
wget -r -l1 -nd -A "*.bin,*.tar.gz,*.zip,*.img" \
    "https://www.vendor.com/support/firmware/<model>"

# Checksum-verify before unpacking
sha256sum <fw.bin>

0b. OTA interception (MITM the device's update check)

# 1. ARP-spoof the device to route its traffic through your machine
sudo arpspoof -i eth0 -t <device_ip> <gateway_ip> &
sudo arpspoof -i eth0 -t <gateway_ip> <device_ip> &

# 2. Forward all traffic except OTA traffic; intercept OTA with mitmproxy
sudo iptables -t nat -A PREROUTING -p tcp --dport 443 -j REDIRECT --to-port 8080
mitmproxy --mode transparent --set ssl_insecure=true -w /tmp/ota_capture.mitm

# 3. Trigger an OTA check from the device (power cycle or companion app)
# 4. Inspect intercepted traffic; export firmware binary
mitmdump -r /tmp/ota_capture.mitm -w /tmp/ota_fw.bin \
    --set flow_detail=3 '~t application/octet-stream or ~t application/x-gzip'

# 5. Decrypt if AES-encrypted OTA (key often in companion app resources)
openssl enc -d -aes-128-cbc -K <hex_key> -iv <hex_iv> -in /tmp/ota_fw.bin -out /tmp/fw_plain.bin

0c. Companion-app embedded firmware

# APK often bundles the firmware binary or partial images
apktool d companion.apk -o companion_decompiled/
find companion_decompiled/ -name "*.bin" -o -name "*.fw" -o -name "*.img" | xargs file
grep -r "firmware\|update\|download\|cdn" companion_decompiled/assets/ --include="*.js"

Tier 1 — UART Console Dump

UART is the fastest hardware path: non-destructive, works while device is powered.

1a. Identify UART pins

Typical 4-pin UART header: VCC | GND | TX | RX
Probe each with multimeter (DC, 3.3 V idle = TX candidate).
Baud detect: minicom -D /dev/ttyUSB0 -b 115200 (try 9600, 57600, 115200, 460800).
# Baud-rate autoprobe with sigrok / baudrate.py
python3 baudrate.py /dev/ttyUSB0    # https://github.com/devttys0/baudrate
# Or with screen – step through common rates
for baud in 9600 19200 38400 57600 115200 230400 460800 921600; do
    echo "Testing $baud..."; screen /dev/ttyUSB0 $baud; done

1b. Interrupt boot and dump from U-Boot

# Connect: GND → GND, RX(USB) → TX(device), TX(USB) → RX(device)
screen /dev/ttyUSB0 115200
# Power on device; press any key within 1-3s to break into U-Boot

# At U-Boot prompt: locate kernel + rootfs partition offsets
=> printenv
=> mtdparts      # shows flash map  (e.g. 0x00000000 kernel 0x200000, rootfs 0x600000)

# Dump via XMODEM to host
=> loady 0x80000000          # load address in RAM
=> md.b 0x80000000 0x200000  # memory-display: prints hex to terminal
# Capture terminal output → convert hex dump → binary:
python3 -c "
import sys, re
data = open('uart_hexdump.txt').read()
chunks = re.findall(r':\s+((?:[0-9a-fA-F]{8} ){1,4})', data)
raw = bytes.fromhex(''.join(''.join(c.split()) for c in chunks))
open('fw_from_uart.bin','wb').write(raw)"

1c. Full flash dump via UART + tftp

# If U-Boot has tftp + nand/sf commands:
=> setenv ipaddr 192.168.1.100
=> setenv serverip 192.168.1.10
=> sf probe; sf read 0x80000000 0x0 0x1000000    # read 16MB SPI NOR into RAM
=> tftp 0x80000000 flash_full.bin                 # upload to your tftp server
# On your host: python3 -m py3tftp -p 69 --ip 0.0.0.0

Tier 2 — JTAG / SWD Debug Interface

2a. OpenOCD + J-Link SWD dump (ARM Cortex-M)

openocd -f interface/jlink.cfg -f target/stm32f4x.cfg \
    -c "init; halt; dump_image
Câu hỏi thường gặp

Cách ít xâm lấn nhất là gì?

Hướng dẫn bắt đầu với tải xuống từ nhà cung cấp, không cần truy cập phần cứng.

Vì sao phải kiểm tra hash?

Hướng dẫn nói nên xác minh checksum trước khi giải nén để ảnh được biết rõ và không bị thay đổi.

Khi nào dùng truy cập phần cứng?

Hướng dẫn dùng đọc phần cứng như bước sau, khi các nguồn khác không đủ.

Chi tiết

Mô tả gốc của tác giả

Systematic firmware extraction from IoT and embedded targets — vendor portals, OTA interception, SPI flash dumping with flashrom/CH341A, eMMC chip-off, and UART/JTAG console dumps. Covers the full acquisition chain from zero hardware access to a raw binary ready for static analysis.

repo: BitterSecurity/Decepticon

Độ phổ biến

Sao GitHub
6.5k
Vị trí xếp hạng
#14098
Giấy phép
Apache-2.0
Cập nhật
1/11/2026

Skill này có hữu ích không?

0

Đăng nhập để bình chọn.

Bình luận

  • …

Thêm skill từ kho mã này

Skill tương tự