karamonjie/karamotech-agent-suite/whitehack-rescue

Claude Code and agent skill by karamonjie/karamotech-agent-suite

Trust tier 3
  • community
Source check pending

Checking that the SKILL.md file is still in the repository.

Install

npx vskill@latest install karamonjie/karamotech-agent-suite/whitehack-rescue

SKILL.md

The same SKILL.md was published earlier as karamonjie/karamotech-agent-suite/whitehack-rescue.

/whitehack-rescue — White-Hat Rescue Operation Planning

Plan and simulate authorized white-hat fund rescue operations.

Usage

/whitehack-rescue --protocol <address> --vuln <description>
/whitehack-rescue --scenario frontrun-attacker
/whitehack-rescue --simulate drain-to-safe --safe-wallet <address>

Phase 0 — Verify & Scope (Before Any Action)

MANDATORY CHECKLIST — complete all before touching mainnet:
[ ] Reproduce vulnerability on testnet/fork (Foundry anvil --fork-url)
[ ] Quantify exact funds at risk (specific tokens, amounts, addresses)
[ ] Identify if protocol has a Guardian / emergency pause role
[ ] Identify official security contact (Discord, security.txt, or past audit contact)
[ ] Establish secure comms channel (PGP email or Signal) with protocol team
[ ] Get WRITTEN authorization from protocol team before any rescue attempt
[ ] Prepare a safe multi-sig wallet for temporary fund custody
[ ] Have a fund return mechanism ready (same contract redeploy or direct transfer)

Phase 1 — Responsible Disclosure (Always First)

Contact methods (try in order):
1. security.txt at https://<protocol-domain>/.well-known/security.txt
2. Immunefi submission (if protocol has bug bounty program)
3. Email: security@<protocol>.xyz / security@<protocol>.io
4. Twitter/Discord DM to core team with encrypted message
5. On-chain message: cast send $ADMIN_ADDRESS --value 0 --data $(cast --from-utf8 "CRITICAL VULN - CHECK EMAIL")
Timeline:
- T+0: Initial disclosure
- T+48h: Follow-up if no response
- T+72h: Consider white-hat rescue if funds actively at risk and team unresponsive
- T+90d: Public disclosure after fix

Phase 2 — Rescue Simulation (Foundry Fork)

solidity
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.19;
import "forge-std/Test.sol";
contract WhiteHatRescueSimulation is Test {
address constant VULNERABLE = 0xVulnerableContract;
address constant SAFE_MULTISIG = 0xProtocolMultiSig; // agreed with team
address whiteHat = makeAddr("whiteHat");
function setUp() public {
// Fork mainnet at current block
vm.createSelectFork(vm.envString("ETH_RPC_URL"));
vm.deal(whiteHat, 10 ether); // gas money
}
function testRescueSimulation() public {
uint256 valueAtRisk = address(VULNERABLE).balance;
console.log("Funds at risk:", valueAtRisk / 1e18, "ETH");
vm.startPrank(whiteHat);
// --- Simulate the rescue exploit here ---
// Example: reentrancy drain to safe wallet
RescueAttack rescue = new RescueAttack(VULNERABLE, SAFE_MULTISIG);
rescue.execute{value: 1 ether}();
// ----------------------------------------
vm.stopPrank();
uint256 rescued = SAFE_MULTISIG.balance;
console.log("Rescued to safe wallet:", rescued / 1e18, "ETH");
assertGt(rescued, 0, "Rescue failed");
}
}
bash
# Run simulation — must succeed before any mainnet action
anvil --fork-url $ETH_RPC_URL --fork-block-number latest &
forge test --match-test testRescueSimulation -vvvv

Phase 3 — Frontrunning Attacker (If Attack In Progress)

