zoukankan      html  css  js  c++  java
  • 阿里云服务器挖矿wipefs处理

    查看指定日志修改过的文件: 

    [root@iZbp12v0moqn078lm0t0l5Z 2018-04-26]# find /data/www/manage -ctime 0 -exec ls -lg {} ; |grep 'Apr 26'

    查看一天内修改过的文件:
    find / -ctime 0
    查找/home路径內最近1天被修改过的块普通文件:
    find /home -mtime 0 -type f 
    查找当前目录下,最近24-48小时修改过的普通文件,并显示详细信息
    find . -mtime 0 -type f -ls 

    挖矿程序清理:
    1,top查看当前进程:
    pkill wipefs
    2,删除crontab下得计划任务
    vim /var/spool/cron文件中得任务
    vim .viminfo 查看操作记录
    查找当前修改文件记录:find /home -ctime 0
    wipefs是linux自带的程序,用来擦除文件系统数据,也就是下面那个人回答的。正常的wipefs,路径在/usr/bin/wipefs,如果你没有做设置,不会自启动,也不会大量占用cpu。你可以看一下是否是 /bin/wipefs 进程,如果是,应该是你的机器被黑了,这是别人在你机器上放了挖矿程序。
    此程序会:
    1.进行挖矿计算,大量占用cpu。
    2.复制自己到/bin/wipefs,创建服务/etc/init.d/wipefs,在 /etc/rc.d 和 /etc/rc.d/rc.d 中创建链接以实现开机启动。
    3.释放子程序到 /bin/ddus-uidgen,创建服务/etc/init.d/acpidtd,并在 /etc/rc.d 和 /etc/rc.d/rc.d 中创建链接以实现开机启动。
    4.修改/etc/resolv.conf, 可能是为其连接矿机服务的域名做服务。
    5.修改/etc/crontab, 为自己创建定时任务,每天12点与0点开始执行。(所以你会发现第二天又启动了)
    你需要做的:
    1.删除 /etc/crontab 中的定时任务。
    2.删除以下文件:
    /bin/wipefs
    /etc/init.d/wipefs
    /bin/ddus-uidgen
    /etc/init.d/acpidtd
    /etc/rc0.d/S01wipefs
    /etc/rc1.d/S01wipefs
    /etc/rc2.d/S01wipefs
    /etc/rc3.d/S01wipefs
    /etc/rc4.d/S01wipefs
    /etc/rc5.d/S01wipefs
    /etc/rc6.d/S01wipefs
    /etc/rc.d/rc0.d/S01wipefs
    /etc/rc.d/rc1.d/S01wipefs
    /etc/rc.d/rc2.d/S01wipefs
    /etc/rc.d/rc3.d/S01wipefs
    /etc/rc.d/rc4.d/S01wipefs
    /etc/rc.d/rc5.d/S01wipefs
    /etc/rc.d/rc6.d/S01wipefs
    /etc/rc0.d/acpidtd
    /etc/rc1.d/acpidtd
    /etc/rc2.d/acpidtd
    /etc/rc3.d/acpidtd
    /etc/rc4.d/acpidtd
    /etc/rc5.d/acpidtd
    /etc/rc6.d/acpidtd
    /etc/rc.d/rc0.d/acpidtd
    /etc/rc.d/rc1.d/acpidtd
    /etc/rc.d/rc2.d/acpidtd
    /etc/rc.d/rc3.d/acpidtd
    /etc/rc.d/rc4.d/acpidtd
    /etc/rc.d/rc5.d/acpidtd
    /etc/rc.d/rc6.d/acpidtd

    检查机器漏洞,ssh权限,防火墙等,避免机器再次被攻击。

    以上是网友提供的方法,以下是个人处理过程:

    1,使用find指令

    #查找系统中被设置了setuid的文件:
    find / -type f ( -perm -04000 -o -perm -02000 ) -exec ls -lg {} ;`
    #查看拥有指定权限文件:
    find / -type f -perm 700 |xargs ls -al

    #查看包含特殊内容的文件: 

    find /    -mount -type f -exec sh -c 'grep -q ".minexmr.|wipefs" "{}"' ; -print ; find /tmp -mount -type f -exec sh -c 'grep -q ".minexmr.|wipefs" "{}"' ; -print ;

    find /opt -mount -type f -exec sh -c 'grep -q ".xyz.|wipefs" "{}"' ; -print;

    对文件包含wipefs字段的文件酌情删除。

    2,通过查看tomcat的相关日志,发现tomcat存在远程执行代码漏洞,通过升级tomcat此次问题已经解决。

    参考资料:

    https://blog.csdn.net/Xing6Kai/article/details/78790403
    https://blog.csdn.net/b376924098/article/details/78233108
  • 相关阅读:
    927小程序繁星计划峰会 · 看完这七大话题 你会更了解阿里小程序
    不吹不黑,今天我们来聊一聊 Kubernetes 落地的三种方式
    虽然他们说是水题,但我觉得思想蛮好的
    新学dfs(看懂了)
    01背包,死记硬背(我是真的蠢)
    装箱问题(太笨、还没想通)
    高精度乘法,string中的坑
    双十一用python秒杀京东好货!
    高精度减法用string 和 stack
    n阶汉诺塔 记住吧。。
  • 原文地址:https://www.cnblogs.com/ligao/p/8805108.html
Copyright © 2011-2022 走看看