dedecms任意文件上传漏洞(select_soft_post.php)

overme6个月前 (10-17)网页设计303

文件:select_soft_post.php
路径:/include/dialog/select_soft_post.php

原因:在获取完整文件名时,没有将会对服务器造成危害的文件格式过滤掉,因此需要手动添加代码过滤

解决方法:

1、在 select_soft_post.php 中找到如下代码:

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

2、在其上面添加如下代码:

if (preg_match(‘#\.(php|pl|cgi|asp|aspx|jsp|php5|php4|php3|shtm|shtml)[^a-zA-Z0-9]+$#i’, trim($filename))) {
    ShowMsg(“你指定的文件名被系统禁止!”,’javascript:;’);
    exit();
}

原文链接:https://blog.csdn.net/L_melody/article/details/99549932

发表评论

访客

看不清,换一张

◎欢迎参与讨论,请在这里发表您的看法和观点。