x x
当前位置 : 主页 > 网站建设 > 正文

阿里云服务器DedeCMS安全漏洞最新补丁

原创

重庆seo2018-09-02阅读(781)网站安全

阿里云服务器是企业或个人使用得比较多的WEB服务器,由于价格问题,也曾经考虑过用其他平台的服务器,但确实管理起来比较麻烦,有些地区覆盖不到,造成访问速度受影响,而且漏洞问题也无法被检测出来。如果你用的是最新版2018年1月的DedeCMS,漏洞还是存在的,下面总结的几个漏洞修补方法。

1、dedecms过滤逻辑不严导致上传漏洞

打开include/uploadsafe.inc.php文件,找到

$cfg_not_allowall = "php|pl|cgi|asp|aspx|jsp|php3|shtm|shtml";

替换为

$cfg_not_allowall = "php|pl|cgi|asp|aspx|jsp|php3|shtm|shtml|htm|html";

找到

$image_dd = @getimagesize($$_key);

替换为

$image_dd = @getimagesize($$_key);
if($image_dd == false){ continue; }

2、dedecms变量覆盖漏洞导致任意文件上传

打开文件/include/dialog/select_soft_post.php,找到

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

替换为:

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

3、dedecms早期版本后台存在大量的富文本编辑器,该控件提供了一些文件上传接口,同时dedecms对上传文件的后缀类型未进行严格的限制,这导致了黑客可以上传WEBSHELL,获取网站后台权限

打开文件/dede/media_add.php或者/你的后台名字/media_add.php。

搜索

$fullfilename = $cfg_basedir.$filename;

替换成

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

    本文地址:https://www.vi586.com/mip/web/586.html
    版权声明:原创文章,版权归重庆SEO吖七所有,欢迎分享本文,支持原创,转载请保留出处