omermaksutii/RugProof

GitHub: omermaksutii/RugProof

RugProof 是一个 Claude Code 插件,将编辑器变为全栈智能合约安全审计员,支持漏洞检测、exploit PoC 生成、主网分叉模拟与链上审计证书。

Stars: 7 | Forks: 0

# Rugproof 🌐 **在线网站:** [omermaksutii.github.io/RugProof](https://omermaksutii.github.io/RugProof/) 📦 **最新版本:** [v0.1.0](https://github.com/omermaksutii/RugProof/releases/tag/v0.1.0) 一个 Claude Code 插件,可将你的编辑器变成一个全栈智能合约安全审计员:漏洞检测、可用的漏洞利用 PoC、主网分叉模拟、不变量生成、gas 分析、灵魂绑定链上审计证书,以及可分享的审计卡片——支持所有主要 EVM 链上的 Solidity + Vyper。 ## 安装 ### 从 GitHub 源码安装(当前可用) ``` # 在 Claude Code 中: /plugin marketplace add omermaksutii/RugProof /plugin install rugproof@omermaksutii-RugProof /rugproof-init # 60-second setup /audit examples/VulnerableVault.sol # try it on the bundled vulnerable demo ``` ### 从官方 Anthropic 市场安装 正在等待审核。在 [claude.com/plugins](https://claude.com/plugins) 上架后: ``` /plugin install rugproof ``` 在 [claude.ai/settings/plugins/submit](https://claude.ai/settings/plugins/submit) 或 [platform.claude.com/plugins/submit](https://platform.claude.com/plugins/submit) 提交你自己的插件。 ### 本地开发 ``` git clone https://github.com/omermaksutii/RugProof cd RugProof make build # MCP servers + scripts make test # forge tests + NFT tests + MCP smoke test make audit-demo # runs the bundled reentrancy exploit (passes) ``` ## 快速开始 ``` # 在任何 Solidity 项目中: /audit # full audit on the repo /audit src/Vault.sol # audit one file /quick-scan # fast pre-commit-style scan /audit-live 0xabc... --chain ethereum # audit a deployed contract by fork /exploit # write a working Foundry PoC /report # render Markdown / HTML / PDF / PNG card ``` ## 包含哪些功能 ### 38 个斜杠命令 **审计:** `/audit` `/audit-deep` `/audit-strict` `/audit-changes` `/audit-live` `/audit-history` `/quick-scan` `/score` `/explain` **输出:** `/report` `/card` `/remediate` **漏洞利用:** `/exploit` `/exploit-chain` `/exploit-live` **模拟:** `/simulate` `/replay-incident` **测试:** `/test-gen` `/invariant` `/fuzz` `/coverage` `/symbolic` **分析:** `/gas` `/upgrade-safety` `/verify-deploy` `/diff-audit` **工具集成:** `/slither` `/mythril` **工作流:** `/rugproof-init` `/dismiss` `/verify-finding` `/bounty` `/bounty-submit` `/demo` **通知:** `/notify-slack` `/notify-discord` `/tweet` **链上:** `/mint-cert` (Berachain 灵魂绑定审计证书) ### 19 个专业子代理 **功能性:** `attacker` · `defender` · `exploit-poc-writer` · `invariant-writer` · `gas-optimizer` · `remediation-suggester` · `report-writer` · `assembly-auditor` **协议特定:** `amm-specialist` · `lending-specialist` · `staking-specialist` · `bridge-specialist` · `governance-specialist` · `yield-aggregator-specialist` · `nft-specialist` **热门专家 (2025):** `aa-specialist` (ERC-4337) · `crosschain-messaging-specialist` (LayerZero V2 / CCIP / Hyperlane / Wormhole / Axelar) · `restaking-specialist` (EigenLayer / Symbiotic / Karak) · `intents-specialist` (ERC-7683 / UniswapX / CoW) ### 33 个自动调用的漏洞技能 一个检测技能库,当 Claude 识别到匹配的代码模式时会自动激活。涵盖完整的 CWE/SWC 目录以及现代 DeFi 特定问题: **经典类 (19):** 重入攻击 (包括只读和跨合约) · 访问控制 · 预言机操控 · 闪电贷攻击 · MEV/抢跑 · 签名重放 · 存储布局 · 初始化 · 未检查调用 · 拒绝服务向量 · 整数问题 · delegatecall 风险 · 交易上下文误用 · 代币兼容性 · 授权问题 · EIP-6780 自毁 · 内联汇编 · pragma 与地址规范 · 中心化风险。 **2025 热门话题 (8):** ERC-4337 账户抽象 · 跨链消息传递 · Permit2 / EIP-2612 · ERC-1271 合约签名 · Diamond / EIP-2535 · 再质押 & EigenLayer AVS · ERC-7683 意图 · ERC-4626 通胀/捐赠。 **AI 质量元技能 (4):** 置信度评分 · 多轮自我审查 (`/audit-strict`) · 已知良好参考比较 · 误报反馈循环 (`/dismiss` + `.rugproof.yml ignore:` + 内联 `// rugproof-ignore` 标记)。 **开发者体验 (DX) 元技能 (2):** 缓存与增量分析 (跳过未更改的文件) · 进度与流式传输 (长时间审计期间的实时状态)。 ### 9 个 MCP 服务器 链 I/O、测试运行器、历史数据库 —— `block-explorer` · `forge-runner` · `hardhat-runner` · `anvil` · `tenderly` · `c4-history` · `sherlock-history` · `gas-tracker` · `token-metadata`。 ### 4 个钩子 pre-commit 快速扫描 · pre-push 完整审计 · pre-deploy 构建产物检查 · post-test 覆盖率分析器。(pre-commit 和 pre-push 作为 git 钩子脚本存在;pre-deploy 和 post-test 通过 `plugin.json` 接入 Claude Code 的 Bash 钩子事件。) ### 5 个内置的漏洞演示合约 `examples/` 目录提供了一个“安装即惊艳”的集合:经典的重入金库、现货预言机借贷市场、闪电贷治理、ERC-4626 通胀攻击、可重放桥。安装后运行 `/demo` 即可查看 Rugproof 的实际运行情况,无需自带代码。 ## 配置 在代码库根目录创建一个 `.rugproof.yml` 文件。请参阅 `.rugproof.yml.example`。 ``` severity_threshold: high # block CI on this severity or worse chains: [ethereum, berachain, arbitrum, base] include: ["src/**/*.sol"] exclude: ["test/**", "script/**"] ignore: - id: REENT-001 reason: "Single-trusted-caller, reviewed 2025-Q4" ``` 在代码中进行内联抑制: ``` // rugproof-ignore: REENT-001 — single trusted caller, reviewed 2025-Q4 function trustedOp() external onlyOwner { ... } ``` ## 支持范围 **链:** Ethereum · Berachain · Arbitrum · Base · Optimism · Polygon · BSC · Linea · zkSync · Scroll **语言:** Solidity (完全支持) · Vyper (大部分模式) · Stylus / CosmWasm / Solana-Anchor (主要漏洞类别) · Yul / 内联汇编 (专家级) ## 输出格式 `/report` 生成 Markdown、HTML、PDF、JSON,以及一个可分享的 PNG 审计卡片。`/card` 仅生成 PNG —— 专为社交分享而构建。 ## 在线网站 📖 **文档 + 示例报告 + 画廊:** [omermaksutii.github.io/RugProof](https://omermaksutii.github.io/RugProof/) 该网站通过 `.github/workflows/pages.yml` 中的 GitHub Pages 工作流由 `docs/` 文件夹构建 —— 每次触及 `docs/` 并向 `main` 分支的推送都会触发重新部署。 ## 仓库布局 ``` RugProof/ ├── .claude-plugin/plugin.json # marketplace manifest + MCP/hook wiring ├── .github/ # workflows (pages, pr-audit, release) + action + templates ├── commands/ # 38 slash commands (real prompts) ├── agents/ # 19 subagents ├── skills/ # 33 auto-invoked detection skills ├── mcp/ # 9 MCP servers (TypeScript) ├── scripts/ # render-card · render-report · md-to-html · telemetry · … ├── hooks/ # 4 hooks ├── templates/ # report.md.hbs · report.html.hbs · audit-card.svg.hbs ├── examples/ # 5 vulnerable demo contracts ├── nft/ # AuditCertificate.sol (soulbound) + tests ├── samples/ # rendered sample reports + cards ├── docs/ # GitHub Pages site (auto-deployed) ├── rules/ # community rule pack template ├── test/ # Foundry exploit tests ├── lib/ # forge-std, openzeppelin-contracts (gitmodules) ├── foundry.toml · remappings.txt ├── Makefile · LICENSE · SECURITY.md · CONTRIBUTING.md · CODE_OF_CONDUCT.md · CHANGELOG.md ├── .rugproof.yml.example · .rugproofignore.example └── README.md ``` ## 构建 通过 Makefile 一键完成: ``` make build # builds all 9 MCP servers + scripts make test # forge tests + NFT tests + MCP smoke test make audit-demo # runs the bundled reentrancy exploit PoC (passes) make sample-cards # rerender PNG audit cards from samples/ make sample-html # rerender HTML pages from samples/ ``` 或手动构建: ``` cd mcp && npm install && npm run build cd ../scripts && npm install && npm run build forge install # if you want to refresh git submodules forge test -vv # exploit PoC against VulnerableVault passes node scripts/dist/test-mcp.js # MCP smoke test (9/9 servers should pass) ``` `plugin.json` 为每个服务器指向 `mcp/-mcp/dist/index.js`。大多数服务器在缺少 API 密钥或外部工具时会返回模拟数据,因此即使在未完全配置的环境中,该插件也能开箱即用。 ## 路线图 这个 v1 版本发布了**完整的骨架** —— 每个命令、代理、技能、MCP、钩子、模板和示例合约都已包含实际内容。后续阶段将深化实现: | 阶段 | 范围 | |------:|:------| | 1 *(当前版本)* | 完整骨架:38 个命令 · 19 个代理 · 33 个技能 · 9 个 MCP · 4 个钩子 · 5 个演示合约 · NFT 证书 · GitHub Action · Pages 网站 | | 2 | 通过 `forge-runner-mcp` 端到端连接 `/exploit`,针对真实协议分叉运行 | | 3 | 在 `block-explorer-mcp` 中集成真实的 Etherscan 系列 API;使实时审计达到生产就绪状态 | | 4 | 使用真实世界的测试语料库强化 DeFi 专家;发布社区规则包 | | 5 | 从动态后端提供公开审计画廊;集成漏洞赏金提交 API | | 6 | 多语言 (Vyper, Stylus/Rust);在 Berachain 主网上线链上审计证书;Claude Code 市场上架 | ## 许可证 MIT
标签:AI安全, Chat Copilot, CISA项目, Claude插件, DeFi安全, EVM, Foundry, Gas优化, MCP服务器, NFT证书, PoC生成, Solidity, Vyper, Web3安全, 主网分叉, 云安全监控, 代码安全, 代码审查, 以太坊, 区块链, 合约审计, 安全证书, 对称加密, 提示词注入, 智能合约审计, 漏洞枚举, 编辑器插件, 自动化审计, 自定义脚本, 重入攻击, 静态分析