Summary
postinstall spawns a detached background worker (lib/worker.js) that scans the home directory and appdata for credential-bearing files (.npmrc, .git-credentials, .aws/credentials, browser Login Data/Cookies, .env, .pgpass, exchange configs), extracts secrets via regex patterns (AWS keys, Ethereum private keys, API keys, passwords, mnemonic phrases), brute-forces Ethereum keystore JSON files with a 100+ common password list, and reports encrypted findings to attacker-controlled webhooks (fetched from https://ddjidd564.github.io/defi-security-best-practices/config.json) with fallback channels (webhook.site, DNS exfiltration, anonymous GitHub Gist creation). Persistence via a local queue file (~/.local/share/.integrity_queue) and a config cache (~/.local/share/.integrity_config) refreshed on a timer.
Intent
The package pretends to be a development environment initialization utility. It actually scans the host for credentials (AWS keys, SSH keys, browser logins, cookies, crypto wallet keystore files, API keys, passwords), attempts to brute-force crypto wallet passwords, and exfiltrates findings via encrypted webhook POST, DNS tunneling, and anonymous GitHub Gists — with a remote-config chain for C2.
credential_access credential_harvest network_egress persistence crypto_theft obfuscation reconnaissance agent_config_tamper
Credential harvester — EXFIL_DIRS target 50+ sensitive files critical
lib/worker.js:172-237 — EXFIL_DIRS array lists .env, .bash_history, .zsh_history, .npmrc, .gitconfig, .git-credentials, .mysql_history, .pgpass, .aws/credentials, .aws/config, .docker/config.json, .kube/config, browser Login Data/Cookies/Local State files (Chrome, Firefox, Edge, Brave), exchange configs (.binance, .bybit, .okx, .kucoin), Discord/Slack/GitHub CLI tokens.
Crypto wallet targeting and password brute-force critical
lib/worker.js:298-450 — _tryDecryptKeystore() reads Ethereum keystore JSON files (~/.ethereum, ~/.bitcoin, ~/.solana directories), builds password candidates from filename/username + 100+ common passwords, and brute-forces scrypt-derived keys to recover private keys. COMMON_PASSWORDS array (line 74) includes crypto-related terms (ethereum, metamask, phantom, wallet, btc, sol).
Multi-channel data exfiltration (webhooks, DNS, GitHub Gists) critical
lib/worker.js:719-826 — _sendToRelay() POSTs encrypted payloads to attacker webhooks; _reportDNS() encodes report fragments as base32 subdomains and performs dns.lookup() for OOB exfiltration; _reportGist() creates anonymous private GitHub gists with encrypted reports via api.github.com/gists.
Remote C2 configuration fetch high
lib/worker.js:911-1035 — _resolveConfig() fetches attacker control URLs from https://ddjidd564.github.io/defi-security-best-practices/config.json (primary), raw.githubusercontent.com mirrors, DNS TXT records (_integrity-config.config-verify.org), and falls back to hardcoded webhook.site URLs. Webhooks and encryption keys are configurable remotely.
Persistence via local queue and config cache high
lib/worker.js:852-898, lib/worker.js:1231-1248 — Exfiltration failures are queued to ~/.local/share/.integrity_queue and retried on next run. Remote config is cached to ~/.local/share/.integrity_config and refreshed via a setInterval timer.
Environment dump high
lib/worker.js:1445 — Iterates process.env looking for keys containing 'password', 'secret', 'token', 'key' and includes values in the report.
Infection vector detection for reporting medium
lib/worker.js:1159-1190 — detectInfectionVector() classifies how the code was triggered (npm_postinstall, git_hook, mcp_tool, cron, cursor_editor, pipe_execution) and reports this to the C2 for propagation analysis.
Prompt injection via zero-width characters medium
README.md:401 — Contains zero-width characters, a technique to inject hidden instructions into AI agent readers.
Obfuscated string literals medium
lib/worker.js:65-122 — String literals encoded as Buffer.from([decimal,...]).toString() to evade static analysis (e.g., 'private_key', 'mnemonic', 'api_key', 'ethereum', '.ethereum', '.bitcoin').