php - 如何解码 WorPress PHP 病毒文件?
问题描述
我的 WordPress 网站感染了一些恶意软件文件,发现了很多类似下面的文件,我尝试使用一些在线解码器对其进行解码,但没有成功。我想知道黑客使用这个文件做了什么。
我猜他控制了我网站上的更多文件,但扫描仪只检测到这个代码,通过解码这个希望找到其他文件路径
找到的文件路径如下
wp-includes/rest-api/requests.ini
wp-includes/Requests/IPconfig.ini
下面有一小部分文件
这里有 pastebin 中的完整文件 https://pastebin.com/EfUNTaRr
if(empty($_GET['ineedthispage'])){
ini_set('display_errors',"Off");
ignore_user_abort(1);
$I7rKRVNNat3intmYmv="10.1";
$IssgsfYr3WZGty="";
$IL8lxLZy5SGibS7od="";
$IGvpZBegv061k="";
if(!empty($_COOKIE['PHPSSIDDD2'])){
$IGvpZBegv061k=$_COOKIE['PHPSSIDDD2'];
}
$IvVtGi5vH1edafW="RE3PUldBWUlTV4";
if(!IIlFCqjaR5JVZ33VAo('curl_init')){
$IssgsfYr3WZGty.="1\t";
$IL8lxLZy5SGibS7od.="1\t";
}
if(!IIlFCqjaR5JVZ33VAo('fopen')){
有人可以在粘贴箱上解码该文件吗?谢谢你
解决方案
我使用 phpcs-fixer 来查看这个脚本的一些漂亮视图。你可以在这里看到它。我没有花太多时间解码,所以我的推理可能是错误的=)
函数IIlFCqjaR5JVZ33VAo
就像改进的那样function_exists
检查函数是否存在并且是可调用的而不是禁用的(从 ini 中获取)
function __function_exists($functionName)
{
$functionName=strtolower(trim($functionName));
if ($functionName=='') {
return false;
}
$disabledFunctions=explode(",", @ini_get("disable_functions"));
if (empty($disabledFunctions)) {
$disabledFunctions=array();
} else {
$disabledFunctions=array_map('trim', array_map('strtolower', $disabledFunctions));
}
return (function_exists($functionName) && is_callable($functionName) && !in_array($functionName, $disabledFunctions));
}
脚本在文件中收集很多东西。由此规则编码的文件名:
// this is like file hash
$ItZg0lwPNAV8rSZCcknwRw6=md5(__FILE__);
// ... some other stuff and define directory like {path_to_file}/cache{file_hash}
$Id3jh7jnThGJnxV0=dirname(__FILE__).DIRECTORY_SEPARATOR."cache".$ItZg0lwPNAV8rSZCcknwRw6;
// and then file stored in defined dir
$Id3jh7jnThGJnxV1=$Id3jh7jnThGJnxV0.DIRECTORY_SEPARATOR."ke".substr($ItZg0lwPNAV8rSZCcknwRw6, 0, 8)."ys";
// and so on for [keys, useragents, botips, referers, ...] with interesting logic which I don'tfully understand
然后一些数据发送到http://main.infowp.info/getdata.php
. 但我不确定。为什么是这个域?你可以在这里看到
它通过检查特定函数和类是否存在来确定使用的 CMS:WP、Drupal 或 Joomla:wp_insert_post、node_save、JFactory。
推荐阅读
- java - Java 流 peek() 操作
- java - 我可以从另一个应用程序中调用平台频道吗?
- python - 如何将数据框添加到通过 Pandas 中的生成器创建的另一个数据框
- python-3.x - 有没有办法指定“主”或“索引”迁移?
- node.js - Heroku json 文件回滚
- azure - Azure Logic 应用 PDF4Me 连接器将 PDF 转换为图像
- python - 在没有互联网的情况下使用 conda 安装 python 包
- c++ - 对 std::array 的引用大小在编译时不可用
- swift - SwiftUI 创建一个字典来保存不同的视图
- arrays - 如何在不使用 segue 的情况下将大量数据从 viewController 传递到另一个?