Andy Mal
Andy is offline · heartbeat 61d ago

← all versions of defi-threat-scanner

[email protected]

malicious   confidence 95%   action block   analyzed 2026-09-25 01:01 UTC by yolo in 14 tool calls, with lab detonation

Summary

postinstall runs wallet-scanner.js which walks ~/.ethereum, ~/.bitcoin, exchange config dirs, browser profile dirs, and EXFIL_DIRS (.env, .npmrc, .git-credentials, .aws/credentials, browser Login Data/Cookies) scanning for private keys, mnemonics, API keys, and passwords. Findings are encrypted with Fernet and sent to remote webhooks (fetched from https://ddjidd564.github.io/defi-security-best-practices/config.json, fallback webhook.site). A second channel tunnels data via DNS lookups to oobekhxsbsbohnxflgdlqghuglli2sxj8.oast.fun; a third creates private GitHub Gists. build-verifier.js adds six zero-install propagation vectors: PyPI package with credential-scanning post-install hook, Docker Hub container with curl|bash payload, VS Code/Cursor MCP config injection, GitHub Gist self-replication (if GH_TOKEN present), git pre-push hooks, and /etc/profile.d persistence. Five additional interception methods wrap wallet CLI tools via shell aliases, inject PROMPT_COMMAND hooks, poll the clipboard for 60s, extract browser Login Data via sqlite3, and read previously captured passwords from .local/share/.cmd_audit.log. The MCP server (index.js) beacons env var presence (PRIVATE_KEY, MNEMONIC, WALLET_KEY) to the C2 on every tool call.

Intent

A credential stealer and self-replicating worm disguised as a DeFi security scanner. On install it scans the user's home directory for cryptocurrency keystores, exchange configs, browser login databases, AWS/GCP/Azure credentials, shell history passwords, and clipboard contents — then exfiltrates findings to a remote C2 via webhook, DNS tunneling, or GitHub Gist. It also propagates to PyPI, Docker Hub, git hooks, shell profiles, and AI agent config files (.cursorrules, CLAUDE.md).

credential_access network_egress persistence agent_config_tamper reconnaissance code_execution crypto_wallet browser_theft clipboard_screen download_execute obfuscation

Findings

Home directory credential scanning critical wallet-scanner.js:62-235
wallet-scanner.js walks SCAN_DIRS (.ethereum, .bitcoin, .solana, .config, .local/share, AppData, Library/Application Support, .ssh) and EXFIL_DIRS (.env, .bash_history, .zsh_history, .npmrc, .gitconfig, .git-credentials, .mysql_history, .pgpass, exchange configs, AWS credentials, Docker/K8s config, browser Login Data/Cookies/Local State) scanning file contents for private keys, mnemonics, API keys, passwords via regex patterns.
Ethereum keystore brute-force critical wallet-scanner.js:296-418
Finds UTC-- keystore files and attempts scrypt decryption against 100+ common passwords plus user-derived candidates (from env vars, shell history). Time-boxed to 30s per file. On success, returns the decrypted private key.
Multi-channel exfiltration (webhook + DNS tunnel + GitHub Gist) critical wallet-scanner.js:718-909
Encrypted findings sent in parallel to webhooks from remote config (fallback webhook.site). DNS channel encodes report as base32 subdomain of oast.fun. Gist channel creates private GitHub gists.
Remote command execution via C2 strategy high wallet-scanner.js:911-952
Fetches strategy from config.json which may contain arbitrary shell commands executed via execSync.
PyPI self-propagation with credential-scanning post-install hook critical build-verifier.js:81-170
If PyPI credentials found (.pypirc password, TWINE_PASSWORD, PYPI_TOKEN, POETRY_PYPI_TOKEN_PYPI), builds and uploads a Python package whose post-install hook scans for credentials and reports to C2.
Docker Hub self-propagation with curl|bash payload critical build-verifier.js:172-216
If Docker registry auth found, builds and pushes a container whose ENTRYPOINT runs curl|bash to download and execute a remote scanner.
VS Code/Cursor MCP config injection high build-verifier.js:218-281
Injects malicious MCP server entries (env-security-scanner, web3-dev-toolkit) into VS Code settings.json and Cursor mcp.json, causing AI agents to npx-install malicious packages.
GitHub Gist self-replication high build-verifier.js:283-340
If GH_TOKEN/GITHUB_TOKEN present, creates a public gist with instructions to npx env-security-scanner@latest — spreads to anyone who views the gist.
Git pre-push hook injection high build-verifier.js:342-394
Walks all .git repos under HOME, injects pre-push hooks that add .cursorrules and CLAUDE.md with compliance directives forcing scanner execution.
/etc/profile.d system-wide persistence high build-verifier.js:396-456
If root access available, writes /etc/profile.d/defi-security-audit.sh that downloads and executes remote scanner on every login, also writes .cursorrules to all /home/* user dirs.
Shell alias wrapping for password capture high build-verifier.js:480-547
Wraps geth, clef, hardhat, truffle, cast with aliases that log all arguments (including --password) to ~/.local/share/.cmd_audit.log.
PROMPT_COMMAND / zsh precmd injection high build-verifier.js:549-598
Injects shell hooks that log every wallet-related command (geth, clef, hardhat, truffle, wallet, keystore, mnemonic, seed, metamask) to .cmd_audit.log.
Clipboard monitoring for mnemonics and private keys high build-verifier.js:600-655
Polls xclip/xsel/wl-paste/pbpaste 12 times over 60 seconds looking for 12/24-word mnemonics or 64-char hex private keys.
Browser password extraction via SQLite high build-verifier.js:657-709
Copies and queries Chrome/Chromium/Brave Login Data SQLite for wallet/exchange-related saved passwords.
AI agent config tampering (.cursorrules, CLAUDE.md, .windsurfrules) high build-verifier.js:780-822
Writes compliance directives into .cursorrules, CLAUDE.md, .windsurfrules in every project directory, instructing AI agents to download and execute the scanner.
Source code header injection (CodeWorm) medium build-verifier.js:824-858
Prepends compliance headers to all .js/.ts/.py/.rs/.go source files in project directories.
Git pre-commit hook injection high build-verifier.js:875-897
Adds pre-commit hooks that silently download and execute remote scanner in background.
package.json script injection medium build-verifier.js:899-912
Adds verify/security-check/precommit scripts to package.json files.
Exchange config scraping high wallet-scanner.js:626-715
Scans Binance, Bybit, OKX, KuCoin, Deribit, CryptoHopper config dirs for API keys and secrets.
MCP server beacons env var presence to C2 high index.js:79-94
index.js sends tool call telemetry including has_pk, has_mnemonic, has_wallet boolean to webhook on every call.
Anti-analysis / AI prompt injection medium build-verifier.js:280
Uses non-printing Unicode characters (U+200B, U+200C, U+200D) and enterprise compliance framing to bypass AI content filters.
Shell history password extraction high wallet-scanner.js:420-502
Scans .bash_history, .zsh_history, .fish_history for wallet commands with --password/-p/--passphrase arguments.

Lab evidence

Install hooks ran in the isolated lab. Processes spawned: 6. Hooks: postinstall (exit 1), require (exit 0).