场景
最新发现linux服务器一直很卡,导致无法编译和其它相关操作。
排查分析
经top 查看原来是一个叫269 的进程一直抢占CPU,占比高达4000%。而该269 进程则是挖矿病毒进行高度伪装,即使是kill 掉该进程也无济于事,后面又会自动跑起来。
top - 19:29:19 up 1:24, 2 users, load average: 41.71, 41.75, 41.46
Tasks: 891 total, 3 running, 502 sleeping, 0 stopped, 0 zombie
%Cpu(s): 48.7 us, 0.2 sy, 0.0 ni, 50.6 id, 0.4 wa, 0.0 hi, 0.0 si, 0.0 st
KiB Mem : 26380483+total, 24399928+free, 11714944 used, 8090604 buff/cache
KiB Swap: 588796 total, 588796 free, 0 used. 25003548+avail Mem
PID USER PR NI VIRT RES SHR S %CPU %MEM TIME+ COMMAND
48124 root 20 0 7745272 10036 4 S 4089 0.0 1986:45 269
17692 root 20 0 1445272 1.218g 33360 R 100.0 0.5 47:55.27 clamscan
15890 root 20 0 715656 58536 4 S 84.2 0.0 0:08.81 php-fpm
47926 root 20 0 1000496 214512 4 S 68.4 0.1 14:49.33 apache2
17176 root 20 0 39016 11136 5492 R 31.6 0.0 0:00.06 lsb_release
17168 root 20 0 43720 4620 3184 R 26.3 0.0 0:00.08 top
16735 root 20 0 715912 52600 4 S 15.8 0.0 0:03.77 php-fpm
1 root 20 0 78000 9100 6596 S 0.0 0.0 0:09.57 systemd
2 root 20 0 0 0 0 S 0.0 0.0 0:00.05 kthreadd
4 root 0 -20 0 0 0 I 0.0 0.0 0:00.00 kworker/0:0H
6 root 20 0 0 0 0 I 0.0 0.0 0:00.00 kworker/u160:0
7 root 0 -20 0 0 0 I 0.0 0.0 0:00.00 mm_percpu_wq
8 root 20 0 0 0 0 S 0.0 0.0 0:00.00 ksoftirqd/0
9 root 20 0 0 0 0 I 0.0 0.0 0:11.03 rcu_sched
10 root 20 0 0 0 0 I 0.0 0.0 0:00.00 rcu_bh
11 root rt 0 0 0 0 S 0.0 0.0 0:00.00 migration/0
12 root rt 0 0 0 0 S 0.0 0.0 0:00.03 watchdog/0
13 root 20 0 0 0 0 S 0.0 0.0 0:00.00 cpuhp/0
14 root 20 0 0 0 0 S 0.0 0.0 0:00.00 cpuhp/1
15 root rt 0 0 0 0 S 0.0 0.0 0:00.01 watchdog/1
16 root rt 0 0 0 0 S 0.0 0.0 0:00.00 migration/1
17 root 20 0 0 0 0 S 0.0 0.0 0:00.00 ksoftirqd/1
18 root 20 0 0 0 0 I 0.0 0.0 0:00.00 kworker/1:0