Skip to content
cccskills
FreePublished on GitHub

supply-chain-audit

Forensic scan for npm/PyPI supply-chain compromise (Shai-Hulud/TeamPCP campaigns) — checks persistence, hook injection, compromised packages, IOC strings, C2, dead-man switches. Use when auditing a machine or repo for malicious dependencies. Trigger on "supply chain audit", "check for compromised packages", "Shai-Hulud", "scan for malicious deps".

The English summary is being prepared. Showing the original description.

See how to install

Files included (1)

  • SKILL.md6.8 KB

SKILL.md (original)

Review the instructions the agent will receive before you install.

Supply Chain Audit Skill

Scanner forense completo per rilevare compromissioni da attacchi supply-chain npm/PyPI.

Campagne coperte

CampagnaDataVettori principali
Shai-Hulud SAP/BUN wave2026-04-29mbt, @cap-js/*, SessionStart hook injection
Mini Shai-Hulud TanStack wave2026-05-11@tanstack/*, mistralai, guardrails-ai, lightning
Varianti in corsocontinuo@opensearch-project, @squawk/, @uipath/

Utilizzo

/supply-chain-audit              # scan macchina corrente
/supply-chain-audit --quick      # scan rapido (salta scan git e IOC string)
/supply-chain-audit remediate    # guida remediation interattiva

Subcommand: scan

Esegui sempre questo prima di revocare qualsiasi token (dead-man's switch).

Passi:

  1. Individua il detection script:
SCRIPT="$HOME/.claude/scripts/supply-chain-audit.sh"
[ ! -f "$SCRIPT" ] && echo "ERROR: script non trovato — aggiorna ~/.claude con git pull" && exit 1
  1. Esegui localmente:
bash "$SCRIPT"
  1. Se --quick:
QUICK=true bash "$SCRIPT"
  1. Se --all-machines, esegui in parallelo via SSH su tutte le macchine:
for host in studio mini macbook; do
  echo "=== $host ==="
  ssh "$host" "bash -s" < "$SCRIPT" &
done


wait
  1. Interpreta il risultato:
    • Exit 0 / PULITO: nessun IOC trovato → macchina sicura
    • Exit 2 / ATTENZIONE: warning non critici → revisione manuale consigliata
    • Exit 1 / COMPROMESSO: IOC critici trovati → seguire remediation immediatamente

Subcommand: remediate

Guida interattiva passo-per-passo. L'ordine è critico — non saltare fase.

FASE 1 — Containment (PRIMA di revocare qualsiasi token)

⚠️ Il malware pianta un dead-man's switch: se revochi il token GitHub rubato prima di aver rimosso il watcher, il processo wipe la home directory.

# 1a. Termina il processo watcher se attivo
pkill -f gh-token-monitor 2>/dev/null || true
pkill -f tanstack_runner 2>/dev/null || true
pkill -f router_runtime 2>/dev/null || true

# 1b. Rimuovi file di persistenza
rm -f ~/.claude/router_runtime.js ~/.claude/setup.mjs ~/.claude/tanstack_runner.js
rm -f ~/.vscode/setup.mjs ~/.local/bin/gh-token-monitor.sh
rm -rf ~/.config/gh-token-monitor ~/.dev-env

# 1c. Disabilita systemd / LaunchAgent
systemctl --user disable --now gh-token-monitor 2>/dev/null || true
launchctl unload ~/Library/LaunchAgents/com.user.gh-token-monitor.plist 2>/dev/null || true
rm -f ~/.config/systemd/user/gh-token-monitor.service
rm -f ~/Library/LaunchAgents/com.user.gh-token-monitor.plist

# 1d. Se il malware ha creato un repo GitHub: NON eliminarlo subito
# → privatizzalo su GitHub (Settings → Danger Zone → Make private)
# → rimuovi tutti i runner auto-registrati (Settings → Actions → Runners)

FASE 2 — Eradication

# 2a. Rimuovi node_modules e cache npm
find ~/dev -name "node_modules" -maxdepth 5 -type d \
  -exec rm -rf {} + 2>/dev/null || true
npm cache clean --force 2>/dev/null || true

# 2b. Rimuovi workflow iniettati
find ~/dev -name "codeql_analysis.yml" -path "*/.github/workflows/*" -delete 2>/dev/null
find ~/dev -name "formatter_*.yml" -path "*/.github/workflows/*" -delete 2>/dev/null
find ~/dev -name "discussion.y*ml" -path "*/.github/workflows/*" -delete 2>/dev/null

# 2c. Verifica hook in .claude/settings.json
# Apri ~/.claude/settings.json e rimuovi qualsiasi hook non riconosciuto
# Hook legittimi: hook_handler.py, supply-chain-guard.py, session_start_memory.py, jq docker

# 2d. Reinstalla dipendenze in modo sicuro
# pnpm install --frozen-lockfile    (usa lockfile esistente)
# uv sync --locked                  (usa lockfile esistente)

FASE 3 — Credential Rotation (DOPO la rimozione del malware)

Solo dopo aver completato le fasi 1 e 2, ruota nell'ordine:

  1. npm tokens: npm token revoke <token> — poi crea nuovo con scope minimo
  2. GitHub PAT: Settings → Developer Settings → Tokens → revoca tutti
  3. AWS keys: IAM → revoca access key, crea nuova con scope minimo
  4. Altri cloud credentials (GCP, Azure, etc.)
  5. SSH keys: se ~/.ssh/ è stato letto, rigenera tutte le chiavi

FASE 4 — Verifica finale

bash ~/.claude/scripts/supply-chain-audit.sh

Deve terminare con EXIT 0 / PULITO.

IOC Reference completo

File malware noti

  • ~/.claude/router_runtime.js — stealer principale
  • ~/.claude/setup.mjs — loader
  • ~/.claude/tanstack_runner.js — worm propagation
  • ~/.vscode/setup.mjs — VS Code persistence
  • ~/.local/bin/gh-token-monitor.sh — dead-man's switch
  • ~/.config/gh-token-monitor/ — config watcher
  • ~/.dev-env/ — fake runner directory

Domìni C2

  • api.masscan.cloud — exfiltration
  • filev2.getsession.org — encrypted dead-drop
  • git-tanstack.com — attacker infra
  • seed1.getsession.org — session protocol node

IOC strings nel codice

  • "A Mini Shai-Hulud has Appeared"
  • "OhNoWhatsGoingOnWithGitHub"
  • "ctf-scramble-v2"
  • "IfYouRevokeThisToken"
  • "SHA1HULUD"
  • "voicproducoes"

Versioni npm compromesse (selezionate)

  • @tanstack/react-router: 1.169.5, 1.169.8
  • @opensearch-project/opensearch: 3.5.3, 3.6.2, 3.7.0, 3.8.0

Versioni PyPI compromesse

  • mistralai: 2.4.6
  • guardrails-ai: 0.10.1
  • lightning: 2.6.2, 2.6.3

Protezioni preventive già in place (non rieseguire)

  • ~/.claude/hooks/supply-chain-guard.py: PreToolUse hook — permette frozen installs e sfw-prefixed, blocca risoluzione senza protezione
  • ~/.claude/rules/lockfile-safety.md: policy aggiornata per flusso sfw

Fonti

Reviews

No reviews yet. Tell others what you thought.

Comments

No login needed. Share how it worked for you, ask a question, or note where it did not run.

No comments yet. Be the first to write one.

Comments are published right away. Do not include personal information such as email addresses or phone numbers. Up to 2 URLs.

0 / 1,000 characters

This form is protected by reCAPTCHA, and the Google Privacy Policy and Terms of Service apply.

More skills from this repository

Validate WCAG 2.1 Level AA compliance and accessibility best practices. Use when performing accessibility audits and WCAG certification.

The English summary is being prepared. Showing the original description.

matteocervelli/llms25Updated May 22, 2026

Analyze feature requirements, dependencies, and security considerations. Use when starting feature implementation from GitHub issues to understand scope, technical feasibility, and risks.

The English summary is being prepared. Showing the original description.

matteocervelli/llms25Updated May 22, 2026

Run SQL queries against psql, BigQuery, or MySQL from the terminal, including natural-language-to-SQL and schema exploration. Use when analyzing data, inspecting DB state, or debugging tables. Trigger on "query the database", "SQL", "show me data from", "explore table".

The English summary is being prepared. Showing the original description.

matteocervelli/llms25Updated May 22, 2026

Design REST APIs or function contracts with clear request/response specifications, error handling patterns, authentication strategies, and comprehensive documentation.

The English summary is being prepared. Showing the original description.

matteocervelli/llms25Updated May 22, 2026

Generate comprehensive API endpoint tests for REST and GraphQL APIs. Creates tests for all HTTP methods, status codes, authentication, and validation.

The English summary is being prepared. Showing the original description.

matteocervelli/llms25Updated May 22, 2026

Design component architecture and module structure using established architectural patterns for clean, maintainable, and scalable systems.

The English summary is being prepared. Showing the original description.

matteocervelli/llms25Updated May 22, 2026

See all skills by matteocervelli

Report a problem with this skill