没接到登录告警,腾讯云服务器又卡了,基本登录不上,然后就改了密码,又重启了几次。还要接着清病毒啊!
看下进程优先级,优先级取值范围为(-20,19),越小优先级越高, 默认优先级是0
命令1:nice 指定程序的运行优先级
格式:nice n command
命令2:renice 改变程序的运行优先级
格式:renice -n pid
top -p PID能查看这个PID的优先级,就是NI的值
这里是0
查看下这个进程,用进程名
[root@VM_0_3_centos ~]# ps -ef|grep YDService
root 21445 20209 0 09:47 pts/0 00:00:00 grep --color=auto YDService
root 29975 1 1 02:27 ? 00:05:26 /usr/local/qcloud/YunJing/YDEyes/YDService -stubMod
UID: 启动这些进程的用户
PID: 进程的ID
PPID: 父进程的进程号
C: 进程生命周期中的CPU利用率
STIME: 进程启动时的系统时间
TTY: 表明进程在哪个终端设备上运行。如果显示 ?表示与终端无关,这种进程一般是内核态进程。另外, tty1-tty6 是本机上面的登入者程序,若为 pts/0 等,则表示运行在虚拟终端上的进程。
TIME: 运行进程一共累计占用的CPU时间
CMD: 启动的程序名称
这个在这里就看到这个木马放的位置了,可以删除
可以看到文件的修改日期有新的,这个文件里面有病毒,具体的还关联了那些文件还要再用lsof找
[root@VM_0_3_centos YunJing]# lsof -p 29975
COMMAND PID USER FD TYPE DEVICE SIZE/OFF NODE NAME
YDService 29975 root cwd DIR 253,1 4096 656356 /usr/local/qcloud/YunJing/YDEyes
YDService 29975 root rtd DIR 253,1 4096 2 /
YDService 29975 root txt REG 253,1 7678296 669462 /usr/local/qcloud/YunJing/YDEyes/YDService
YDService 29975 root mem REG 253,1 105824 3939 /usr/lib64/libresolv-2.17.so
YDService 29975 root mem REG 253,1 31408 3927 /usr/lib64/libnss_dns-2.17.so
YDService 29975 root mem REG 253,1 61624 3929 /usr/lib64/libnss_files-2.17.so
YDService 29975 root mem REG 253,1 2156160 3911 /usr/lib64/libc-2.17.so
YDService 29975 root mem REG 253,1 88776 13 /usr/lib64/libgcc_s-4.8.5-20150702.so.1
YDService 29975 root mem REG 253,1 1137024 3919 /usr/lib64/libm-2.17.so
YDService 29975 root mem REG 253,1 991616 4235 /usr/lib64/libstdc++.so.6.0.19
YDService 29975 root mem REG 253,1 142232 3937 /usr/lib64/libpthread-2.17.so
YDService 29975 root mem REG 253,1 43776 3941 /usr/lib64/librt-2.17.so
YDService 29975 root mem REG 253,1 19288 3917 /usr/lib64/libdl-2.17.so
YDService 29975 root mem REG 253,1 163400 3501 /usr/lib64/ld-2.17.so
YDService 29975 root 0u CHR 1,3 0t0 5342 /dev/null
YDService 29975 root 1u CHR 1,3 0t0 5342 /dev/null
YDService 29975 root 2u CHR 1,3 0t0 5342 /dev/null
YDService 29975 root 3w REG 253,1 3232344 655797 /usr/local/qcloud/YunJing/log/ydservice.20200609.log
YDService 29975 root 4u a_inode 0,10 0 5338 [eventpoll]
YDService 29975 root 5uW REG 0,20 5 19620 /run/YDService.pid
YDService 29975 root 7u IPv4 60723 0t0 TCP VM_0_3_centos:35870->169.254.0.55:lsi-bobcat (ESTABLISHED)
看下最后一行
VM_0_3_centos:35870->169.254.0.55:lsi-bobcat (ESTABLISHED)
好了,知道攻击服务器的地址了,也知道自己哪个端口用于发送文件了,禁禁禁
制止ip169.254.0.55
[root@VM_0_3_centos YunJing]# iptables -A INPUT -p tcp -s 169.254.0.55 -j DROP
[root@VM_0_3_centos YunJing]# service iptables save
The service command supports only basic LSB actions (start, stop, restart, try-restart, reload, force-reload, status). For other actions, please try to use systemctl.
不能用save,就重新加载吧
[root@VM_0_3_centos YunJing]# service iptables reload
Redirecting to /bin/systemctl reload iptables.service
Authorization not available. Check if polkit service is running or see debug message for more information.
Failed to reload iptables.service: Connection timed out
See system logs and 'systemctl status iptables.service' for details.
这个重新加载也不行,重启也报错,试下关了之后再启动
[root@VM_0_3_centos YunJing]# kill -9 29975
[root@VM_0_3_centos YunJing]# ps -ef|grep YDService
root 23213 20209 0 10:19 pts/0 00:00:00 grep --color=auto YDService
[root@VM_0_3_centos YunJing]# cd /usr/local/qcloud/YunJing/YDEyes
[root@VM_0_3_centos YDEyes]# ll
total 7512
-rw-rw-rw- 1 root root 8642 Jun 5 02:42 log.txt
-rwx------ 1 root root 7678296 Feb 25 16:24 YDService
[root@VM_0_3_centos YDEyes]# rm -f YDService
[root@VM_0_3_centos YDEyes]# ps -ef|grep YDLive
root 1982 1 0 Jun08 ? 00:03:53 /usr/local/qcloud/YunJing/YDLive/YDLive
root 23265 20209 0 10:20 pts/0 00:00:00 grep --color=auto YDLive
[root@VM_0_3_centos YDEyes]# lsof -p 1982
COMMAND PID USER FD TYPE DEVICE SIZE/OFF NODE NAME
YDLive 1982 root cwd DIR 253,1 4096 656363 /usr/local/qcloud/YunJing/YDLive
YDLive 1982 root rtd DIR 253,1 4096 2 /
YDLive 1982 root txt REG 253,1 3281208 669463 /usr/local/qcloud/YunJing/YDLive/YDLive
YDLive 1982 root mem REG 253,1 105824 3939 /usr/lib64/libresolv-2.17.so
YDLive 1982 root mem REG 253,1 31408 3927 /usr/lib64/libnss_dns-2.17.so
YDLive 1982 root mem REG 253,1 61624 3929 /usr/lib64/libnss_files-2.17.so
YDLive 1982 root mem REG 253,1 2156160 3911 /usr/lib64/libc-2.17.so
YDLive 1982 root mem REG 253,1 88776 13 /usr/lib64/libgcc_s-4.8.5-20150702.so.1
YDLive 1982 root mem REG 253,1 1137024 3919 /usr/lib64/libm-2.17.so
YDLive 1982 root mem REG 253,1 991616 4235 /usr/lib64/libstdc++.so.6.0.19
YDLive 1982 root mem REG 253,1 142232 3937 /usr/lib64/libpthread-2.17.so
YDLive 1982 root mem REG 253,1 43776 3941 /usr/lib64/librt-2.17.so
YDLive 1982 root mem REG 253,1 19288 3917 /usr/lib64/libdl-2.17.so
YDLive 1982 root mem REG 253,1 163400 3501 /usr/lib64/ld-2.17.so
YDLive 1982 root 0u CHR 1,3 0t0 5342 /dev/null
YDLive 1982 root 1u CHR 1,3 0t0 5342 /dev/null
YDLive 1982 root 2u CHR 1,3 0t0 5342 /dev/null
YDLive 1982 root 3w REG 253,1 22032 655795 /usr/local/qcloud/YunJing/log/ydlive.20200609.log
YDLive 1982 root 4uW REG 0,20 0 18197 /run/YDLive.pid
同样删YDLive
[root@VM_0_3_centos YDEyes]# kill -9 1982
[root@VM_0_3_centos YDEyes]# cd /usr/local/qcloud/YunJing/YDLive
[root@VM_0_3_centos YDLive]# ll
total 3212
-rw-rw-rw- 1 root root 10 Jun 9 08:31 LastUpdateTime.txt
-rwx------ 1 root root 3281208 Feb 25 16:24 YDLive
[root@VM_0_3_centos YDLive]# rm -f YDLive
[root@VM_0_3_centos YDLive]# ps -ef|grep rsyslogd
root 3800 1 0 Jun08 ? 00:02:39 /usr/sbin/rsyslogd -n
root 23492 20209 0 10:24 pts/0 00:00:00 grep --color=auto rsyslogd
[root@VM_0_3_centos YDLive]# ps -ef|grep kworker
root 4 2 0 Jun08 ? 00:00:00 [kworker/0:0H]
root 296 2 1 Jun08 ? 00:20:33 [kworker/0:1H]
root 20082 2 0 09:23 ? 00:00:00 [kworker/u2:1]
root 20083 2 0 09:23 ? 00:00:00 [kworker/0:3]
root 23186 2 0 10:18 ? 00:00:00 [kworker/0:0]
root 23338 2 0 10:21 ? 00:00:00 [kworker/u2:2]
root 23438 2 0 10:23 ? 00:00:00 [kworker/0:1]
root 23520 20209 0 10:25 pts/0 00:00:00 grep --color=auto kworker
root 25023 2 0 00:45 ? 00:00:00 [kworker/u2:0]
不是文件,好像是系统的命令,先杀进程看下会不会重启吧
[root@VM_0_3_centos YDLive]# kill -9 296
[root@VM_0_3_centos YDLive]# kill -9 3800
[root@VM_0_3_centos YDLive]# lsof -p 23579
COMMAND PID USER FD TYPE DEVICE SIZE/OFF NODE NAME
rsyslogd 23579 root cwd DIR 253,1 4096 2 /
rsyslogd 23579 root rtd DIR 253,1 4096 2 /
rsyslogd 23579 root txt REG 253,1 663904 15792 /usr/sbin/rsyslogd
rsyslogd 23579 root mem REG 253,1 83886080 393691 /var/log/journal/0ea734564f9a4e2881b866b82d679dfc/system@fb4ba63256334975987fc388a4771613-0000000000056db8-0005a5fbb0c4760e.journal
kworker 是 Linux 内核的一部分,说明内核本身占用了很多 CPU。
这可能是内核或驱动程序的bug所致,但也可能是因为某些用户态程序不断的系统调用所致。
我看到你确实在运行很多消耗CPU的程序,试着把他们逐个关掉,看 kworker 的 CPU 占用是否跟着下降。
实在不行就重装系统了。
这个就不知道什么原因了。
自己把数据库的文件导出来然后重装吧,还是保存下快照文件比较好。