Portswigger: Exploiting XInclude to retrieve files Writeup

Lab link.

This lab has a “Check stock” feature that embeds the user input inside a server-side XML document that is subsequently parsed.

Because you don’t control the entire XML document you can’t define a DTD to launch a classic XXE attack.

To solve the lab, inject an XInclude statement to retrieve the contents of the /etc/passwd file.

XInclude is a specification for creating sub-documents in an XML document. If the system allows it, we can read the file.

Aleyna Doğan
Aleyna Doğan

I'm Aleyna Doğan, a Senior Cyber Threat Intelligence Analyst specializing in cyber threat intelligence, OSINT investigations, and digital risk monitoring. This blog is where I share hands-on cybersecurity content, including TryHackMe writeups, PortSwigger labs, and practical learning resources.

Articles: 150

Leave a Reply

Your email address will not be published. Required fields are marked *