發(fā)表日期:2018-08 文章編輯:小燈 瀏覽次數(shù):3087
很多將織夢dedecms安裝在阿里云的ecs的站長每次都會(huì)看到阿里云盾就會(huì)通知有一個(gè)上傳漏洞,引起的文件是/include/uploadsafe.inc.php文件,
原因是dedecms原生提供一個(gè)"本地變量注冊"的模擬實(shí)現(xiàn),原則上允許黑客覆蓋任意變量,就會(huì)導(dǎo)致被攻擊,下面告訴大家解決的辦法:
我們找到并打開/include/uploadsafe.inc.php文件,在里面找到如下代碼:
if(empty(${$_key.'_size'})){${$_key.'_size'} = @filesize($$_key);} |
在其下面添加如下代碼:
$imtypes = array("image/pjpeg", "image/jpeg", "image/gif", "image/png", "image/xpng", "image/wbmp", "image/bmp");if(in_array(strtolower(trim(${$_key.'_type'})), $imtypes)){$image_dd = @getimagesize($$_key); if($image_dd == false){continue;}if (!is_array($image_dd)) {exit('Upload filetype not allow !');}} |
日期:2018-09 瀏覽次數(shù):4488
日期:2018-09 瀏覽次數(shù):3113
日期:2018-09 瀏覽次數(shù):3946
日期:2018-09 瀏覽次數(shù):3887
日期:2018-09 瀏覽次數(shù):3433
日期:2018-09 瀏覽次數(shù):3826
日期:2018-09 瀏覽次數(shù):3283
日期:2018-09 瀏覽次數(shù):3548
日期:2018-09 瀏覽次數(shù):3283
日期:2018-09 瀏覽次數(shù):3320
日期:2018-09 瀏覽次數(shù):3072
日期:2018-09 瀏覽次數(shù):3626
日期:2018-09 瀏覽次數(shù):3587
日期:2018-09 瀏覽次數(shù):3159
日期:2018-09 瀏覽次數(shù):3079
日期:2018-09 瀏覽次數(shù):3838
日期:2018-08 瀏覽次數(shù):3059
日期:2018-08 瀏覽次數(shù):3204
日期:2018-08 瀏覽次數(shù):3028
日期:2018-08 瀏覽次數(shù):3029
日期:2018-08 瀏覽次數(shù):3086
日期:2018-08 瀏覽次數(shù):2833
日期:2018-08 瀏覽次數(shù):2961
日期:2018-08 瀏覽次數(shù):2912
日期:2018-08 瀏覽次數(shù):2926
日期:2018-08 瀏覽次數(shù):3088
日期:2018-08 瀏覽次數(shù):3139
日期:2018-08 瀏覽次數(shù):3485
日期:2018-08 瀏覽次數(shù):2995
日期:2018-08 瀏覽次數(shù):3300
Copyright ? 2013-2018 Tadeng NetWork Technology Co., LTD. All Rights Reserved.