关键字: dos
$ cat dos_ip.sh
#!/bin/bash
netstat -an|grep SYN_RECV|awk -F' ' '{print $5;}'|awk -F':' '{print $1;}'|sort| uniq -c | sort -nr | head -n $1
$ cat dos_attack.sh
#!/bin/bash
netstat -an|grep SYN_RECV|awk -F' ' '{print $5;}'|awk -F':' '{print $1;}'|sort| uniq -c | sort -nr | head -n $1|awk -F' ' '{print $2}'|xargs --replace=TTT /sbin/iptables -t filter -I INPUT...