Skip to main content

poc

Generates and validates Foundry PoC tests from attack scenario documents. Use when: (1) Audit Phase 3 invokes Skill(vigilo:poc) for each High/Medium finding, (2) A finding at .vigilo/findings/ needs PoC validation, (3) Converting attack scenarios into executable Foundry tests. Outputs: test/poc/{finding-id}.t.sol, .vigilo/poc/ validation logs.

소스 정보

저장소
BitterSecurity/Vigilo
최근 소스 활동
2026년 1월 26일 12:30
감지된 SKILL.md 언어
영어
스타
69
포크
19

설치 방법

기본적으로 소스를 먼저 확인하는 Prompt가 선택됩니다. 직접 명령으로 전환하거나 로컬 사본을 다운로드할 수도 있습니다.

소스 파일 검토

설치 여부를 결정하기 전에 SKILL.md와 SkillsMP에 표시된 보조 파일을 읽어 보세요.

파일 탐색기
3 개 파일

SKILL.md 표시 중

SKILL.md
소스 지침 · 읽기 전용 미리보기
name
poc
description
Generates and validates Foundry PoC tests from attack scenario documents. Use when: (1) Audit Phase 3 invokes Skill(vigilo:poc) for each High/Medium finding, (2) A finding at .vigilo/findings/ needs PoC validation, (3) Converting attack scenarios into executable Foundry tests. Outputs: test/poc/{finding-id}.t.sol, .vigilo/poc/ validation logs.
argument-hint
<finding-path.md>
# PoC Generation & Validation **Input**: $ARGUMENTS (attack scenario file path) --- # Part 1: PoC Code Generation ## Core Principle ``` 1 Attack Scenario = 1 PoC Code ``` ## Workflow ### 1. Read Attack Scenario ``` Read(".vigilo/findings/{severity}/{auditor}/{Severity}-{id}-{title}.md") ``` Example: `.vigilo/findings/high/logic/H-01-donation-attack-inflated-collateral.md` Extract: Finding ID, Bug Class, Preconditions, Attack Steps, Impact, Vulnerable Code ### 2. Generate PoC **File**: `test/poc/{Severity}-{id}-{title}.t.sol` Example: `test/poc/H-01-donation-attack-inflated-collateral.t.sol` **NOTE**: PoC code goes in `test/poc/` (project root), NOT in `.vigilo/` folder. ```solidity // SPDX-License-Identifier: MIT pragma solidity ^0.8.0; import "forge-std/Test.sol"; import "forge-std/console2.sol"; contract PoC_{ID}_{BugClass} is Test { // State variables, actors function setUp() public { // Reproduce preconditions } function test_Exploit_{ID}() public { // 1. Log initial state // 2. Execute attack steps // 3. Log final state // 4. Assert impact } } ``` ### 3. PoC Checklist - [ ] setUp(): Fully reproduce preconditions - [ ] Actor labels: Use `makeAddr()` for all addresses - [ ] console2.log: Output before/after attack state - [ ] Attack steps: Follow scenario order exactly - [ ] **Impact assertion: Directly prove scenario's claimed impact** (required) ### 4. Bug Class Patterns Detailed templates: [references/poc-templates.md](references/poc-templates.md) --- # Part 2: Foundry Validation ## Core Principle ``` Test Pass ≠ Vulnerability Validated ``` **Goal**: Verify that the Attack Scenario's claimed Impact actually occurs ## Workflow ### 1. Execute Test ```bash forge test --match-test "test_Exploit_{ID}" -vvv ``` | Verbosity | Use Case | |-----------|----------| | `-vvv` | Default recommended | | `-vvvvv` | Detailed debugging | ### 2. Analyze Results | Result | Meaning | Action | |--------|---------|--------| | PASS + Impact proven | Vulnerability valid | → Complete | | PASS + Impact unclear | Insufficient verification | → Strengthen assertions | | FAIL | Issue occurred | → Fix PoC (max 3 attempts) | ### 3. Impact Verification ``` Scenario Impact → Assertion Mapping ───────────────────────────────────── "Vault drain" → assertGt(attackerAfter, attackerBefore) "Collateral loss" → assertLt(userAfter, userBefore) "Admin bypass" → assertTrue(attacker.hasRole(ADMIN)) ``` ### 4. Modification Workflow ``` Test failure or Impact mismatch ↓ Fix PoC (max 3 attempts) ↓ After 3 failures → Review Attack Scenario ↓ If scenario needs update → Reverse-modify ``` **If PoC validation differs from scenario, update Attack Scenario**: - Expected profit ≠ actual profit → Update Impact numbers - Additional precondition needed → Update Preconditions - Exploit impossible → Downgrade severity or mark Invalid ### 5. Output **Files** (use same naming format `{Severity}-{id}-{title}`): ``` test/poc/H-01-donation-attack.t.sol # PoC code (project root) .vigilo/poc/H-01-donation-attack.md # Validation log .vigilo/findings/high/logic/H-01-donation-attack.md # (Modified) Attack Scenario ``` **Naming Convention**: `{Severity}-{id}-{kebab-case-title}` - Same format across all three file types - Makes it easy to track: scenario → PoC code → validation log --- ## Reference Files | File | When to Load | |------|--------------| | [poc-templates.md](references/poc-templates.md) | When writing PoC - Bug class patterns | | [debugging.md](references/debugging.md) | When test fails - Error resolution |
GitHub에서 보기