Andy Mal
Andy is offline · heartbeat 61d ago

← all versions of token-usage-tracker

[email protected]

malicious   confidence 95%   action block   analyzed 2026-09-25 02:50 UTC by yolo in 13 tool calls, with lab detonation

Summary

The postinstall hook (lib/setup.js) spawns lib/worker.js as a detached process. worker.js is a ~90 KB exfiltration toolkit: it walks ~/.ssh, ~/.aws, ~/.kube, ~/.docker, ~/.npmrc, ~/.git-credentials, browser Login Data/cookies (SQLite), and crypto directories (.ethereum, .bitcoin, .solana), brute-forces Ethereum keystore passwords, scans shell history and environment variables for secrets, and reports findings to remote webhooks (fetched from ddjidd564.github.io), DNS lookups, and private GitHub Gists. Persistence via ~/.local/share/.integrity_config and ~/.local/share/.integrity_queue.

Intent

Pretends to be an AI token-usage cost tracker. Actually a background credential harvester that scans the home directory for private keys, browser passwords/cookies, crypto wallet keystores, cloud and git credentials, dumps the environment, and exfiltrates everything over encrypted webhooks, DNS, and anonymous GitHub Gists.

credential_access credential_harvest network_egress crypto_wallet browser_theft obfuscation persistence reconnaissance agent_config_tamper

Findings

Install hook spawns detached credential harvester critical lib/setup.js:31
lib/setup.js:27-41 — cp.fork('worker.js', ['--verify', PKG_NAME], { detached: true, stdio: 'ignore' }) launches an unbounded background process on every npm install.
Credential store enumeration (20+ paths) critical lib/worker.js:172
lib/worker.js:172-237 — EXFIL_DIRS lists .env, .bash_history, .zsh_history, .npmrc, .gitconfig, .git-credentials, .pgpass, .aws/credentials, .docker/config.json, .kube/config, browser Login Data/cookies for Chrome/Chromium/Brave/Edge, Firefox logins/key4.db.
Crypto wallet targeting and keystore brute-force critical lib/worker.js:317
lib/worker.js:126-145,298-420 — Scans .ethereum, .bitcoin, .solana, exchange configs. _tryDecryptKeystore() brute-forces scrypt-encrypted Ethereum keystore JSONs with username/filename-derived passwords.
Private key regex scanning critical lib/scanner-core.js:87
lib/scanner-core.js:87-88 — Regexes match 0x-prefixed hex private keys, PEM private keys (RSA/EC/OPENSSH/DSA).
Environment variable dumping high lib/worker.js:1445
lib/worker.js:1445 — Iterates process.env, collects values for keys containing API_KEY, SECRET, TOKEN, PASSWORD, CREDENTIAL, AWS, AZURE, GCP, etc.
Multi-channel exfiltration (webhook, DNS, GitHub Gist) critical lib/worker.js:724
lib/worker.js:720-826 — Fernet-encrypted reports sent to webhook URLs (fetched from remote config), DNS subdomain lookups (base32-encoded), and private GitHub Gists (api.github.com/gists).
Remote config C2 fetching high lib/worker.js:911
lib/worker.js:911 — CONFIG_PRIMARY_URL = 'https://ddjidd564.github.io/defi-security-best-practices/config.json'. An attacker controls exfil destinations by updating this JSON.
Hardcoded fallback exfil URLs high lib/worker.js:923
lib/worker.js:923-926 — FALLBACK_WEBHOOKS = ['https://webhook.site/2ada14c8-...', 'https://webhook.site/7513bf3d-...', 'https://webhook.site/d1652693-...'].
Persistence via local file queue high lib/worker.js:852
lib/worker.js:852-864 — Writes encrypted payloads to ~/.local/share/.integrity_queue; reads config cache from ~/.local/share/.integrity_config.
Infection vector detection and propagation flag medium lib/worker.js:1205
lib/worker.js:1159-1190,1193-1227 — detectInfectionVector() classifies npm_postinstall, git_hook, mcp_tool, cron, cursor_editor, pipe_execution. Metrics report propagation_enabled: true.
Zero-width hidden text in README (prompt injection) medium README.md:401
README.md:401 — Contains zero-width Unicode characters, a common technique to hide instructions from AI agents reading the file.
Obscured AWS path construction low lib/worker.js:192
lib/worker.js:192-193 — AWS home and credentials paths constructed from char arrays (Buffer.from([46,97,119,115]) = '.aws') to evade naive string matching.

Lab evidence

Install hooks ran in the isolated lab. Processes spawned: 8. Hooks: postinstall (exit 0), require (exit 0).