zl程序教程

您现在的位置是:首页 >  其他

当前栏目

dedecmsV5.7 任意文件上传漏洞修复

漏洞文件上传 修复 任意
2023-09-14 09:01:10 时间

问题文件:在/include/dialog/select_soft_post.php文件

解决方法:

先找到这个文件/include/dialog/select_soft_post.php,找到大概72,73行的

$fullfilename = $cfg_basedir.$activepath.'/'.$filename;      

在这行代码之前增加:

//任意文件上传漏洞修复----start-----
if (preg_match('#\.(php|pl|cgi|asp|aspx|jsp|php5|php4|php3|shtm|shtml)[^a-zA-Z0-9]+$#i', trim($filename))){
    ShowMsg("你指定的文件名被系统禁止!",'javascript:;'); exit();
}
//任意文件上传漏洞修复-----end-----

然后保存上传服务器就OK了!