
2024宁波赛线下赛AWD
全场都上waf没得玩。web手纯坐牢

任意文件下载


fix

public function download()
{
$input = input();
$arry=['../','flag','.','..','/',' ','php'];
foreach ($arry as $unsafe){
if(strpos($input['url'],$unsafe)){
echo "nonono";
return ;
}//首字符串出现的位置
}
return download(public_path() . $input['url'], $input['title']);
}
命令执行-预留
位于public\themes\template\404.html


Error类介绍


Exception类介绍


任意文件上传
漏洞点在Controller/File.php中,利用是需要进入admin后台才可以利用的。利用点在头像上传那。


fix
$extcheck=strtolower($uploadFile->getExtension());#把传进来都变成小写
$allowext=['png','jpg','jpeg','gif'];#直接白名单就好了
if(!in_array($extcheck,$allowext)){
throw new ErrorException("you can't upload other extion file");
}