python
# Race the attacker's exploit transaction with your rescue
# Requires direct mempool access (Flashbots or high-priority TX)
import requests
FLASHBOTS_RELAY = "https://relay.flashbots.net"
bundle = {
"jsonrpc": "2.0",
"method": "eth_sendBundle",
"params": [{
"txs": [
RESCUE_TX_SIGNED_HEX, # your rescue TX
],
"blockNumber": hex(current_block + 1),
"minTimestamp": 0,
"maxTimestamp": 9999999999,
}],
"id": 1
}
# High tip to ensure inclusion before attacker
# Set maxPriorityFeePerGas >> attacker's gas price
bash
# Alternative: use cast to send with high gas price
cast send $VULNERABLE "rescue()" \
--private-key $WHITEHAT_KEY \
--gas-price $(cast gas-price --rpc-url $RPC | awk '{print $1 * 2}') \
--rpc-url $RPC

Phase 4 — Fund Return

bash
# Return rescued funds via on-chain message + transfer
cast send $ORIGINAL_CONTRACT \
--value $(cast balance $SAFE_WALLET) \
--data $(cast --from-utf8 "White-hat rescue. Returning funds. See: https://hacmd.io/rescue-report") \
--private-key $SAFE_WALLET_KEY \
--rpc-url $RPC
# Or via protocol's new deployment
# Coordinate with team for merkle-drop to original depositors

Phase 5 — Documentation

markdown
# White-Hat Rescue Report
Date: YYYY-MM-DD
Protocol: <Name>
Vulnerability: <Brief description>
Funds Secured: <amount> ETH / <token amounts>
Safe Wallet: <address> (protocol multisig)
Disclosure Date: <date>
Team Response: <acknowledged within Xh / unresponsive>
Mainnet TX: <tx hash of rescue>
Return TX: <tx hash of fund return>
Authorization: <link to protocol team statement or email hash>
Timeline:
-T+0: Vulnerability discovered
-T+Xh: Contacted protocol team via <channel>
-T+Yh: Team acknowledged / rescue authorized
-T+Zh: Rescue executed on mainnet
-T+Wh: Funds returned to protocol

Legal Risk Matrix

ScenarioLegal RiskMitigation
Written authorization from protocol teamLowKeep signed authorization on file
Disclosure + no response + funds draining nowMediumDocument timeline, return funds immediately
No disclosure, no authorizationHIGHDo not proceed — this is unauthorized access
Rescue without intent to returnCRIMINALNever do this

Reference Cases

  • Compound cDAI (2020): Whitehats used frontrun bots to rescue $8M from rounding bug
  • Polygon MATIC (2021): White-hat disclosed $24B vulnerability; received $2M bounty
  • Euler Finance (2023): Hacker returned $197M after negotiations (not white-hat, but shows return is possible)
  • Curve Vyper (2023): $70M drained; multiple white-hats rescued portions with team coordination

Security

  • Security scanPassed, 90 of 100Pattern checks on the skill's files.
  • Model reviewPassed

Quality evaluation

  • Task evaluationNot runNo evaluation yet. Run one in Skill Studio.

Source

Popularity

7-day trend score
0

Not refreshed yet.

Works with

Any agent vskill installs to: 56 targets in all. These 39 have a page on this site.

  • Claude Code
  • Cursor
  • GitHub Copilot
  • Windsurf
  • Codex
  • Gemini CLI
  • Cline
  • Amp
  • Roo Code
  • Goose
  • Continue
  • Kilo Code
  • Junie
  • Trae
  • OpenHands
  • Qwen Code
  • AI Agent
  • Tabnine Chat
  • Sourcegraph Cody
  • Amazon Q
  • Firebase Genkit
  • Sweep
  • Devin
  • Phind
  • Mentat
  • Claude Desktop
  • Aider
  • GPT Pilot
  • Plandex
  • bolt.new
  • v0
  • Replit Agent
  • Anse
  • TypingMind
  • BetterChatGPT
  • LibreChat
  • Warp AI
  • Pieces
  • Fig AI
Embed badge
vskill VERIFIED badge
[![vskill VERIFIED](https://verified-skill.com/api/v1/skills/karamonjie/karamotech-agent-suite/whitehack-rescue/badge)](https://verified-skill.com/skills/karamonjie/karamotech-agent-suite/whitehack-rescue)

Something wrong with this skill or its page? Tell us.