sickn33/agentic-awesome-skills/patch-diff-exploit
Claude Code and agent skill by sickn33/agentic-awesome-skills
- community
Checking that the SKILL.md file is still in the repository.
Locate vulnerability fixes in vendor patches, diff binaries across versions, and build N-day PoCs. Attack-side complement to binary-diff for authorized research.
Install
npx vskill@latest install sickn33/agentic-awesome-skills/patch-diff-exploitSKILL.md
⚠️ AUTHORIZED USE ONLYThis skill is for educational purposes or authorized security assessments only.You must have explicit, written permission from the system owner before using this tool.Misuse of this tool is illegal and strictly prohibited.
Mandatory confirmation gateBefore running any command that probes, exploits, changes, persists on, extracts data from, or attempts credential access against a target:1. Ask the user to state the exact target URL, IP, account, or resource.2. Ask the user to confirm written authorization and the permitted scope.3. Show the exact command(s) and explain their expected effect.4. Wait for explicit confirmation in the current conversation.Without that confirmation, remain read-only and provide defensive guidance only. Prefer a sandbox, disposable VM, or controlled lab.
When to Use
- Turning a vendor security advisory into a concrete vulnerable-function location.
- Building a proof-of-concept for a patched vulnerability in authorized research.
适用范围
当任务属于以下场景时使用本 skill:
- 已知 CVE 但无公开 PoC — 厂商公告写了"修复了 XX 组件的越界写"但没放 PoC,需要从补丁反推
- SRC / 红队打 N-day — 目标资产未及时更新,需要把刚发布的补丁差成可用的 1-day 利用
- Patch Tuesday 跟进 — 每月第二个周二微软放补丁,需要快速锁定高价值漏洞(Kernel / Win32k / AFD / CLFS)
- Linux LTS 补丁分析 — 主线 fix 已合并,但旁支或某发行版 backport 不全,找未修补面
- 驱动 / 服务的安全补丁还原 — 显卡驱动、AV 引擎、虚拟化组件等闭源软件的补丁分析
与其他 skill 的分工
| 场景 | 用什么 | |
|---|---|---|
| 有旧版符号,迁移到新版本帮助分析 | binary-diff/ | |
| 从补丁找漏洞、写 PoC 打补丁前版本 | 本 skill | |
| 写出完整利用链(堆喷、ROP、提权) | pwn-chain/ | |
| 把 1-day 武器化部署到目标网络 | pentest-tools/network-attack-defense/ | |
| 从零逆向一个二进制 | ida-reverse/ / radare2/ |
差别的关键:binary-diff 的目标是让新版可分析(把旧符号搬过来),本 skill 的目标是找出补丁修了什么 bug 然后打补丁前的版本。前者服务防御侧 / 研究侧分析,后者服务攻击侧武器化。
研究与执行边界
默认在授权离线样本上静态分析。记录补丁前后来源/签名/SHA256、精确构建/架构/组件和符号 GUID/age;N-1 不自动等于易受攻击,backport 和功能开关须验证。匹配分数是排序线索,不是正确性/漏洞置信度;已匹配/未匹配/高相似函数都可能包含关键修复。
动态崩溃/竞争/提权测试只在可销毁隔离 VM,设置次数/时长/资源限制与快照恢复,禁止生产网络武器化/持久化/C2 或扩大目标。patched 不崩与 unpatched 崩只能支持有限差异,需要同条件重复、sanitizer/debugger根因和对照才能归因。缺失工具、脚本、RULES/tool-index 不得假装已提供;不自动安装或启动服务。公开 PoC/外发二进制是另一个需授权的操作。
核心原理
补丁修复模式 → 漏洞类型反查:
| 新增内容 | 大概率的 bug class | |
|---|---|---|
if (a + b < a) / __builtin_add_overflow | 整数溢出 | |
KeAcquireSpinLock / mutex_lock | 竞争条件 (TOCTOU / double-free) | |
if (idx >= MAX) / if (len > buf_size) | 越界读 / 越界写 | |
RtlZeroMemory / memset(struct, 0, ...) | 未初始化内存信息泄漏 | |
InterlockedDecrement + refcount 检查 | UAF / 引用计数错误 | |
ProbeForRead / ProbeForWrite | 用户态指针未校验 | |
SeAccessCheck / capability 校验 | 权限校验缺失 | |
删除 / 收紧 IOCTL code | 暴露面收敛(看老接口怎么打) |
工作流
5 步完整流程
工具调用顺序
典型场景示例
场景 1:Windows Patch Tuesday — 假设性分析示例
下面 CVE/KB/build/函数/崩溃时间未在此审查中核实,不是实际漏洞定位或复现结果;按厂商证据替换后使用。
场景 2:Linux 内核 LTS 分支补丁找未修的旁支
注意事项
- 法律边界 — 武器化 N-day 必须在授权范围内(SRC / Bug Bounty / 自有靶机 / CTF)。对生产环境直接打 1-day 等同入侵
- 补丁可能只是"减小爆炸半径" — 看到 patch 不一定就是完整修复,有可能只是补一个利用路径,原始 bug 仍可从别的路径触发(一鱼多吃)
- 变量名/类型不要被欺骗 — Windows 补丁经常顺手做 cleanup / rename,看似变更很大但实际无关。要看控制流和数据流,不要看 token 级 diff
- 微软的补丁可能加了 mitigation 而不是 fix — 看到
_guard_xfg_dispatch_icall_fptr这种 CFG 强化不要当成 fix,那是 mitigation - 匿名化 — writeup / PoC 公开时脱敏目标机器名、内网 IP、用户名(写
{target_ip}{username}占位) - patched 版本上要能跑通无害化测试 — 别只在 unpatched 上跑,否则可能是环境因素导致的崩溃,不是漏洞
- 二进制 diff 不万能 — 编译器升级 / 优化等级变化也会让函数 layout 大变,先用 N 版本和 N-1 版本(同一编译器)对比,不要跨大版本
按需自举(On-Demand Bootstrap)
工具依赖
| 工具 | 用途 | 可自动安装 | |
|---|---|---|---|
| BinDiff (Google, 5.x+) | 函数级二进制 diff,IDA/Ghidra 插件 | ✓ (有官方 .deb / .msi) | |
| Diaphora | IDA 老牌 diff 插件,需要 IDA Pro | ✓ (git clone) | |
| ghidriff | Ghidra headless CLI diff,输出 markdown | ✓ (pip install ghidriff) | |
| DeepDiff (商业) | 新一代 diff 工具,准确度更高 | ✗ (商业授权) | |
| Ghidra | ghidriff 的运行底座 | ✓ | |
| IDA Pro | BinDiff / Diaphora 的运行底座 | ✗ (商业) | |
| Microsoft Update Catalog | 下 MSU/MSP 补丁包 | 在线服务 | |
| wsuspect-proxy | 透明拦截 Windows Update 流量取补丁 | ✓ (git clone) | |
| expand.exe / dism | 解 MSU / cab | ✓ (Windows 自带) | |
| rpm2cpio / dpkg-deb | 解 Linux 发行版包 | ✓ | |
| symchk | 从微软符号服务器拉 PDB | ✓ (Windows SDK) |
自举命令
详细工具对比与命令见 references/diff-tools-comparison.md。 详细 Patch Tuesday 工作流见 references/patch-tuesday-workflow.md。 根因反推与 PoC 模板见 references/root-cause-and-poc.md。
路由上下文
上游入口: skills/SKILL.md(总控)、routing.md
上游 skill:
reverse-engineering/— 在做 diff 之前可能要先理解目标二进制的整体结构binary-diff/— 如果补丁后版本无符号、补丁前有符号,先用 binary-diff 搬符号过来
下游 skill:
pwn-chain/— 反推出 bug class 后,需要写完整利用(堆喷、ROP、SMEP/SMAP 绕过、提权 payload)pentest-tools/network-attack-defense/— 把 N-day 武器化部署到目标网络(包装成可投递载荷、对接 C2)attack-chain/— 把这一个 N-day 串到完整攻击链里(初始访问 → 提权 → 横向)
触发条件: 任务包含"N-day"、"补丁"、"CVE 复现"、"找补丁修了什么"、"打未更新主机" 等意图
任务完成自检(声称完成前 MUST 通过)
- [ ] 我是否只执行了授权阶段,并把静态/未执行/未完成/失败结果准确区分?
- [ ] 我是否基于
tool-index使用了真实工具路径? - [ ] 我是否产出了可复现证据(命令/脚本/截图/报告)?
- [ ] 我是否完成并回写了 RULES 要求的 Checklist 项?
Limitations
- PoC development only for vulnerabilities you are authorized to research.
- Patch diffing fails when vendors rebuild extensively between releases.
Adapted from zhaoxuya520/reverse-skill (MIT).
Security
- Security scanPassed, 90 of 100Pattern checks on the skill's files.
- Model reviewPassed
Quality evaluation
- Task evaluationNot runNo evaluation yet. Run one in Skill Studio.
Source
- SKILL.md in the repositoryCheckingskills/patch-diff-exploit/SKILL.md
Popularity
- Repository stars
- 47,054
- Repository forks
- 6,853
- 7-day trend score
- 54
Stars and forks are for the whole GitHub repository, not this skill alone. Not refreshed yet.
Works with
Any agent vskill installs to: 56 targets in all. These 39 have a page on this site.
- Claude Code
- Cursor
- GitHub Copilot
- Windsurf
- Codex
- Gemini CLI
- Cline
- Amp
- Roo Code
- Goose
- Continue
- Kilo Code
- Junie
- Trae
- OpenHands
- Qwen Code
- AI Agent
- Tabnine Chat
- Sourcegraph Cody
- Amazon Q
- Firebase Genkit
- Sweep
- Devin
- Phind
- Mentat
- Claude Desktop
- Aider
- GPT Pilot
- Plandex
- bolt.new
- v0
- Replit Agent
- Anse
- TypingMind
- BetterChatGPT
- LibreChat
- Warp AI
- Pieces
- Fig AI
Embed badge
[](https://verified-skill.com/skills/sickn33/agentic-awesome-skills/patch-diff-exploit)