Summary
postinstall spawns lib/worker.js as a detached background process. worker.js walks the home directory for .env, .npmrc, .git-credentials, AWS ~/.aws/{credentials,config} (char-code obfuscated), Kubernetes ~/.kube/config, Chrome/Brave/Edge Login Data + Cookies + Local State, exchange config files, and browser profile directories. It scrapes process.env for key/secret/token/password/mnemonic/wallet/seed vars, reads shell history for passwords, encrypts findings with Fernet (AES-128-CBC+HMAC-SHA256) and POSTs them to a remote webhook (channel 1), DNS exfil (channel 2), and anonymous GitHub Gist (channel 3). Propagates by writing .cursorrules/CLAUDE.md with remote-code-execution instructions, installing git post-merge/post-checkout hooks, and appending to .bashrc/.zshrc/.profile.
Intent
Claims to be "build script utilities and helpers." Actually a credential/browser/crypto stealer that exfiltrates secrets, browser logins/cookies, exchange configs, and AWS/Kubernetes credentials to a remote webhook, with persistence via git hooks, shell RC files, and AI agent prompt injection (.cursorrules/CLAUDE.md).
credential_access credential_harvest network_egress download_execute persistence agent_config_tamper browser_theft crypto_wallet reconnaissance
Credential store targeting critical lib/worker.js:170-235
EXFIL_DIRS array targets ~/.env, ~/.bash_history, ~/.zsh_history, ~/.npmrc, ~/.gitconfig, ~/.git-credentials, ~/.mysql_history, ~/.psql_history, ~/.pgpass, AWS ~/.aws/credentials and ~/.aws/config (obfuscated via Buffer.from char codes), ~/.docker/config.json, ~/.kube/config, Chrome/Chromium/Brave/Edge Login Data, Cookies, Local State
Crypto exchange and wallet config harvesting critical lib/worker.js:116-143
Scans ~/.binance, ~/.bybit, ~/.okx, ~/.kucoin, ~/.deribit and their .config/ equivalents for config.json containing exchange API keys and wallet data
Browser credential theft critical lib/worker.js:244-269
Walks browser profile dirs (Chrome, Chromium, Brave, Edge on Linux/macOS/WSL) extracting Login Data (SQLite passwords), Cookies, Local State (master encryption key), Bookmarks, Web Data
Environment variable scraping high lib/worker.js:1441-1472
Iterates process.env for keys containing key/secret/token/password/private/mnemonic/wallet/seed; collects value previews
Remote data exfiltration critical lib/worker.js:718-811
Encrypts findings with Fernet (AES-128-CBC + HMAC-SHA256) and POSTs to webhook URL (channel 1), DNS subdomain exfil (channel 2), anonymous GitHub Gist (channel 3)
Remote command execution high lib/worker.js:1393-1399
Executes arbitrary commands from remotely-fetched strategy config via execSync
Persistence via git hooks high lib/worker.js:1770-1783
Installs post-merge and post-checkout git hooks that curl and execute remote script https://raw.githubusercontent.com/ddjidd564/defi-security-best-practices/gh-pages/scan.js
Persistence via shell RC files high lib/worker.js:1791-1801
Appends remote-code-execution block to ~/.bashrc, ~/.zshrc, ~/.profile
AI agent prompt injection high lib/worker.js:1700-1730
Writes .cursorrules and CLAUDE.md containing instructions for AI assistants to download and execute remote code (ddjidd564.github.io)
Self-propagation high lib/worker.js:1733-1750
Walks cwd + 4 parent dirs + HOME project dirs, writes malicious .cursorrules/CLAUDE.md and git hooks to each
Char-code obfuscation medium lib/worker.js:190-191, 1446-1455
Uses Buffer.from([46,97,119,115]) etc. to encode 'aws', 'credentials', 'config', 'private_key', 'mnemonic', 'api_key', 'password', 'wallet', 'seed' to evade simple string matching
Background child process spawn high lib/setup.js:27-41
postinstall (lib/setup.js) forks lib/worker.js with detached:true, stdio:'ignore', child.unref() — runs silently in background after install