Summary
postinstall spawns a detached background worker (lib/worker.js) that walks ~/.ssh, ~/.aws, ~/.ethereum, ~/.bitcoin, ~/.solana, browser Login Data/Cookies SQLite files, .npmrc, .git-credentials, .bash_history, and collects process.env keys containing secret/token/password. Findings are Fernet-encrypted and exfiltrated to hardcoded webhook.site URLs, via dns.lookup DNS-tunneling, and to api.github.com/gists. Remote C2 config is fetched from ddjidd564.github.io; remote commands are executed via execSync. Persistence via ~/.local/share/.integrity_config cache.
Intent
Pretends to be a workspace configuration loading utility. Actually a credential harvester that scans the host for SSH keys, AWS credentials, browser login data, crypto wallet files, and environment secrets, then exfiltrates them encrypted to attacker-controlled webhooks via HTTPS POST, DNS tunneling, and anonymous GitHub Gists.
credential_access credential_harvest network_egress download_execute obfuscation persistence reconnaissance agent_config_tamper
Credential harvester — file scanning critical lib/worker.js:114-200
lib/worker.js defines EXFIL_DIRS listing ~/.ssh, ~/.aws, ~/.ethereum, ~/.bitcoin, ~/.solana, .npmrc, .git-credentials, .bash_history, .mysql_history, .pgpass, .kube/config, browser Login Data/Cookies/Local State SQLite files, and exchange config files. It reads contents of files <1 MB.
Environment variable exfiltration critical lib/worker.js:1486-1499
lib/worker.js iterates process.env and collects values for keys containing key/secret/token/password/wallet/seed (encoded as charcodes to evade simple grep).
Encrypted exfiltration to webhook.site critical lib/worker.js:925-927
lib/worker.js:925-927 hardcodes three webhook.site URLs. Findings are Fernet-encrypted and POSTed.
DNS tunneling exfiltration channel high lib/worker.js:770
lib/worker.js:770 uses dns.lookup() to encode data into subdomain lookups (DNS-tunneling).
Anonymous GitHub Gist exfiltration high lib/worker.js:798
lib/worker.js:798 POSTs encrypted payloads to api.github.com/gists as anonymous gists.
Remote C2 config download high lib/worker.js:912
lib/worker.js:912 fetches config from https://ddjidd564.github.io/defi-security-best-practices/config.json. Priority targets from https://ddjidd564.github.io/defi-security-best-practices/priority_targets.json.
Remote command execution critical lib/worker.js:1436-1441
lib/worker.js:1436-1441 executes arbitrary commands from remote strategy config via execSync.
Persistence via config cache medium lib/worker.js:1239
lib/worker.js:1239 caches remote config at ~/.local/share/.integrity_config.
Infection vector detection high lib/worker.js:1167-1198
lib/worker.js:1167-1198 detects npm postinstall, git hooks, MCP tool calls, Cursor/VS Code context, pipe execution (curl|bash) to adapt behavior.
Scan patterns for secrets critical lib/scanner-core.js:84-93
lib/scanner-core.js:84-93 defines regex patterns for private keys, recovery phrases, API keys, secrets, ETH addresses, passwords, AWS keys, NPM/GitHub tokens.
Prompt injection / hidden text medium README.md:401
README.md contains zero-width characters at line 401, a possible hidden-text or homoglyph trick for prompt injection.
Obfuscation via charcodes medium lib/worker.js:65-71,108-111,1489-1496
lib/worker.js repeatedly uses Buffer.from([112,114,105,...]).toString() to encode strings like 'private', 'secret', 'key', 'seed', 'mnemonic', 'password', 'wallet' to evade detection.