reverse-skill-router
Use the reverse-skill repository from Codex for authorized reverse engineering, security…
.NET / C# 二进制逆向。当目标是 .NET assembly(PE 头含 CLR、.exe/.dll 托管程序)、C# 编译产物(含 NativeAOT)、红队 Sharp* 工具(Rubeus / SharpHound / SharpHound 等)、.NET 混淆程序(ConfuserEx / SmartAssembly / Babel / Eazfuscator)、.NET loader / info-stealer / 套壳 malware 时使用。优先用 dnSpyEx + de4dot,需要 AI 直接操作时联动 dnSpy
$ npx -y skills add zhaoxuya520/reverse-skill --skill dotnet-reverse --agent claude-codeHow it fires
How this skill gets triggered: by you, by Claude, or both.
/dotnet-reverseContext preview
The summary Claude sees to decide when to auto-load this skill.
.NET / C# 二进制逆向。当目标是 .NET assembly(PE 头含 CLR、.exe/.dll 托管程序)、C# 编译产物(含 NativeAOT)、红队 Sharp* 工具(Rubeus / SharpHound / SharpHound 等)、.NET 混淆程序(ConfuserEx / SmartAssembly / Babel / Eazfuscator)、.NET loader / info-stealer / 套壳 malware 时使用。优先用 dnSpyEx + de4dot,需要 AI 直接操作时联动 dnSpy
name: dotnet-reverse description: .NET / C# 二进制逆向。当目标是 .NET assembly(PE 头含 CLR、.exe/.dll 托管程序)、C# 编译产物(含 NativeAOT)、红队 Sharp* 工具(Rubeus / SharpHound / SharpHound 等)、.NET 混淆程序(ConfuserEx / SmartAssembly / Babel / Eazfuscator)、.NET loader / info-stealer / 套壳 malware 时使用。优先用 dnSpyEx + de4dot,需要 AI 直接操作时联动 dnSpy MCP。不用于纯 native 二进制(走 reverse-engineering / ida-reverse)。 license: MIT compatibility: Requires a filesystem-based code agent or CLI with shell access, Windows host preferred (dnSpyEx 是 Windows GUI);Linux/macOS 可用 ILSpy/de4dot CLI + mono/dotnet runtime。 allowed-tools: Bash Read Write Edit Glob Grep Task WebFetch WebSearch metadata: user-invocable: "false"
1. `NOW`: 用 DIE/`file`/CLR 头确认目标是 .NET 托管(否则 SWITCH 到 `ida-reverse/` / `reverse-engineering/`) 2. `NOW`: 若疑似混淆 → 先 `de4dot` 脱壳,产出 `*-clean.exe`,保留原始样本 3. `NEXT`: dnSpyEx(或 dnSpy MCP / `ilspycmd`)静态:C# 浏览 + **IL 视图**看关键判断 4. `ACT`: 需要明文/C2 时动态调试;需要改逻辑时 **IL patch** 优先于 C# 重编译 5. 阶段结束给用户 3–6 项下一步菜单(含导出报告)
当任务属于以下场景时优先使用本 skill:
如果目标是纯 native 二进制(C/C++/Go/Rust 编译、无 CLR),请改用 `reverse-engineering/`、`ida-reverse/` 或 `radare2/`。
| 能力 | 首选 | 备注 | |------|------|------| | 反编译 + 调试 + patch | **dnSpyEx** | 王牌,唯一带 IL 编辑器的 GUI;老 dnSpy 已停更,用 Ex 分支 | | 轻量 CLI / headless 反编译 | **ILSpy** (`ilspycmd`) | 适合批量、脚本化、Linux/macOS | | 脱混淆 | **de4dot** | ConfuserEx 全家桶、SmartAssembly 等主流壳的默认解 | | 混淆器识别 | **Detect It Easy (DIE)** / **file** | 先判断壳类型再决定 de4dot 参数 | | 编程化操作 IL | **dnlib** | 写 C# 脚本批量改 metadata / 字符串解密器 | | AI 直接操作 | **dnSpy MCP** | `dnspy_decompile` / `dnspy_inspect_il` 等工具面 |
> 前置:Windows 主机装 dnSpyEx + de4dot(choco 或 release);Linux/macOS 用 `ilspycmd` + `dotnet runtime`。详见 `references/sharp-tools.md` 的安装矩阵。
确认目标是托管程序,别把 native PE 当 .NET 分析:
# Windows
file target.exe # "PE32 executable ... for MS Windows" 不够
# 关键:看有没有 CLR
powershell -c "[System.Reflection.AssemblyName]::GetAssemblyName('target.exe')"
# 或
dnSpyEx 直接拖进去 —— 能打开就是托管
# 通用
strings target.exe | grep -iE "mscoree|_CorExeMain|mscorlib|System\\."**.NET 识别标志:**
**NativeAOT 例外:** 编译成 native,没有 CLR 头,但有 `System.Private.CoreLib` 字符串和重构过的类型元数据 —— 这类走 `reverse-engineering/`(IDA/r2),本 skill 仅做识别提示。
# DIE 快速识别 diec target.exe # Detect It Easy CLI # 或拖进 dnSpyEx,看是否大量乱码类名 / 控制流变形
常见混淆器 → 脱壳策略(详见 `references/obfuscators.md`):
| 混淆器 | 特征 | de4dot 处理 | |--------|------|------------| | ConfuserEx (1.0.0 / 2.x) | `<module>` anti-tamper、控制流变形、字符串加密 | `de4dot target.exe` 通常自动识别 | | SmartAssembly | `circular`/`string encoding`、资源压缩 | `de4dot target.exe` | | Babel.NET | 方法体加密、控制流 | `de4dot target.exe` | | Eazfuscator.NET | 字符串/资源加密 | `de4dot`,部分版本需手动 | | .NET Reactor | anti-tamper + necrobit | `de4dot`,新版可能失败需手动 |
# de4dot 默认自动识别大多数壳 de4dot target.exe -o target-clean.exe # 指定类型(自动识别失败时) de4dot --type cfze target.exe # ConfuserEx de4dot --type sa target.exe # SmartAssembly # 多层混淆 / de4dot 报 unknown de4dot --detect target.exe # 看它识别成什么 # 可能要先 patch anti-tamper 再 de4dot(见 references/obfuscators.md)
产出:`target-clean.exe`,后续分析用它。**保留原始样本**做对照。
dnSpyEx 加载脱壳后样本:
定位字符串 → 反向引用 → 找到使用它的方法 → IL 视图看判断逻辑
dnSpyEx 调试器:附加进程 / 启动调试,在关键方法下断点,观察运行时:
> .NET 动态调试比 native 友好得多 —— 能直接看到对象值、字符串内容。优先动态而非死磕静态。
dnSpyEx → 右键方法 → Edit Method (C#) 或 Edit IL - 改判断:ldc.i4.0 → ldc.i4.1(false→true) - 改常量:直接编辑字符串/数字 - 删除校验:nop 掉整段 File → Save Module → 替换原文件
**IL patch 可靠性 > C# patch**:C# 重编译可能失败(缺引用、语法不对),IL 编辑几乎不会失真。详见 `references/common-workflow.md`。
用户说这些时进入本 skill:
**上游入口**: `skills/SKILL.md`(总控)、`routing.md` **下游出口**:
**同级关联模块**:
Reverse Engineering / Authorized Penetration Testing / Security Research Skill Router Pack AI-powered routing + On-demand toolchain bootstrapping + Self-evolving knowledge base Supports Claude Code, Kiro, Cursor, Cline, and other AI coding clients 逆向/渗透/安全技能路由包 - AI 自动路由 + 按需自举工具链 + 自动进化经验库 | 支持 Claude Code / Kiro / Cursor / Cline 等代码 AI 客户端
Repo: zhaoxuya520/reverse-skill
Use the reverse-skill repository from Codex for authorized reverse engineering, security…
Use for authorized security assessment of REST, GraphQL, WebSocket, or SOAP APIs, including…
在 CLI 环境下做 Android APK 逆向时使用。适用于 APK 解包、Java 反编译、smali 修改、重打包、Frida 动态 Hook,以及按需切换到 so/native…
Use for authorized multi-stage attack-path planning and orchestration when a task spans…
跨版本符号迁移与二进制差分。当你有旧版本的符号/逆向结果,需要快速迁移到新版本时使用。 适用场景:内核缺 PDB 用旧版符号推导、程序更新后批量迁移函数名、应用更新后快速定位新偏移。…
Use for authorized binary analysis in Binary Ninja, including HLIL/MLIL/LLIL inspection,…