上月,博主租用的vps主机商发给我一封邮件,内容大致说我的服务器中了Ebury Trojan病毒。这个可以说是我使用linux来第一次碰到中毒。主机商给的建议是备份数据,然后重装系统。邮件正文如下:
Hostigation received third party information that your VPS may be compromised with the Ebury Trojan. The Ebury trojan steals SSH login credentials from incoming and outgoing SSH connections and forwards them to a dropzone server in specially crafted DNS packets. The trojan is normally found in a binary directory on Unix-based systems in one of the following locations:
/usr/bin/ssh
/usr/bin/sshd
/usr/bin/ssh-add
According to the data we received, your VPS was sending harvested SSH credentials to a dropzone server. They only guaranteed way to remove this trojan is to reinstall your VPS. If your VPS is OpenVZ, we can provide you with a small amount of backup space so you may retrieve critical files once your VPS is reinstalled. Due to the nature of this trojan, any infected KVM VPS will have to be reinstalled completely from scratch.
For more information on Ebury, please see https://www.cert-bund.de/ebury-faq
在我的印象中,linux不是很少中病毒的吗?而且服务器上我已经禁止root登陆,也安装了防暴力破解工具。带着这个疑惑,博主没有立即重装系统。因为我觉得如果服务器还是按照之前一样配置的话,迟早还是会被攻破的。所以博主按照邮件中给的网址,又具体了解了下这个Ebury Trojan,简单记录排查和清理步骤。
在系统中运行ipcs -m,确实发现很多可疑点,类似结果如下。
# ipcs -m ------ Shared Memory Segments -------- key shmid owner perms bytes nattch 0x00000000 0 root 666 3934216 2 0x00000000 32769 daemon 666 3922136 2 0x000006e0 65538 ****** 666 3283128 0
这个owner就不公布了。。。而且博主发现/usr/bin/ssh、/usr/bin/sshd、/usr/bin/ssh-add和/usr/sbin/sshd这几个文件都有被修改过的痕迹。不过运行ipcs -m -p找不到可疑进程。另外运行find /lib* -name libkeyutils\* -exec strings \{\} \; | egrep ‘connect|socket|inet_ntoa|gethostbyname’和rpm -Vv keyutils-libs也没有发现异常,这个可能是不幸中的万幸。
经过上步排查,博主简单认识了Ebury Trojan,接下来就开始清理。因为这台机子的其他文件没被感染,所以我就先从另外一台正常服务器上copy了和ssh相关文件覆盖,然后清空.ssh文件夹,最后重启服务器。重启后再次运行ipcs -m,没有出现上面问题。
运行一周多时间,暂时没发现异常。期间博主又升级了openssh,把版本从4.3升级到5.9。我怀疑中Ebury Trojan可能和openssh漏洞有关。清除Ebury Trojan暂时告一个段落,不过我想问题应该不会那么简单,可能需要继续观察。
参考链接:https://www.hkcert.org/my_url/zh/blog/13031201?nid=208144
评论列表(0条)
的随时观察,我遇到过中毒。