Loading...
Loading...
Compare original and translation side by side
| Step | Action | Key Question |
|---|---|---|
| 1. Identify Assets | Map valuable targets | What can be stolen, locked, or manipulated? |
| 2. Enumerate Entry Points | List all external/public functions | Which functions change state or move value? |
| 3. Model Adversary | Define attacker capabilities | What resources (flash loans, MEV, tokens) does the attacker have? |
| 4. Construct Sequences | Build multi-step attack paths | What sequence of calls achieves the attack goal? |
| 5. Verify Invariants | Check contract assumptions | Which mathematical or state invariants can be violated? |
| 步骤 | 行动内容 | 核心问题 |
|---|---|---|
| 1. 识别资产目标 | 梳理高价值攻击目标 | 哪些资产可被窃取、锁定或操控? |
| 2. 枚举攻击入口点 | 列出所有外部/公共函数 | 哪些函数会改变合约状态或转移资产价值? |
| 3. 建模攻击者能力 | 定义攻击者拥有的资源能力 | 攻击者具备哪些资源(闪电贷、MEV、代币等)? |
| 4. 构建攻击路径序列 | 设计多步骤攻击流程 | 通过哪些调用序列可达成攻击目标? |
| 5. 验证合约不变量 | 检查合约的假设条件 | 哪些数学或状态不变量可被违反? |
| Category | Severity | Key Indicators | Example Attack |
|---|---|---|---|
| Reentrancy | Critical | External calls before state updates, missing guards | Drain via fallback re-entry |
| Flash Loan | Critical | Price-dependent logic, spot price reliance | Borrow → manipulate → profit |
| Oracle Manipulation | High | External price feeds, single-source oracles | Inflate collateral value |
| MEV / Front-running | High | DEX interactions, unprotected swaps | Sandwich attack on swap |
| Governance | High | Token-weighted voting, timelocks | Flash-borrow votes |
| Access Control | Critical | Initializers, proxy patterns, ownership | Unprotected initializer takeover |
| Economic / Logic | High | Reward calculations, share math, minting | Rounding exploit in rewards |
| Cross-contract | High | Token callbacks, composability assumptions | Malicious ERC777 callback |
| 分类 | 严重程度 | 关键识别指标 | 攻击示例 |
|---|---|---|---|
| 重入攻击(Reentrancy) | 严重 | 状态更新前存在外部调用、缺少防护机制(如ReentrancyGuard) | 通过回退函数重入窃取资产 |
| 闪电贷攻击(Flash Loan) | 严重 | 依赖价格的逻辑、使用即时现货价格 | 借贷→操控价格→获利 |
| 预言机操控(Oracle Manipulation) | 高 | 依赖外部价格喂价、单一来源预言机 | 抬高抵押品估值 |
| MEV/抢先交易(MEV / Front-running) | 高 | 与DEX交互、未受保护的兑换操作 | 对兑换交易实施三明治攻击 |
| 治理漏洞利用(Governance) | 高 | 代币权重投票、时间锁机制 | 闪电借贷获取投票权 |
| 访问控制绕过(Access Control) | 严重 | 初始化函数、代理模式、所有权机制 | 未受保护的初始化函数接管 |
| 经济/逻辑漏洞(Economic / Logic) | 高 | 奖励计算、份额数学逻辑、铸币机制 | 奖励计算中的舍入漏洞利用 |
| 跨合约风险(Cross-contract) | 高 | 代币回调函数、组合性假设条件 | 恶意ERC777回调干扰合约状态 |
totalDeposits <= balancetotalDeposits <= balanceblock.numberblock.timestampblock.numberblock.timestampsolidity-agent-toolkitanalyze_adversarial_scenariosadversarial_analysisadversarial://listadversarial://category/{category}match_vulnerability_patternsrun_slitherrun_aderynsolidity-agent-toolkitanalyze_adversarial_scenariosadversarial_analysisadversarial://listadversarial://category/{category}match_vulnerability_patternsrun_slitherrun_aderyn