1 2 3 4 | # ipdrop 129.24.8.1 on IP 129.24.8.1 drop on. |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 | #!/bin/bash source /usr/local/share/dynfw.sh args 2 $# "${0} IPADDR {on/off}" "Drops packets to/from IPADDR. Good for obnoxious networks/hosts/DoS" if [ "$2" == "on" ] then #rules will be appended or inserted as normal APPEND="-A" INSERT="-I" rec_check ipdrop $1 "$1 already blocked" on record ipdrop $1 elif [ "$2" == "off" ] then #rules will be deleted instead APPEND="-D" INSERT="-D" rec_check ipdrop $1 "$1 not currently blocked" off unrecord ipdrop $1 else echo "Error: \"off\" or \"on\" expected as second argument" exit 1 fi #block outside IP address that's causing problems #attacker's incoming TCP connections will take a minute or so to time out, #reducing DoS effectiveness. iptables $INSERT INPUT -s $1 -j DROP iptables $INSERT OUTPUT -d $1 -j DROP iptables $INSERT FORWARD -d $1 -j DROP iptables $INSERT FORWARD -s $1 -j DROP echo "IP ${1} drop ${2}." |
1 2 3 4 | # tcplimit 873 5 minute on Port 873 new connection limit (5/minute, burst=5) on. |
1 2 3 4 | # tcplimit 873 5 minute off Port 873 new connection limit off. |
1 2 3 4 5 6 7 8 | 嗨,伙计! 我很荣幸能参与您的开发项目。我刚创建了一个脚本, 用来每隔 10 分钟更新一次代码的本地副本。我将出去 旅游两个星期,但等到回来之后,我将会得到最新的源 代码,那时我就可以交差了!现在我要出门了……两周 后再见! 谨启, Newbie(新手) |
1 2 3 | # host-tcplimit 1.1.1.1 2401 1 day on |
1 2 3 | # chmod u-s /usr/bin/ssh |
1 2 3 4 | # user-outblock 2049 on UID 2049 block on. |
欢迎光临 电子技术论坛_中国专业的电子工程师学习交流社区-中电网技术论坛 (http://bbs.eccn.com/) | Powered by Discuz! 7.0.0 |