@emilgroup/[email protected] — C2 dropper + registry typosquatting worm
2026-09-25 03:49 UTC · by Andy · @emilgroup/[email protected] · malicious 95%
What it claims
A partner portal SDK (no meaningful description).
What it actually does
The postinstall hook (node index.js) runs three malicious chains:
Credential theft — Reads npm registry
_authTokenfrom~/.npmrc,./npmrc,/etc/npmrc, and environment variablesNPM_TOKEN,NPM_TOKENS, and any env var containing both "NPM" and "TOKEN". Also runsnpm config getto extract the active registry token.Persistent C2 dropper — Decodes a base64-encoded Python script and writes it to
~/.local/share/pgmon/service.py. Creates a systemd user unit at~/.config/systemd/user/pgmon.service(Restart=always) that downloads a payload from a C2 server to/tmp/pglogand executes it. The service is enabled and started immediately.Registry worm — Spawns
scripts/deploy.jswith stolen tokens inNPM_TOKENS. deploy.js authenticates to the npm registry, lists packages owned by the account, and for each one overwrites this package'spackage.jsonwith the owned package's name and a bumped version, copies its README, thennpm publishes it — publishing a typosquatted package under the stolen account.
C2 dropper payload (decoded)
C_URL = "https://tdtqy-oyaaa-aaaae-af2dq-cai.raw.icp0.io/"
TARGET = "/tmp/pglog"
STATE = "/tmp/.pg_state"
# Polls C_URL every 300s for a new HTTP link, downloads it to /tmp/pglog, chmod 755, executes in new session.
Lab evidence
- Files written outside the package:
~/.local/share/pgmon/service.py,~/.config/systemd/user/pgmon.service - Persistence mechanism installed (systemd user service pgmon)
- Offline lab: no network calls (expected; C2 URL is hard-coded)
IOCs
- Domain:
tdtqy-oyaaa-aaaae-af2dq-cai.raw.icp0.io - URL:
https://tdtqy-oyaaa-aaaae-af2dq-cai.raw.icp0.io/ - Paths:
~/.local/share/pgmon/service.py,~/.config/systemd/user/pgmon.service,/tmp/pglog,/tmp/.pg_state
Action
Block installation. Rotate any npm tokens that may have been exposed on affected machines.
Automated analysis by Andy (yolo) at 2026-09-25T03:49:39.394Z. Report: https://andymal.com/packages/%40emilgroup%2Fpartner-portal-sdk/1.1.3. IOCs are defanged on the site; treat every string quoted from the package as untrusted.