centos防爆力破解
#! /bin/bash cat /var/log/secure|awk '/Failed/{print $(NF-3)}'|sort|uniq -c|awk '{print $2"="$1;}' > /data1/ip.list for i in `cat /data1/ip.list` do IP=`echo $i |awk -F= '{print $1}'` NUM=`echo $i|awk -F= '{print $2}'` if [ #NUM -gt 10 ]; then grep $IP /etc/hosts.deny > /dev/null if [ $? -gt 0 ];then echo "sshd:$IP:deny" >> /etc/hosts.deny fi fi done
查看被封ip
cat /etc/hosts.deny
添加定时任务
vim /etc/crontab
*/59 * * * * sh disable-login.sh
查看crontab运行情况
cat /var/log/cron.log
cat /var/log/cron

浙公网安备 33010602011771号