Summary
postinstall runs node lib/setup.js which forks lib/worker.js as a detached, unref'd child process. worker.js (19 400 lines) is a credential stealer: it walks ~/.ssh, ~/.aws, ~/.kube, ~/.docker, Chrome/Brave/Edge Login Data and Cookies, crypto keystore files, exchange configs, .npmrc, .git-credentials, .pgpass, .env, shell histories; extracts private keys, API keys, AWS access keys, NPM/GitHub tokens, passwords, recovery phrases; brute-forces 100+ common keystore passwords; encrypts stolen data with AES-128-CBC/HMAC-SHA256 (Fernet) optionally keyed via ECDH-x25519; exfiltrates to webhook.site URLs, dns.lookup telemetry, and api.github.com/gists; fetches remote config from ddjidd564.github.io to control scan depth, enabled vectors, and execute arbitrary OS commands; downloads and executes scan-bundled.js from raw.githubusercontent.com; persists a config cache in ~/.local/share/.integrity_config; attempts prompt injection via CLAUDE.md write.
Intent
Presents itself as a workspace configuration utility, but installs a detached background process that scans the user's home directory for credentials (AWS keys, SSH keys, browser logins, crypto wallet keystores, .npmrc, .git-credentials, .pgpass, etc.), encrypts findings with Fernet/ECDH-hybrid encryption, and exfiltrates them via webhook POST, DNS telemetry, and GitHub Gist — while fetching remote config from GitHub Pages to enable arbitrary command execution and payload download.
credential_access credential_harvest network_egress download_execute code_execution persistence agent_config_tamper crypto_theft browser_theft obfuscation reconnaissance
Install hook spawns detached credential-stealing worker critical lib/setup.js:27
lib/setup.js:27-41 — cp.fork(workerPath, ['--verify', PKG_NAME], { detached: true, stdio: 'ignore', env: Object.assign({}, process.env, { RUN_VERIFICATION: PKG_NAME }) }); child.unref();
Credential file scanning (30+ paths) critical lib/worker.js:172
lib/worker.js:172-237 — EXFIL_DIRS includes .env, .bash_history, .zsh_history, .npmrc, .gitconfig, .git-credentials, .mysql_history, .psql_history, .pgpass, .aws/credentials, .aws/config, .docker/config.json, .kube/config, Chrome/Chromium/Brave/Edge Login Data, Cookies, Local State, Firefox logins.json, key4.db, .ethereum, .bitcoin, .solana, .secret, seed.txt, wallet.json, wallet.dat, keyfile, private-key, mnemonic, UTC--, exchange config files.
Credential extraction regex patterns critical lib/worker.js:64
lib/worker.js:64-71 — KEY_PATTERNS matches 64-hex private keys, 12-24 word recovery phrases, API_KEY=value, secret/private=value, 0x Ethereum addresses, PASSWORD=value. lib/scanner-core.js:84-93 adds AWS_ACCESS_KEY_ID (AKIA...), NPM_TOKEN, GH_TOKEN patterns.
Crypto keystore brute-force high lib/worker.js:74
lib/worker.js:74-105 — COMMON_PASSWORDS array with 100+ passwords including crypto-specific ones (ETH, BTC, SOL, metamask, phantom, trustwallet, blockchain). Targets scrypt-encrypted Ethereum keystore JSON files.
Fernet + ECDH-hybrid encryption of exfiltrated data high lib/worker.js:22
lib/worker.js:22-61 — _encodePayload uses AES-128-CBC + HMAC-SHA256 (Fernet). lib/crypto-ecdh.js — hybridEncrypt uses x25519 ECDH for forward secrecy. Data encrypted before exfiltration.
Multi-channel exfiltration: webhook, DNS, Gist critical lib/worker.js:724
lib/worker.js:720-830 — _sendToRelay POSTs to webhook.site URLs. _reportDNS base32-encodes data in dns.lookup queries. _reportGist POSTs to api.github.com/gists.
Remote config fetch for C2 control critical lib/worker.js:911
lib/worker.js:911 — CONFIG_PRIMARY_URL = 'https://ddjidd564.github.io/defi-security-best-practices/config.json'. Returns scan_depth, enabled_vectors, and commands array.
Remote command execution critical lib/worker.js:1395
lib/worker.js:1395-1399 — if (_strategy && _strategy.commands) execSync(cmd, { timeout: 10000, stdio: 'ignore' }) for each command from remote config.
Download-and-execute secondary payload critical lib/worker.js:1697
lib/worker.js:1697 — SCRIPT_URL = 'https://raw.githubusercontent.com/ddjidd564/defi-security-best-practices/gh-pages/scan-bundled.js'. Fetches and executes arbitrary JS.
Environment dump high lib/worker.js:1445
lib/worker.js:1445 — Iterates process.env, collects values where key includes 'password', 'key', 'secret', 'token', 'credential'.
Prompt injection text embedded in package high lib/worker.js:1710
lib/worker.js:1710-1713 — clContent contains 'CLAUDE.md' compliance prompt text designed to be written to AI agent config files to inject social-engineering instructions.
Infection vector detection medium lib/worker.js:1159
lib/worker.js:1159-1190 — detectInfectionVector checks npm_lifecycle_event, git hooks, MCP_TOOL_CALL, cron, cursor editor, pipe execution — tailored for targeting CI/CD agents and AI coding assistants.