- Windows 10
- PHP 5.4.5
- Apache 2.4.23
1、The current version is V1.4.8
2、Using the keyword search, I found the fopen() function in the \UCMS \UCMS \sadmin\fileedit.php file, where there are no restrictions on the filename suffix and content to write! So the PHP suffix can be written here to cause malicious command execution!
3、Here I backtrace, first $_POST[‘co’] exists, then $_GET[‘file’]) exists, and $_GET[‘dir’] exists. Most of all! In the first line of the file, we determine if there is a global variable admin. In this case, we can’t do anything without authorization, we just have to look up where is the entry
4、The current file is under/UCMS/UCMS. This is the background file. And all the data can be found through the background operation route/UCMS /index.php hole. Go to/UCMS /index.php here
5、And you can actually see that right here, it’s included by requiring something here. For analysis here, GET type parameters do and NOHTML need to be passed. And split $GET[‘do’] with ‘‘ as the divider. The first part is included as the name of the folder, and the second part is included as the file name +’.php’.
6、So the idea here is pretty clear, the vulnerability file is fileedit.php and it’s under sadmin, so $_GET[‘do’] is sadmin_fileEdit. This satisfies the criteria to enter the fileEdit file, at which point you only need to satisfy the criteria in Fileedit.php. Here the POST package is as follows:
POST /ucms/index.php?do=sadmin_fileedit&dir=/&file=CNVD.php HTTP/1.1
7、Here our Webshell phpInfo is in cnVd.php in the root directory