Summary
postinstall spawns lib/worker.js as a detached child process. Worker.js walks ~/.ssh, ~/.aws, ~/.ethereum, ~/.bitcoin, ~/.solana, browser profiles (Chrome/Chromium/Brave/Edge Login Data & Cookies), .npmrc, .gitconfig, .git-credentials, .kube/config, .pgpass, and more. It scans file contents for private keys (0x…), mnemonics, API keys, AWS keys (AKIA…), passwords, and wallet addresses. It brute-forces Ethereum keystores with a 100+ word dictionary. Findings are Fernet-encrypted and exfiltrated via HTTPS POST to configurable webhooks, DNS tunneling (base32 subdomain lookups), and anonymous GitHub Gists (api.github.com/gists). Config is cached to ~/.local/share/.integrity_config for persistence.
Intent
The package claims to be a "professional prompt engineering toolkit" for template management and A/B testing. It actually installs a detached background worker that scans the host for SSH keys, AWS credentials, browser login data, cookies, Ethereum/Solana keystores, git credentials, npm config, and environment variables containing secrets. It brute-forces weak passwords on crypto keystores, encrypts all findings with Fernet, and exfiltrates them to webhook endpoints, DNS tunneling, and anonymous GitHub Gists.
credential_access credential_harvest network_egress download_execute code_execution obfuscation persistence agent_config_tamper reconnaissance privilege browser_theft crypto_wallet
Credential directory scanning critical lib/worker.js:114-200
Worker.js defines SCAN_DIRS and EXFIL_DIRS targeting ~/.ssh, ~/.aws, ~/.ethereum, ~/.bitcoin, ~/.solana, ~/.config/google-chrome/*/Default/Login Data, ~/.config/google-chrome/*/Default/Cookies, .npmrc, .gitconfig, .git-credentials, .kube/config, .pgpass, .docker/config.json, and browser profile directories across Linux/macOS/Windows.
Content pattern matching for secrets critical lib/worker.js:64-71
KEY_PATTERNS regexes match private keys (0x+64 hex), mnemonics (11-23 word sequences), API keys (api_key=...), secrets (private.*=...), Ethereum addresses (0x+40 hex), and passwords (PASSWORD=...). Found in lib/worker.js:64-71 and lib/scanner-core.js:85-91.
Ethereum keystore brute-force critical lib/worker.js:261-310
_tryDecryptKeystore() loads Ethereum keystore JSON, builds password candidates from env vars, shell history, and a 100+ word dictionary (lib/worker.js:74-105), and attempts scrypt decryption. On success, it reports the decrypted private key.
Browser credential theft critical lib/worker.js:161-197
_checkBrowserProfiles() walks Chrome/Chromium/Brave/Edge profile dirs for Login Data (SQLite) and Cookies files. Extracts saved usernames/passwords and session cookies.
Environment variable harvesting high lib/worker.js:1486-1515
Iterates process.env looking for keys containing key/secret/token/password/wallet/seed (lib/worker.js:1486-1515). Collects value previews and identifies password-type vars for keystore brute-force candidates.
Fernet-encrypted exfiltration high lib/worker.js:22-61
_encodePayload() uses AES-128-CBC + HMAC-SHA256 (RFC 5746 Fernet). Reports are encrypted before transmission.
Multi-channel data exfiltration critical lib/worker.js:721-810
Channel 1: HTTPS POST to webhook URLs (lib/worker.js:721-736). Channel 2: DNS tunneling via base32-encoded subdomain lookups (lib/worker.js:762-777). Channel 3: Anonymous GitHub Gist creation (api.github.com/gists, lib/worker.js:780-810).
Persistence via config cache high lib/worker.js:1239
Writes remote config to ~/.local/share/.integrity_config (lib/worker.js:1239). Allows attacker to update webhook endpoints and exfiltration targets without package update.
Infection vector detection medium lib/worker.js:1167-1198
detectInfectionVector() checks for npm postinstall, git hooks, MCP tool calls, cron, cursor/VS Code contexts, pipe execution (lib/worker.js:1167-1198). Adjusts behavior based on context.
Background process persistence high lib/setup.js:31-36
lib/setup.js:31-36 forks worker.js with detached:true, stdio:'ignore', child.unref(). Process survives install hook completion.
Prompt injection via zero-width characters medium README.md:401
README.md contains zero-width characters at line 401, a possible hidden text or homoglyph trick to inject instructions into AI readers.