目标达成 感谢每一位支持者 — 我们达成了 100% 目标!

目标: 1000 元 · 已筹: 1336

100%

CVE-2023-46604 PoC — Apache ActiveMQ 代码问题漏洞

来源
关联漏洞
标题: Apache ActiveMQ 代码问题漏洞 (CVE-2023-46604)
Description:Apache ActiveMQ是美国阿帕奇(Apache)基金会的一套开源的消息中间件,它支持Java消息服务、集群、Spring Framework等。 Apache ActiveMQ 5.15.16之前、5.16.7之前、5.17.6之前或5.18.3之前版本存在代码问题漏洞,该漏洞源于允许具有代理网络访问权限的远程攻击者通过操纵 OpenWire 协议中的序列化类类型来运行任意 shell 命令。
Description
Repository to exploit CVE-2023-46604 reported for ActiveMQ
介绍
# Active MQ CVE-2023-46604 exploit

This repository is a guide with examples on how to exploit the [CVE-2023-46604](https://activemq.apache.org/news/cve-2023-46604)

The exploit takes advantage of the usage of reflection for instantiating Exception classes through a malicious command
that instead of being a valid command, it sends as the exception class a Spring class to load beans and as the
string constructor parameter an URL from where to download an XML file with the Spring Bean definitions.

This Spring Bean is in fact a `java.lang.ProcessBuilder` which will run any bash command with the same user permissions as the
one that is running the Java Active MQ client or server.

## Running the exploit

### Client exploit
_I wish I could make the HTTP connection in Python code, but as far as I've seen, the Spring Bean loader for some reason makes two HTTP calls and I'm more familiar with multithreaded programming in Java than in Python_

This exploit is for an ActiveMQ client making a connection to a broker server, which in turn is a malicious server that will make this client vulnerable to remote code execution.

The exploit is split into two processes:
- Python script: this script handles the connection of the ActiveMQ client to return the Spring Bean definition
- Java process: the Java process contains two Threads: the client connection and an HTTP server that returns the Spring XML Bean definition.

This has been tested with Python 3.6 and Java 17

Compile the Java project:
1. `cd activemq-exploit`
2. `mvn clean package`

3. Go back to the root project with `cd ..`, and run `python scripts/client_exploit.py`

On another terminal, run the Java code:

4. `cd activemq-exploit`
5. `java -jar target/activemq-exploit-1.0-SNAPSHOT.jar`

### Server exploit

The server exploit connects to an ActiveMQ server broker and sends the malicious commands.
This was only used with ActiveMQ Artemis 2.18 and unable to exploit the vulnerability
because Artemis is not packaged with Spring, and the only known exploit
_for remote code execution_ is through a Spring class to load Spring Beans.

However, the Python script in `scripts/server_exploit.py` does the same as the client exploit, only connecting to a server.
It lacks authentication, so maybe adaptation of the Open Wire handshake is needed.
文件快照

登录后查看神龙缓存的 POC 文件快照

登录查看
备注
    1. 建议优先通过来源进行访问。
    2. 本地 POC 快照面向订阅用户开放;当原始来源失效或无法访问时,本地镜像作为订阅权益的一部分提供。
    3. 持续抓取、验证、维护这份 POC 档案需要不少投入,因此本地快照已纳入付费订阅。您的订阅是让这份资料能继续走下去的关键,由衷感谢。 查看订阅方案 →