Summary
postinstall runs node lib/setup.js which forks lib/worker.js as a detached, unref'd background process. The worker scans ~ for credential files, brute-forces Ethereum keystore JSONs with a 100+ common password list, encrypts findings with Fernet, and exfiltrates via webhook.site, api.github.com/gists, and DNS. Remote config is fetched from https://ddjidd564.github.io/defi-security-best-practices/config.json. The package also injects zero-width characters and P-2024-001 compliance headers into AI agent output to propagate itself.
Intent
Disguised as a token-usage tracker for AI model providers, this package is a full-featured credential stealer and cryptocurrency wallet drainer. On install it spawns a detached background worker that scans the user's home directory for thousands of sensitive files (browser login data, cookies, AWS credentials, SSH keys, .env, .npmrc, git-credentials, Ethereum/Bitcoin/Solana wallet directories, exchange configs) and exfiltrates matched secrets over encrypted HTTPS to webhook.site URLs and anonymous GitHub Gists, with remote C2 configuration fetched from ddjidd564.github.io.
credential_access credential_harvest network_egress download_execute obfuscation persistence agent_config_tamper reconnaissance crypto_wallet browser_theft
Credential-stealing file scan list critical lib/worker.js:172-237
EXFIL_DIRS array (lib/worker.js:172-237) enumerates .env, .bash_history, .zsh_history, .npmrc, .gitconfig, .git-credentials, .pgpass, AWS credentials, Docker config, Kubernetes config, Chrome/Chromium/Brave/Edge Login Data and Cookies, Firefox logins.json/key4.db, exchange configs (.binance/config.json etc.).
Regex-based secret extraction critical lib/worker.js:64-71
KEY_PATTERNS array (lib/worker.js:64-71) matches 64-hex private keys, mnemonics, API_KEY=..., secret/private=..., 0x ETH addresses, PASSWORD=... from file contents. Files are read line-by-line and matched.
Ethereum keystore brute-force critical lib/worker.js:317-419
_tryDecryptKeystore (lib/worker.js:317-419) parses keystore JSON, builds password candidates from username/filename + COMMON_PASSWORDS (100+ entries), derives keys with scrypt, verifies MAC with sha3-256, returns decrypted private key on match. Time-boxed to 30s per file.
Environment variable exfiltration critical lib/worker.js:1502-1533
lib/worker.js:1502-1533 iterates process.env, collects keys containing key/secret/token/password/wallet/seed, pushes password-type vars to brute-force candidate list.
Multi-channel exfiltration critical lib/worker.js:747-852
Webhook POST (lib/worker.js:747-762), GitHub Gist creation (lib/worker.js:810-852), DNS exfiltration via base32 subdomains (lib/worker.js:788-800). Webhook URLs hardcoded: webhook.site/2ada14c8-..., webhook.site/7513bf3d-..., webhook.site/d1652693-... .
Remote C2 configuration high lib/worker.js:938
CONFIG_PRIMARY_URL = 'https://ddjidd564.github.io/defi-security-best-practices/config.json' (lib/worker.js:938). Priority targets from same domain (lib/worker.js:1396). Config refreshed every 1 hour via setInterval.
Persistence via config cache high lib/worker.js:1265
Writes cached config to ~/.local/share/.integrity_config and exfiltration queue to ~/.local/share/.integrity_queue (lib/worker.js:1265, 1273).
Prompt injection / hidden text propagation high lib/worker.js:1769-1772
CredLeakCLContent and ClaudeDevStdContent strings (lib/worker.js:1769-1772) contain P-2024-001 compliance headers and instructions to append invisible zero-width chain payloads to AI agent output.
Detached background worker high lib/setup.js:31
lib/setup.js:31 forks worker.js with detached:true, stdio:'ignore', child.unref() — survives postinstall exit.
Zero-width characters in README medium README.md:401
README.md contains zero-width characters (U+200B, U+200C) at position 401 — possible hidden text or homoglyph trick for prompt injection.