FURQANAHMAD34/universal-re-skill
GitHub: FURQANAHMAD34/universal-re-skill
一款 AI 无关的逆向工程与漏洞检测技能插件,支持主流二进制格式的跨平台反编译、漏洞扫描与 PoC exploit 自动生成。
Stars: 1 | Forks: 0
# 通用逆向工程与漏洞检测技能
这是一个面向 AI 编码助手的通用插件/技能,可为**所有主要二进制格式和源语言**增加专家级的逆向工程、漏洞检测以及**可运行的 PoC exploit 生成**能力——自动安装所有必需的工具。
## 功能介绍
| 功能 | 详情 |
|-----------|---------|
| **反编译** | APK/XAPK → jadx/fernflower;.NET EXE/DLL → ilspycmd;ELF → radare2/objdump;IPA → otool/class-dump |
| **漏洞扫描** | 40 多种漏洞类型:缓冲区溢出、SQL 注入、SSL 绕过、反序列化、硬编码密钥、格式化字符串、命令注入 |
| **PoC 生成** | 可运行的 Python/Bash/C exploit 脚本:SSL 绕过 (Frida)、缓冲区溢出 (pwntools)、SQLi、反序列化 (ysoserial) |
| **自动工具安装** | `install-dep.sh` 无需手动设置即可安装 40 多种工具(jadx, checksec, radare2, pwntools, frida, ilspycmd 等) |
| **二进制安全防护检测** | 通过 checksec 检测 Stack canary、NX/DEP、PIE/ASLR、RELRO、FORTIFY、CFG、SafeSEH |
| **机密信息扫描** | 源代码及二进制文件中的 API 密钥、密码、私钥、AWS 凭据 |
## 指令 (Claude Code)
| 指令 | 功能说明 |
|---------|-------------|
| `/analyze ` | 对任何二进制文件/应用/源代码进行自动检测和静态分析 |
| `/decompile ` | 反编译任何目标 → 自动安装工具 → 生成 PoC 脚本 |
| `/vuln_poc ` | 深度扫描 → 查找真实的偏移量和验证缺口 → 生成可运行的 exploit |
| `/vuln-scan ` | 仅进行漏洞扫描(源代码或二进制文件) |
### `/decompile` — 跨平台反编译器 + PoC 生成器
```
/decompile app.apk → jadx decompile + SSL bypass PoC
/decompile malware.exe → ilspycmd .NET decompile + SQLi PoC
/decompile target_binary → r2 disasm + buffer overflow PoC
/decompile app.ipa → class-dump + Frida hook PoC
/decompile app.xapk → XAPK extract → jadx + PoC
```
运行前自动安装所需工具。反编译后,生成可运行的 PoC 脚本:
| 目标 | 生成的 PoC 脚本 |
|--------|----------------------|
| Android APK | `poc-ssl-bypass.py` (Frida 5 层绕过), `poc-sms-intercept.py`, `poc-root-bypass.py`, `poc-webview-xss.html`, `poc-intent-fuzzer.sh` |
| Linux ELF | `poc-bof.py` (pwntools ret2libc/shellcode), `poc-cmd-inject.py`, `poc-fmt-string.py` |
| .NET / Windows | `poc-sqli.py`, `poc-deserialization.py` (ysoserial.net gadget chains) |
### `/vuln_poc` — 深度漏洞扫描 + exploit 生成
不仅限于识别——还能发现实际的偏移量、验证控制绕过以及代码库逻辑缺陷:
```
/vuln_poc app.apk → MCC bypass detection, SSL audit, OTP intercept
/vuln_poc target_elf → BOF offset, ROP gadgets, system() xrefs
/vuln_poc dotnet.dll → SQLi endpoints, unsafe deser, auth gaps
```
## 支持的平台与工具
| 平台 | 反编译引擎 | 漏洞工具 |
|----------|-----------------|---------------------|
| Android APK/XAPK | jadx, fernflower/vineflower | frida, semgrep, gitleaks |
| iOS IPA / Mach-O | class-dump, otool | frida, codesign |
| Windows PE / .NET | ilspycmd, monodis, de4dot | checksec, semgrep |
| Linux ELF | radare2, objdump | checksec, pwntools, ROPgadget |
| macOS Mach-O | otool, nm, lipo | codesign, r2 |
| 源代码 (C/Python/Java/Go/C#) | 直接分析 | semgrep, bandit, flawfinder, gosec |
## 集成工具 (40+)
| 类别 | 工具 |
|----------|-------|
| **Android** | jadx, apktool, dex2jar, vineflower/fernflower, adb |
| **iOS / macOS** | otool, class-dump, codesign, lipo, ipsw, frida |
| **Windows PE** | objdump, checksec, upx, radare2 |
| **Linux ELF** | readelf, objdump, nm, checksec, strace, ltrace, radare2 |
| **.NET** | ilspycmd, dotnet SDK, monodis, de4dot |
| **SAST / 密钥** | semgrep, bandit, cppcheck, flawfinder, gitleaks, trufflehog, gosec |
| **Exploit 开发** | pwntools, ROPgadget, ropper, one\_gadget, angr, patchelf, seccomp-tools |
| **调试** | gdb, pwndbg, GEF, PEDA, lldb, valgrind |
| **高级逆向工程** | Ghidra, Cutter, RetDec, radare2, binwalk, volatility3 |
| **模糊测试 (Fuzzing)** | AFL++ |
| **运行时 Hook** | frida-tools (Android/iOS SSL 绕过、root 绕过、方法 hooks) |
所有工具均通过 `scripts/install-dep.sh ` 自动安装。
## 可检测的漏洞类型
**内存安全 (二进制/C/C++):**
栈缓冲区溢出 · 堆缓冲区溢出 · 释放后重用 · Double free ·
整数溢出/下溢 · 格式化字符串 · 空指针解引用 · Off-by-one
**二进制防护检测:**
无 NX/DEP · 无 PIE/ASLR · 无 Stack canary · 无 RELRO · 无 FORTIFY ·
无 CFG (Windows) · 无 SafeSEH (Windows)
**注入:**
命令注入 · SQL 注入 · LDAP 注入 · XML/XPath 注入 ·
模板注入 · Header 注入
**移动端 (Android/iOS):**
SSL pinning 绕过 · MCC 条件证书验证 · Root 检测绕过 ·
导出组件滥用 · WebView JavaScript bridge · SMS/OTP 拦截 ·
硬编码 API 密钥 · 不安全的 SharedPreferences · 明文传输
**加密:**
硬编码密钥 · 硬编码 IV · MD5/SHA1/DES/RC4 · ECB 模式 · 弱密钥长度 ·
可预测的随机数 · 接受自签名证书
**机密信息:**
密码 · API 密钥 · Auth token · 私钥 · AWS 凭据 ·
数据库连接字符串 · HTTP 明文
**反序列化:**
Python pickle/yaml · Java ObjectInputStream · .NET BinaryFormatter ·
PHP unserialize · JSON TypeNameHandling (All/Objects)
**Web/API:**
XXE · SSRF · 开放重定向 · 不安全的 CORS · 缺失 CSRF · SQL 注入
## 安装说明
### Claude Code
原生插件格式——为您提供 `/analyze`、`/decompile`、`/vuln_poc`、`/vuln-scan` 斜杠指令。
#### 选项 A — 从此仓库本地安装
```
# 1. Clone the repo
git clone https://github.com/FURQANAHMAD34/universal-re-skill.git
cd universal-re-skill
# 2. 将 plugin 安装到 Claude Code
claude plugin install ./plugins/universal-reverse-engineering
# 3. Verify
claude plugin list
# 应显示:universal-reverse-engineering v2.0.0
# 4. 使用它
claude
# /decompile app.apk
# /vuln_poc target_binary
# /analyze malware.exe
```
#### 选项 B — 从 GitHub 安装
```
claude plugin install https://github.com/FURQANAHMAD34/universal-re-skill
```
#### 选项 C — 手动安装 (无 CLI)
```
mkdir -p ~/.claude/plugins/
cp -r plugins/universal-reverse-engineering ~/.claude/plugins/
# 重启 Claude Code
```
#### 指令参考
```
# Decompile + 自动 PoC 生成
/decompile app.apk
/decompile malware.exe --engine ilspy
/decompile target_bin --platform linux
# 带有可运行 exploit 脚本的深度 vuln 扫描
/vuln_poc app.apk
/vuln_poc target.elf
/vuln_poc ./src/
# 完整 static analysis(所有平台)
/analyze app.apk
/analyze target.exe --deep
/analyze ./src --vuln
# 仅 Vulnerability 扫描
/vuln-scan ./src
/vuln-scan malware.elf
```
### Cursor
Cursor 会从项目根目录读取 `.cursorrules`,或从全局读取 `~/.cursorrules`。
```
# Per-project
cp ai-integrations/cursor/.cursorrules /path/to/your/project/.cursorrules
# Global(所有项目)
cp ai-integrations/cursor/.cursorrules ~/.cursorrules
```
然后在 Cursor 中自然提问:
```
Decompile this APK and generate an SSL bypass script
Find all buffer overflows in src/ and write a pwntools exploit
Check if this binary has NX and stack canary enabled
```
### Windsurf
```
cp ai-integrations/windsurf/.windsurfrules /path/to/your/project/.windsurfrules
```
### GitHub Copilot
```
mkdir -p .github
cp ai-integrations/github-copilot/.github/copilot-instructions.md .github/copilot-instructions.md
```
在 Copilot Chat 中提问:
```
@workspace decompile target.elf and find exploitable vulnerabilities
@workspace generate a Frida SSL bypass for this APK
@workspace find SQL injection in src/ and write a PoC
```
### Aider
```
# Per-project
cp ai-integrations/aider/.aider.conf.yml /path/to/your/project/.aider.conf.yml
# One-shot 分析
aider --message "Decompile app.apk and generate PoC scripts for all vulnerabilities" app.apk
```
### Continue.dev
```
cp ai-integrations/continue-dev/config.json ~/.continue/config.json
```
Continue.dev 中可用的指令:`/analyze`, `/vuln`
### OpenAI Codex CLI
```
codex --system-prompt "$(cat ai-integrations/codex-cli/system-prompt.md)" \
"Decompile target.exe and find exploitable vulnerabilities"
```
### 任何 LLM / API
```
# Anthropic Claude API
import anthropic
client = anthropic.Anthropic()
with open("ai-integrations/generic/system-prompt.md") as f:
system_prompt = f.read()
response = client.messages.create(
model="claude-sonnet-4-6",
max_tokens=8192,
system=system_prompt,
messages=[{"role": "user", "content": "Decompile app.apk and generate an SSL bypass PoC"}]
)
print(response.content[0].text)
```
## 快速安装工具
```
SCRIPTS=plugins/universal-reverse-engineering/skills/universal-reverse-engineering/scripts
# Check 所有内容
bash $SCRIPTS/check-deps.sh all
# Android + SSL bypass
bash $SCRIPTS/install-dep.sh java
bash $SCRIPTS/install-dep.sh jadx
bash $SCRIPTS/install-dep.sh apktool
pip install frida-tools
# Binary analysis + exploit 开发
bash $SCRIPTS/install-dep.sh checksec
bash $SCRIPTS/install-dep.sh radare2
bash $SCRIPTS/install-dep.sh pwntools
bash $SCRIPTS/install-dep.sh ropgadget
bash $SCRIPTS/install-dep.sh gdb
bash $SCRIPTS/install-dep.sh pwndbg
# .NET decompile
bash $SCRIPTS/install-dep.sh ilspycmd
bash $SCRIPTS/install-dep.sh monodis
# SAST / secret scanning
bash $SCRIPTS/install-dep.sh semgrep
bash $SCRIPTS/install-dep.sh bandit
bash $SCRIPTS/install-dep.sh gitleaks
# Advanced RE
bash $SCRIPTS/install-dep.sh ghidra
bash $SCRIPTS/install-dep.sh cutter
bash $SCRIPTS/install-dep.sh angr
```
## 独立脚本使用 (无需 AI)
脚本可独立运行,无需任何 AI 模型:
```
PLUGIN_ROOT=plugins/universal-reverse-engineering
# Decompile + 生成 PoC 脚本
bash $PLUGIN_ROOT/skills/universal-reverse-engineering/scripts/decompile.sh app.apk --poc
bash $PLUGIN_ROOT/skills/universal-reverse-engineering/scripts/decompile.sh target.elf --poc
bash $PLUGIN_ROOT/skills/universal-reverse-engineering/scripts/decompile.sh malware.exe --platform dotnet --poc
# 深度 vuln 扫描 + PoC 生成
bash $PLUGIN_ROOT/skills/universal-reverse-engineering/scripts/vuln-poc.sh app.apk --platform android
bash $PLUGIN_ROOT/skills/universal-reverse-engineering/scripts/vuln-poc.sh target.elf --platform linux
# 自动分析任何 target
bash $PLUGIN_ROOT/skills/universal-reverse-engineering/scripts/analyze.sh auto target.apk
bash $PLUGIN_ROOT/skills/universal-reverse-engineering/scripts/analyze.sh linux ./binary -o report/
# Vulnerability 扫描
bash $PLUGIN_ROOT/skills/vulnerability-scanner/scripts/vuln-scan.sh ./src -o vulns/
# Binary hardening 检查
bash $PLUGIN_ROOT/skills/vulnerability-scanner/scripts/check-binary-security.sh ./binary
```
## 文件结构
```
universal-re-skill/
├── .claude-plugin/marketplace.json
├── README.md
├── plugins/
│ └── universal-reverse-engineering/
│ ├── .claude-plugin/plugin.json ← v2.0.0
│ ├── commands/
│ │ ├── analyze.md ← /analyze
│ │ ├── decompile.md ← /decompile ★ NEW
│ │ ├── vuln_poc.md ← /vuln_poc ★ NEW
│ │ └── vuln-scan.md ← /vuln-scan
│ └── skills/
│ ├── universal-reverse-engineering/
│ │ ├── SKILL.md
│ │ ├── references/
│ │ │ ├── setup-guide.md
│ │ │ ├── android.md
│ │ │ ├── ios.md
│ │ │ ├── windows-pe.md
│ │ │ ├── linux-elf.md
│ │ │ ├── macos-macho.md
│ │ │ ├── dotnet.md
│ │ │ └── debugging-exploit-dev.md
│ │ └── scripts/
│ │ ├── detect-target.sh ← auto-detect file type
│ │ ├── check-deps.sh ← dependency checker
│ │ ├── install-dep.sh ← auto-installer (40+ tools)
│ │ ├── analyze.sh ← static analysis dispatcher
│ │ ├── decompile.sh ← cross-platform decompiler ★ NEW
│ │ └── vuln-poc.sh ← PoC exploit generator ★ NEW
│ └── vulnerability-scanner/
│ ├── SKILL.md
│ └── scripts/
│ ├── vuln-scan.sh
│ ├── scan-source.sh
│ └── check-binary-security.sh
└── ai-integrations/
├── cursor/.cursorrules
├── windsurf/.windsurfrules
├── github-copilot/.github/copilot-instructions.md
├── aider/.aider.conf.yml
├── continue-dev/config.json
├── codex-cli/system-prompt.md
├── amazon-q/INSTALL.md
└── generic/system-prompt.md
```
## PoC 生成 — 输出内容
### Android SSL 绕过 (示例 — Real Caller)
执行 `/decompile real-caller.apk` 和 `/vuln_poc real-caller.apk` 将生成一个可直接运行的 Frida 脚本,涵盖:
- **第 1 层** — MCC 欺骗:强制设定 `mainmcc = 424` (阿联酋),从而在 `returnAppSecureCntxUrlBks*` 中禁用 pinning
- **第 2 层** — SSLContext 注入:将实施了证书 pinning 的 `sslContext` 替换为宽松的 TrustManager,击败 `returnAppSecureCntxUrlBksForcePan`
- **第 3 层** — `setSSLSocketFactory` hook:在连接层面中和剩余的任何已 pinning 的 factory
- **第 4 层** — OkHttp3、WebView、Network Security Config 绕过
```
# 运行生成的 bypass:
frida -U -f menwho.phone.callerid.social -l poc-ssl-bypass-real-caller.py --no-pause
# 在设备上设置 Burp proxy:
adb shell settings put global http_proxy 192.168.1.x:8080
```
### Linux ELF 缓冲区溢出 (示例)
执行 `/vuln_poc target_elf` 将生成包含以下内容的 pwntools 脚本:
- 正确的架构检测 (x86/x86-64/ARM)
- 自动读取 `checksec` 安全缓解机制
- ret2libc 路径 (启用 NX) 或 shellcode 路径 (禁用 NX)
- 带有用于查找精确偏移量的 gdb/pwndbg 命令的占位符
- ROP gadget 搜索命令
```
python3 poc-bof.py LOCAL
python3 poc-bof.py REMOTE 10.10.10.1 4444
```
### .NET 反序列化 (示例)
执行 `/vuln_poc malware.dll` 将生成一个 ysoserial.net 包装器,它会:
- 尝试所有的 gadget chains (TypeConfuseDelegate、ObjectDataProvider 等)
- 针对所有检测到的格式化程序 (BinaryFormatter、NetDataContractSerializer)
- 将 payload 发送到发现的 API endpoint
## 贡献者
| GitHub | 网站 |
|--------|---------|
| [@FURQANAHMAD34](https://github.com/FURQANAHMAD34) | [devyforge.com](https://devyforge.com) |
| [@SimoneAvogadro](https://github.com/SimoneAvogadro) | [android-reverse-engineering-skill](https://github.com/SimoneAvogadro/android-reverse-engineering-skill) |
## 许可协议
Apache 2.0 — 详见 LICENSE 文件。
由 devyforge.com 构建
标签:AI插件, PoC生成, StruQ, 二进制分析, 云安全运维, 云资产清单, 多平台, 应用安全, 正则匹配, 逆向工具, 逆向工程