
This Python script exploits a remote code execution vulnerability (CVE-2024-6387) in OpenSSH.
We demand the safe return of all citizens who have been taken hostage by the terrorist group Hamas. We will not rest until every hostage is released and returns home safely. You can help bring them back home. https://stories.bringthemhomenow.net/
This repository contains a Python script designed to exploit the remote code execution (RCE) vulnerability in OpenSSH (CVE-2024-6387). This vulnerability involves a signal handler race condition that can lead to arbitrary code execution, allowing attackers to gain root access. This proof-of-concept is intended for educational purposes only.
OpenSSH's CVE-2024-6387 is a critical vulnerability caused by a regression of a previously fixed issue. It involves a race condition in the signal handler that can be exploited to execute arbitrary code as root.
Clone the repository:
git clone https://github.com/d0rb/CVE-2024-6387.git
cd CVE-2024-6387-exploit
Execute the script:
python exploit_cve_2024_6387.py <target_ip> <target_port> --max_attempts 10000 --num_threads 10 --glibc_base 0xb7400000
Example:
python exploit_cve_2024_6387.py 192.168.1.100 22 --max_attempts 10000 --num_threads 10 --glibc_base 0xb7400000
To improve the chances of winning the race condition, the script uses multithreading, which allows multiple attempts to be made simultaneously. Each thread tries to exploit the vulnerability, increasing the likelihood of success. A threading event (success_event) is used to signal when the exploit has succeeded, stopping all further attempts. The script also adjusts the timing slightly after each attempt to better synchronize with the race condition.
Special thanks to Ofer Chen for his valuable contributions to improving this script.
This exploit is for educational purposes only. Unauthorized use on systems without explicit permission is illegal and unethical. Always follow legal guidelines and obtain explicit permission before testing security on any system.
For any issues or inquiries, please open an issue on GitHub.
Stay safe and responsible! 🔒💻