exploit

A command that turns a security-audit finding into a Foundry test. Foundry is a tool for testing Solidity smart contracts, and the test sets up the bug, runs the attack, and checks whether it succeeds.

In plain words
What is it for?
Use it to create and run proof-of-concept tests for vulnerabilities in smart contracts, including the needed balances and deployed dependencies.
Why use it?
It removes the manual work of turning an audit description into a runnable proof that the bug is exploitable. An optional story explains the attack in prose.

Command

Install

Getting it into your agent

One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.

agentmods
npx agentmods add commands/omermaksutii/rugproof/exploit
Clone the repo
git clone --depth 1 https://github.com/omermaksutii/RugProof
Per session 18 Only the description is in the session, so the agent can decide to use it. The body loads when it is invoked.
When invoked 941 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. Scan, not verified.
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5 $0.00018 $0.00941
Opus 5 $0.00009 $0.00470
Sonnet 5 $0.00004 $0.00188
Haiku 4.5 $0.00002 $0.00094

Measured 2d ago against content hash dee25e8efcb7, method: parsed. Prices are Anthropic first-party input rates as of 2026-08-30, from the pricing page.

Security

Grade A, and why

exploit scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 2d ago.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Nothing flagged

None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.

commands/exploit.md · 106 lines

How it starts

The opening of the file, as written. The whole thing — 106 lines — stays where its author put it; the contents beside it link to each section on GitHub.

/exploit — write a working PoC

This is the headline feature. For a given finding ID, produce a Foundry test that:

  1. Sets up the vulnerable state.
  2. Executes the exploit.
  3. Asserts the attacker gained value or the protocol was broken.
  4. Compiles.
  5. The test passes when run.

If --story is set, also produce a narrative "attack walkthrough" — punchy prose suitable for a tweet thread or blog post.

Procedure

Step 1 — Read the finding and the target

  • Pull finding $ARGUMENTS[0] from the latest audit.
  • Read the affected file and all imports it needs.
  • Note the function signatures, state vars, and any setup needed (e.g. funded balances, deployed dependencies like a Uniswap V2 pair).

Step 2 — Dispatch exploit-poc-writer subagent

The subagent writes the Foundry test. Use Foundry's Test base + vm.prank, vm.deal, vm.warp, vm.expectRevert, vm.startPrank, etc.

Structure:

// SPDX-License-Identifier: MIT
pragma solidity ^0.8.20;

import "forge-std/Test.sol";
import {Vault} from "src/Vault.sol";
import {MaliciousReceiver} from "./MaliciousReceiver.sol";

contract ExploitREENT001 is Test {
    Vault vault;
    address attacker = makeAddr("attacker");
    address victim = makeAddr("victim");

    function setUp() public {
        vault = new Vault();
        vm.deal(victim, 10 ether);
        vm.deal(attacker, 1 ether);
        vm.prank(victim);
        vault.deposit{value: 10 ether}();
    }

    function test_Reentrancy_Drain() public {
        MaliciousReceiver bad = new MaliciousReceiver(vault);
        vm.deal(address(bad), 1 ether);
        vm.startPrank(attacker);

        bad.attack{value: 1 ether}();   // ← seed deposit + trigger reentrancy

        assertGt(address(bad).balance, 1 ether, "exploit failed to drain");
        assertLt(address(vault).balance, 1 ether, "vault not drained");
    }
}

Plus any auxiliary attacker contract.

Step 3 — Compile and run

Use the forge-runner MCP:

mcp__forge-runner__build()
mcp__forge-runner__test(test="test_Reentrancy_Drain")

Read the full file on GitHub · 106 lines

Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. 2d ago First seen · 106 lines · 18 tokens per session scan A dee25e8efcb7

Subscribe to this mod's changes

exploit is a command published in the GitHub repository omermaksutii/RugProof (9 stars, last pushed 1mo ago), licensed MIT. It adds 18 tokens to every session and 941 once invoked, about $0.0001 per session on Opus 5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-31.