伪装成WordPress安装的恶意软件
我们网站的一些用户在访问该网站时已经开始报告“特洛伊威胁”。听到这个消息后,我搜索了恶意代码,但无法找到它。伪装成WordPress安装的恶意软件
我安装了Sucuci SiteCheck插件,并报告了如下:
http://sitecheck.sucuri.net/scanner/?&scan=http://www.londonirishcentre.org
有没有人有任何想法如何找到流浪的代码?我知道一个新鲜的WP安装将是最好的,但该网站有这么多的定制工作,我宁愿把它留给最后一个选项。
任何帮助将大规模赞赏。在整个代码库
搜索:iframe
,eval
,base64_decode
可能有很多感染地区,但其最有可能的模板文件夹或在index.php
如果你不能够搜索并删除从头开始安装新实例所需的所有区域。
最有可能的base_64编码,所以这个最可能不会工作。 –
是的,这是可能的。我会添加另一个建议 – blang
@blang谢谢你,但我已经搜索了iframe,但没有找到任何东西。 – kelvin1986
我为another recent stackoverflow question创建了这个函数,你需要找到一个受感染的php文件,在顶部或底部你会看到一个被评估过的base_64编码字符串(它在每个文件中最有可能不同,所以寻找一个特定的字符串无法正常工作),但这个功能,如果是因为我怀疑,它会贯穿整个项目循环并删除受感染的代码注入字符串:
<?php
error_reporting(E_ALL);
//A Regex to match the infection string
$find='<\?php @error_reporting\(0\); if \(!isset\((.*?)\?>';
//Do It!
echo cleanMalware('./',$find);
function cleanMalware($path,$find){
$return='';
ob_start();
if ($handle = opendir($path)) {
while (false !== ($file = readdir($handle))) {
if ($file != "." && $file != "..") {
if(is_dir($path.'/'.$file)){
$sub=cleanMalware($path.'/'.$file,$find);
if(isset($sub)){
echo $sub.PHP_EOL;
}
}else{
$ext=substr(strtolower($file),-3);
if($ext=='php'){
$filesource=file_get_contents($path.'/'.$file);
//The cleaning bit
echo "The infection was found in the file '$path/$file and has been removed from the source file.<br>";
$clean_source = preg_replace('#'.$find.'#','',$filesource);
// $clean_source = str_replace($find,'',$filesource);
file_put_contents($path.'/'.$file,$clean_source);
}else{
continue;
}
}
}
}
closedir($handle);
}
$return = ob_get_contents();
ob_end_clean();
return $return;
}
?>
好运
这也许应该被移动[网站管理员](http://webmasters.stackexchange.com/) – PenguinCoder
找到感染的PHP文件之一,你看在顶部或底部有base_64编码蜇逃避,这是一个共同的东西最近,因为它似乎WordPress的某些方面是不安全的。用受感染的代码更新您的问题。 –
@ kelvin1986所以你有一个编码的字符串在你的PHP文件的顶部或底部? –