Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
\server\Application\Home\Controller\PageController.class.php第150行
$upload->allowExts = array('jpg', 'gif', 'png', 'jpeg');// 设置附件上传类型
$upload->allowExts 不是 Think\Upload 类的正确用法,导致文件后缀限制失效
并且方法里面没有进行$this->checkLogin();导致未登录上传文件,即前台gethell
本地起个服务器测试
上传图片,并抓包,将文件名改为
plzmyy.<>php
生产环境下测试
修改为
$upload->exts = array('jpg', 'gif', 'png', 'jpeg');// 设置附件上传类型
参考链接:RoarCTF2019 simple_upload