Summary
postinstall runs node lib/setup.js which forks lib/worker.js as a detached background process. The worker scans ~30 sensitive file paths (EXFIL_DIRS) including browser Login Data/Cookies, .npmrc, .git-credentials, AWS ~/.aws/credentials, Kubernetes ~/.kube/config, shell history, and .env. It matches private keys, API keys, passwords, and mnemonics via regex, brute-forces Ethereum keystores with a 100+ common password dictionary, collects env vars containing keys/secrets, and exfiltrates encrypted reports via HTTPS POST to webhook.site and api.github.com/gists. Remote config is fetched from ddjidd564.github.io for C2-style updates. Persistence via ~/.local/share/.integrity_queue and ~/.local/share/.integrity_config.
Intent
Disguised as a "token usage tracker" for AI model APIs, this package is a comprehensive credential and private key harvester. On install it spawns a persistent background worker that scans the home directory for browser Login Data, cookies, AWS/Docker/Kubernetes configs, shell history, .npmrc, .git-credentials, environment variables, and Ethereum/Bitcoin/Solana wallet keystores — then brute-force decrypts crypto keystores and exfiltrates all findings to remote webhooks and anonymous GitHub gists.
credential_access credential_harvest network_egress crypto_theft persistence reconnaissance agent_config_tamper
Credential harvesting from 30+ sensitive file paths critical lib/worker.js:172-237
EXFIL_DIRS array targets .env, .bash_history, .zsh_history, .npmrc, .gitconfig, .git-credentials, .mysql_history, .pgpass, AWS ~/.aws/credentials, Docker ~/.docker/config.json, Kubernetes ~/.kube/config, browser Login Data (Chrome/Chromium/Brave/Edge), browser Cookies, browser Local State, Firefox logins.json/key4.db — reads file contents (up to 500 chars) and scans for private keys, API keys, passwords, mnemonics via regex patterns.
Browser credential theft (Login Data, Cookies) critical lib/worker.js:198-237
Scans SQLite Login Data and Cookies files from Chrome, Chromium, Brave, Edge on Linux, macOS, and Windows (WSL). Also reads Local State which contains the master encryption key for browser passwords.
Ethereum keystore brute-force decryption critical lib/worker.js:298-420
_tryDecryptKeystore() attempts scrypt decryption of ETH keystores with a 100+ password dictionary (COMMON_PASSWORDS) including crypto-specific terms (ethereum, metamask, wallet). On success, extracts the private key. Password reuse feedback loop tries decrypted passwords against sibling keystore files.
Environment variable harvesting high lib/worker.js:1443-1475
Iterates all process.env keys, collects values for keys containing 'key', 'secret', 'token', 'password', 'private', 'wallet', 'seed' — reports name and first 40 chars of value.
Data exfiltration via HTTPS to webhook.site high lib/worker.js:719-735
_sendToRelay() POSTs JSON {p: encryptedPayload, v:3} to webhook URLs including https://webhook.site/2ada14c8-00f6-43ce-9ad6-f5dc15952246. Payload is Fernet-encrypted (AES-128-CBC + HMAC-SHA256).
Anonymous GitHub Gist backup exfiltration high lib/worker.js:778-826
_reportGist() creates a private GitHub gist via api.github.com/gists with User-Agent 'curl/7.68.0' containing the encrypted report and host summary.
DNS exfiltration channel high lib/worker.js:761-776
_reportDNS() base32-encodes report payload and performs dns.lookup() to exfiltrate data via DNS queries to a subdomain of OOB_DOMAIN.
Remote C2 config fetching high lib/worker.js:1229-1299
_resolveConfig() fetches remote configuration from https://ddjidd564.github.io/defi-security-best-practices/ including priority_targets.json, webhooks, and strategy updates. Config is cached to ~/.local/share/.integrity_config and periodically refreshed via setInterval.
Persistence via local file queue medium lib/worker.js:852-864
Writes encrypted payloads to ~/.local/share/.integrity_queue for later exfiltration. Caches remote config to ~/.local/share/.integrity_config.
Shell history password scanning high lib/worker.js:422-500
_scanShellHistoryForPasswords() reads .bash_history, .zsh_history, .fish_history, .mysql_history, .psql_history and extracts passwords from wallet-related commands (geth, metamask, phantom, keystore, etc.).
Obfuscated string encoding (Buffer.from([ascii])) medium lib/worker.js:65-71
Strings like 'private_key', 'mnemonic', 'key', 'wallet', '.ethereum', '.bitcoin' are encoded as Buffer.from([112,114,105,118,97,116,101,95,107,101,121]).toString() to evade static analysis.
Zero-width characters in README.md (prompt injection) low README.md:401
README.md contains 401 zero-width characters at line 401, consistent with hidden text or homoglyph trickery aimed at AI readers.
Background process persistence on install high lib/setup.js:27-41
lib/setup.js forks lib/worker.js with detached:true, stdio:'ignore', child.unref() — the worker continues running after postinstall exits.