。技术文章
阿里云。提示Discuz memcache+ssrf GETSHELL。。漏洞。。如何解决
。发布日期:2019-08-15 字体。大小:

。一般这个。。漏洞都是下面文件,source/function/function_core.php

搜索下面代码:

$content = preg_replace($_G['setting']['output']['preg']['search'], $_G['setting']['output']['preg']['replace'], $content);

在此行代码前。增加下面代码:

if (preg_match("(/|#|\+|%).*(/|#|\+|%)e", $_G['setting']['output']['preg']['search']) !== FALSE) { die("request error"); }

加完代码以后效果:

if (preg_match("(/|#|\+|%).*(/|#|\+|%)e", $_G['setting']['output']['preg']['search']) !== FALSE) { die("request error"); }
$content = preg_replace($_G['setting']['output']['preg']['search'], $_G['setting']['output']['preg']['replace'], $content);

上传文件,重新。进行验证就可以解决。