Summary
The postinstall hook spawns lib/worker.js as a detached child process. The worker scans the home directory for credential stores (.npmrc, .git-credentials, .aws/credentials, .kube/config, browser Login Data/Cookies, crypto wallet files), brute-forces common passwords against Ethereum keystores, encodes findings with Fernet (AES-128-CBC), and exfiltrates them via encrypted webhook POST, DNS exfiltration, and anonymous GitHub Gists. It also propagates by writing .cursorrules, CLAUDE.md, git hooks, and shell RC files that re-download and execute the payload. Remote config is fetched from ddjidd564.github.io to update webhook targets.
Intent
Pretends to be a "prompt engineering toolkit" for template management and A/B testing. Actually a credential harvester that exfiltrates API keys, browser passwords/cookies, crypto wallet files, cloud credentials, and environment secrets to remote webhooks, with self-propagation via AI agent config files, git hooks, and shell RC files.
credential_access credential_harvest network_egress download_execute persistence agent_config_tamper reconnaissance crypto_theft browser_theft
Credential harvester — exfil dirs critical lib/worker.js:170-235
EXFIL_DIRS array lists ~/.env, ~/.bash_history, ~/.zsh_history, ~/.npmrc, ~/.gitconfig, ~/.git-credentials, ~/.mysql_history, ~/.psql_history, ~/.pgpass, exchange configs (~/.binance/config.json etc.), AWS (~/.aws/credentials, ~/.aws/config), Docker (~/.docker/config.json), Kubernetes (~/.kube/config), browser Login Data/Cookies/Local State for Chrome/Chromium/Brave/Edge.
Crypto wallet and keystore targeting critical lib/worker.js:72-113
SCAN_DIRS includes ~/.ethereum, ~/.bitcoin, ~/.solana; COMMON_PASSWORDS includes crypto-specific entries (ETH, BTC, SOL, metamask, phantom, trustwallet, keystore, walletpass). Keystore brute-force via scrypt decryption is implemented.
Multi-channel encrypted exfiltration critical lib/worker.js:718-847
_sendToRelay POSTs Fernet-encrypted payloads to webhooks. _reportDNS encodes data as base32 subdomains for DNS exfiltration. _reportGist creates anonymous private GitHub gists. _sendToReceiver sends via direct TLS.
Remote C2 config fetch high lib/worker.js:909,995
Config fetched from https://ddjidd564.github.io/defi-security-best-practices/config.json contains webhook URLs, encryption keys, strategy vectors. Refreshed every hour via timer.
Self-propagation — AI agent config files high lib/worker.js:1685-1760
_propagate() writes .cursorrules and CLAUDE.md to project dirs and HOME subdirectories with embedded instructions to re-download and execute the payload (scan.js from raw.githubusercontent.com).
Self-propagation — git hooks high lib/worker.js:1738-1757
Appends curl|bash payload execution to .git/hooks/post-merge and post-checkout if hooks directory exists.
Self-propagation — shell RC files high lib/worker.js:1761-1775
Appends background curl|node payload to ~/.bashrc, ~/.zshrc, ~/.profile.
Zero-width steganography for AI-to-AI propagation high lib/worker.js:1813-1865
_encodeZeroWidth/_embedZeroWidthInFile encode payloads into text files using ZWSP+ZWJ/ZWNJ+LTRM protocol for invisible AI-to-AI chain propagation.
Environment dump on child spawn high lib/setup.js:34
setup.js:34 spawns worker with env: Object.assign({}, process.env, { RUN_VERIFICATION: PKG_NAME }) — full environment including API keys is passed to the detached process.
Disguised as legitimate package medium package.json:4
Package.json description: 'Professional prompt engineering utilities — template management, version control, A/B testing'. Actual behavior is credential theft and persistence.