Get the App
SLTechnology News&Howtos  ›  Network Security  › 

Several arbitrary file deletions in feifeicms 4. 0

Shulou Source: shulou.com Published: 2022-06-01 02:46:40 10月03日 Update

1. Location Lib/Lib/Action/Admin/DataAction.class.php, two places

Unprocessed GET and POST parameters are spliced directly to the path, causing the file to be deleted. However, the actual local test found that the _ bak folder does not exist by default and needs backup function before it can be generated.

Global search for the _ bak field to find a place for the creation of the _ bak folder, the write_file function on line 51 of Lib/Lib/Action/Admin/DataAction.class.php.

When you enter the write_file function, you can see that the encapsulated mkdir method mkdirss is called internally

Now to construct the payload, you need to make a backup to create the _ bak folder. Here you need to satisfy strlen ($sql) > = $filesize*1000.

Backup succeeded

The following construction file deletes payload, accesses http://localhost:8888/4.0.181010/index.php?s=/admin-data-del&id=../../../../../../../../../Users/xx/Desktop/123.txt, and deletes 123.txt file

The other principle is the same, and it is no longer tested here.

2. Location Lib/Lib/Action/Admin/TplAction.class.php,88

You can see that the id parameter is not filtered and can be deleted arbitrarily. Create a 123.txt on the desktop during the test, and construct the payload as http://localhost:8888/4.0.181010/index.php?s=/admin-tpl-del&id=/Users/xx/Desktop/123.txt

You can see that the file has been deleted.

Tags: Files backups folders tests locations functions parameters same success global function principle field actual method unpassed desktop path processing encapsulation Apple Docker Huawei Linux macOS MariaDB Microsoft MySQL NVidia OPPO Reno Shulou Technology OPPO Reno macOS Shulou Information NVidia