症状表现:
公司内部网络有一天突然开始卡顿,有几个应用特别慢。网络人员查网络,发现有一台机子在大量的发送数据,大概每秒百兆这样子。
-------------------------------------------华丽丽的分割线-----------------------------------------------------
查找原因:
安装iftop:
由于那台机子没有装iftop等网络监控工具,因此首先需要装一个。
[root@cifi-BI etc]# yum install flex byacc libpcap ncurses ncurses-devel
Loaded plugins: security
Setting up Install Process
Nothing to do
报错,网上找原因。
我用yum装httpd 这个包出现这个错误怎么解决,我改yum配置文件了
[root@cifi-BI etc]# cd /etc/yum.repos.d
[root@cifi-BI yum.repos.d]# ll
total 0
此文件夹下没有文件
而根据网上所述,此处该有一个文件rhel-debuginfo.repo
于是下载此文件到当前目录下:
[root@cifi-BI yum.repos.d]# wgethttp://docs.linuxtone.org/soft/lemp/CentOS-Base.repo
并重命名为rhel-debuginfo.repo
然后再次查看:
[root@cifi-BI yum.repos.d]# ll
total 8
-rw-r--r-- 1 root root 1426 May 24 2009 CentOS-Base.repo
-rw-r--r-- 1 root root 1426 Feb 18 20:24 rhel-debuginfo.repo
继续安装:
[root@cifi-BI yum.repos.d]# yum install flex byacc libpcap ncurses ncurses-devel libpcap-devel
[root@cifi-BI /]# mkdir iftop_install
[root@cifi-BI /]# cd iftop_install/
[root@cifi-BI iftop_install]# ll
total 0
[root@cifi-BI iftop_install]# wget http://www.ex-parrot.com/pdw/iftop/download/iftop-0.17.tar.gz
[root@cifi-BI iftop_install]# tar zxvf iftop-0.17.tar.gz
[root@cifi-BI iftop_install]# cd iftop-0.17
[root@cifi-BI iftop-0.17]# ./configure
[root@cifi-BI iftop-0.17]# make && make install
安装成功。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。
iftop监控:
监控网络(包括端口号):
[root@cifi-BI proc]# iftop -i eth0 -n -P
发现有个端口号在大量的发送数据,查此端口号的进程:
[root@cifi-BI ~]# lsof -Pnl +M -i4|grep 15612
Igoste 8343 0 5u IPv4 326138 UDP *:15612
发现进程是Igoste,pid是8343
解决问题:
查看此进程
[root@cifi-BI tmp]# ps -ef | grep Igoste
root 20072 1 65 12:54 ? 00:01:36 /tmp/Igoste
查杀进程,并删除文件:
[root@cifi-BI tmp]# kill -9 20072
[root@cifi-BI tmp]# cd /tmp
[root@cifi-BI tmp]# rm -f Igoste
十几秒之后又重新启动,,,,,,,,,,,,,,
查启动文件---遍历所有文件夹 模糊查找--------
命令出处:
[root@cifi-BI /]# find /var -type f -name '*Igoste*' > aaa.txt
[root@cifi-BI /]# cat aaa.txt
[root@cifi-BI /]#
------------------------------------------只有tmp下有一个Igoste
另外一个方法:杀进程,然后将/tmp/Igoste的权限赋为000
方法来自此处:
[root@cifi-BI tmp]# kill -9 20072
[root@cifi-BI tmp]# cd /tmp
[root@cifi-BI tmp]# chmod 000 Igoste
目前,没有再启动(有可能重启之后,会再次出现。。。。。。)
修改root密码!!!增加密码复杂度!!!
另附一个
如何检查linux系统是否中毒被入侵
另:Oracle官方的回复给的建议:重装服务器
参考网址:
https://news.drweb.com/?i=5801&c=5&lng=en&p=0
https://securelist.com/analysis/publications/64361/versatile-ddos-trojan-for-linux/
后问题反复,最终解决参考: