token-scan
**token-scan** Automated and manual security scanner that detects rug pull vectors in meme coin and token contracts across EVM (Solidity) and Solana (Rust/Anchor) blockchains. Identifies eight exploit classes including hidden mints, honeypots, fee manipulation, LP drains, bonding curve exploits, and authority retention through regex-based code analysis and returns risk scores. Use when evaluating unfamiliar token contracts before trading or deployment.
mkdir -p ~/.claude/commands && curl -fsSL https://raw.githubusercontent.com/elementalsouls/Claude-BugHunter/HEAD/commands/token-scan.md -o ~/.claude/commands/token-scan.mdtoken-scan.md
# /token-scan Fast rug pull detection for meme coins and token contracts. Covers EVM (Solidity) and Solana (Rust/Anchor). ## Usage ``` /token-scan contracts/Token.sol # Single EVM contract /token-scan src/ --recursive # Scan entire directory /token-scan programs/token/ --chain solana --recursive # Solana program /token-scan contracts/Token.sol --output findings/report.md # Save report ``` ## Step 0: Quick Kill Signals Before scanning code, check: ``` [ ] Contract is verified (source code available)? [ ] Deployer has no rug history? [ ] Token has been trading > 1 hour? [ ] Liquidity > $5K? [ ] Not a proxy with retained admin? ``` If ANY answer is NO → flag and proceed with extreme caution. ## Step 1: Optional Automated Scanner > **Optional accelerator — not bundled by default.** If you have a local > `token_scanner.py` (or any rug-vector scanner) on PATH, run it first for a quick > risk score. If you don't, **skip straight to Step 2** — the manual 8-class grep > audit below is the real, self-contained check and needs no extra tooling. ```bash # If present: python3 tools/token_scanner.py <contract_path> # EVM python3 tools/token_scanner.py <program_dir> --chain solana --recursive # Solana ``` The manual audit (Steps 2-9) covers all 8 bug classes via grep and is sufficient on its own. ## Step 2: Hidden Mint Check ```bash grep -rn "function mint\|_mint(\|_balances\[.*\] +=" src/ --include="*.sol" | grep -v "test\|lib" grep -rn "delegatecall" src/ --include="*.sol" # Solana: grep -rn "MintTo\|mint_to\|mint_authority" src/ --include="*.rs" ``` Look for: mint without MAX_SUPPLY cap, direct balance manipulation, delegatecall to unknown targets. ## Step 3: Honeypot Check ```bash grep -rn "blacklist\|isBlacklisted\|_bots\|maxTxAmount\|approve.*override" src/ --include="*.sol" # Solana: grep -rn "freeze_authority\|transfer_hook\|permanent_delegate" src/ --include="*.rs" ``` Look for: blacklist mappings, max tx setters without minimum bound, approve overrides that don't call super. ## Step 4: Fee Manipulation Check ```bash grep -rn "setFee\|setSellFee\|_taxFee\|_sellFee" src/ --include="*.sol" grep -rn "function set.*Fee" -A5 src/ --include="*.sol" | grep -v "require\|MAX" ``` Look for: fee setters without upper bound, fee exclusion for owner. ## Step 5: LP Drain Check ```bash grep -rn "migrateLP\|emergencyWithdraw\|\.sync()\|setPair\|setRouter" src/ --include="*.sol" grep -rn "addLiquidityETH" -A5 src/ --include="*.sol" | grep "owner\|msg.sender" ``` Look for: LP migration functions, emergency withdraw, auto-LP to owner wallet. ## Step 6: Bonding Curve Check ```bash grep -rn "virtualReserve\|setCurve\|graduate\|bonding_curve" src/ --include="*.sol" --include="*.rs" ``` Look for: mutable curve parameters, manipulable graduation threshold. ## Step 7: Authority Check (Solana) ```bash grep -rn "mint_authority\|freeze_authority\|update_authority\|close_authority" src/ --include="*.rs" grep -rn "set_authority.*None" src/ --include="*.rs" grep -rn "upgrade_authority" src/ --include="*.rs" ``` Look for: retained authorities that should be None, upgradeable programs. ## Step 8: Fake Renounce Check ```bash grep -rn "renounceOwnership.*override" src/ --include="*.sol" grep -rn "_shadowAdmin\|_backupOwner" src/ --include="*.sol" ``` Look for: overridden renounce without actual transfer, secondary admin roles. ## Step 9: Sandwich Amplification Check ```bash grep -rn "swapExactTokensForETH" -A5 src/ --include="*.sol" | grep "0," grep -rn "swapThreshold\|_rebase\|reflect()" src/ --include="*.sol" ``` Look for: auto-swap with amountOutMin=0, rebase on every transfer. ## Output Summarize the audit (whether driven by the manual steps or the optional scanner) as: - **Risk score** (0-100) based on finding severity - **Verdict** (CLEAN / LOW RISK / MEDIUM RISK / HIGH RISK / CRITICAL RISK) - **Individual findings** with file:line, code snippet, and recommendation ## What to Do Next - If CRITICAL findings → **DO NOT INTERACT**. Report if on Immunefi/Code4rena. - If HIGH findings → Manual deep review. May be intentional design. Check deployer history. - If MEDIUM findings → Flag for awareness. Likely not rug but worth monitoring. - If CLEAN → Token passes automated checks. Still verify on-chain state manually. ## 5-Minute Rule If you've been scanning for 5 minutes and found no red flags across all 8 classes + automated scan → the token is likely clean. Move on. Don't hunt for phantom bugs.
End-to-end Android APK red-team pipeline — automated APK acquisition (Play Store + apkpure + apkmirror fallback), jadx decompilation, secret/URL/JWT/Firebase grep, pinned-cert extraction, exported-component enumeration, Frida runtime instrumentation templates, intent-injection probes. Built from an authorized external red-team engagement where 7 APKs were pulled manually, 4 download attempts truncated, and a hardcoded JWT + 30 internal API endpoints were recovered from one of the apps. Use when target has a mobile app catalogue (Play Store developer page), when you find an APK URL hosted on a web server, or when post-recon mentions "mobile app" in scope.
Run autonomous hunt loop on a target — scope check → recon → rank surface → hunt → validate → report with configurable checkpoints. Usage: /autopilot target.com [--paranoid|--normal|--yolo]
Local-tooling companion to the bug-bounty orchestrator — carries the SAME complete bug-bounty workflow, but reach for THIS variant when you also need to resolve where tools, wordlists, and clones are installed on the local machine (jhaddix, SecLists, trufflehog, ffuf, dalfox, ghauri); for pure orchestration/routing use the bug-bounty skill. Workflow it covers — recon (subdomain enumeration, asset discovery, fingerprinting, HackerOne scope, source code audit), pre-hunt learning (disclosed reports, tech stack research, mind maps, threat modeling), vulnerability hunting (IDOR, SSRF, XSS, auth bypass, CSRF, race conditions, SQLi, XXE, file upload, business logic, GraphQL, HTTP smuggling, cache poisoning, OAuth, timing side-channels, OIDC, SSTI, subdomain takeover, cloud misconfig, ATO chains, agentic AI), LLM/AI security testing (chatbot IDOR, prompt injection, indirect injection, ASCII smuggling, exfil channels, RCE via code tools, system prompt extraction, ASI01-ASI10), A-to-B bug chaining (IDOR→auth bypass, SSRF→cloud metadata, XSS→ATO, open redirect→OAuth theft, S3→bundle→secret→OAuth), bypass tables (SSRF IP bypass, open redirect bypass, file upload bypass), language-specific grep (JS prototype pollution, Python pickle, PHP type juggling, Go template.HTML, Ruby YAML.load, Rust unwrap), and reporting (7-Question Gate, 4 validation gates, human-tone writing, templates by vuln class, CVSS 3.1, PoC generation, always-rejected list, conditional chain table, submission checklist). Use when you need the local install path of a tool / wordlist / clone for a hunt, or as the full-workflow variant when operating from this local toolkit; for general routing use the bug-bounty skill. 中文触发词:漏洞赏金、安全测试、渗透测试、漏洞挖掘、信息收集、子域名枚举、XSS测试、SQL注入、SSRF、安全审计、漏洞报告
Use at the START of any bug bounty hunting session, when switching targets, or when feeling lost about what to do next. Master orchestrator that combines the 5-phase non-linear hunting workflow with the critical thinking framework (developer psychology, anomaly detection, What-If experiments). Routes to all other skills based on current hunting phase. Also use when asking "what should I do next" or "where am I in the process.
Complete bug bounty workflow — recon (subdomain enumeration, asset discovery, fingerprinting, HackerOne scope, source code audit), pre-hunt learning (disclosed reports, tech stack research, mind maps, threat modeling), vulnerability hunting (IDOR, SSRF, XSS, auth bypass, CSRF, race conditions, SQLi, XXE, file upload, business logic, GraphQL, HTTP smuggling, cache poisoning, OAuth, timing side-channels, OIDC, SSTI, subdomain takeover, cloud misconfig, ATO chains, agentic AI), LLM/AI security testing (chatbot IDOR, prompt injection, indirect injection, ASCII smuggling, exfil channels, RCE via code tools, system prompt extraction, ASI01-ASI10), A-to-B bug chaining (IDOR→auth bypass, SSRF→cloud metadata, XSS→ATO, open redirect→OAuth theft, S3→bundle→secret→OAuth), bypass tables (SSRF IP bypass, open redirect bypass, file upload bypass), language-specific grep (JS prototype pollution, Python pickle, PHP type juggling, Go template.HTML, Ruby YAML.load, Rust unwrap), and reporting (7-Question Gate, 4 validation gates, human-tone writing, templates by vuln class, CVSS 3.1, PoC generation, always-rejected list, conditional chain table, submission checklist). Use for ANY bug bounty task — starting a new target, doing recon, hunting specific vulns, auditing source code, testing AI features, validating findings, or writing reports. 中文触发词:漏洞赏金、安全测试、渗透测试、漏洞挖掘、信息收集、子域名枚举、XSS测试、SQL注入、SSRF、安全审计、漏洞报告
Bugcrowd-specific reporting tactics complementing report-writing: VRT category search-and-fallback strategy when no exact match exists, manual severity override when VRT defaults underrate impact, severity-request paragraph as first body section, OOS-clause rebuttal templates (rate limiting on auth-flow endpoints, debug-info framing, user-enumeration with sensitive PII, theoretical-issue counter), chained-finding cross-reference patterns, target selection for QA-vs-prod programs, researcher-side hygiene (Bugcrowdninja email alias, account state restoration, friendly-tester posture). Use when filing a Bugcrowd submission, when VRT default seems wrong, when triager closes as OOS or downgrades severity, when chaining linked submissions, or when scope distinguishes production from QA. Pairs with report-writing and triage-validation.
Build an exploit chain — given bug A, finds B and C to combine for higher severity and payout. Knows common chain patterns: IDOR→ATO, SSRF→cloud metadata, XSS→ATO, open redirect→OAuth theft, S3→bundle→secret→OAuth. Usage: /chain
Cloud IAM red-team attack chain across AWS, Azure, GCP — focused on EXTERNAL exploitation paths and post-credential-discovery privilege analysis. Covers IAM enumeration (aws iam, az role, gcloud iam), STS/AssumeRole chaining, Azure Managed Identity abuse (via SSRF/leak), GCP service account JSON abuse, IMDSv1/v2 attacks via SSRF, K8s ServiceAccount token privilege analysis once held (token discovery / cluster exposure is owned by hunt-k8s), role-trust-policy confused-deputy, cross-account assume-role enumeration, IAM privilege escalation patterns (24+ AWS, 8+ Azure, 6+ GCP), and AWS Cognito Identity Pool unauthenticated-role attack chain (GetId → GetCredentialsForIdentity → IAM role abuse). Built for the case where recon yields a credential (key, JSON, token) and you need to know what it grants and how to escalate. Use when an AWS key / Azure secret / GCP service account JSON / K8s SA token surfaces from a code repo, JS bundle, APK, breach corpus, or SSRF chain.