發(fā)表日期:2018-08 文章編輯:小燈 瀏覽次數(shù):3019
很多將織夢(mèng)dedecms安裝在阿里云的ecs的站長(zhǎng)每次都會(huì)看到阿里云盾就會(huì)通知有一個(gè)上傳漏洞,引起的文件是/include/uploadsafe.inc.php文件,
原因是dedecms原生提供一個(gè)"本地變量注冊(cè)"的模擬實(shí)現(xiàn),原則上允許黑客覆蓋任意變量,就會(huì)導(dǎo)致被攻擊,下面告訴大家解決的辦法:
我們找到并打開(kāi)/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ù):4420
日期:2018-09 瀏覽次數(shù):3061
日期:2018-09 瀏覽次數(shù):3896
日期:2018-09 瀏覽次數(shù):3825
日期:2018-09 瀏覽次數(shù):3389
日期:2018-09 瀏覽次數(shù):3779
日期:2018-09 瀏覽次數(shù):3227
日期:2018-09 瀏覽次數(shù):3491
日期:2018-09 瀏覽次數(shù):3237
日期:2018-09 瀏覽次數(shù):3268
日期:2018-09 瀏覽次數(shù):2998
日期:2018-09 瀏覽次數(shù):3552
日期:2018-09 瀏覽次數(shù):3528
日期:2018-09 瀏覽次數(shù):3099
日期:2018-09 瀏覽次數(shù):3023
日期:2018-09 瀏覽次數(shù):3794
日期:2018-08 瀏覽次數(shù):2992
日期:2018-08 瀏覽次數(shù):3154
日期:2018-08 瀏覽次數(shù):2971
日期:2018-08 瀏覽次數(shù):2975
日期:2018-08 瀏覽次數(shù):3018
日期:2018-08 瀏覽次數(shù):2783
日期:2018-08 瀏覽次數(shù):2902
日期:2018-08 瀏覽次數(shù):2844
日期:2018-08 瀏覽次數(shù):2864
日期:2018-08 瀏覽次數(shù):3029
日期:2018-08 瀏覽次數(shù):3088
日期:2018-08 瀏覽次數(shù):3411
日期:2018-08 瀏覽次數(shù):2934
日期:2018-08 瀏覽次數(shù):3247
Copyright ? 2013-2018 Tadeng NetWork Technology Co., LTD. All Rights Reserved.