deserts
大客部
级别: 总版主
精华:
0
发帖: 607
威望: 2 点
金钱: 1061 RMB
贡献值: 0 点
在线时间:1761(小时)
注册时间:2006-01-01
最后登录:2025-01-28
|
linux自动屏蔽IP工具
另存为 firewall.sh 给执行的权限 ~Tbj
=f WE]e
m
> #!/bin/sh RrUBpqA # this program is used to check tcp/ip connections N7E$G{TT # and block those ip with excessive connections ljl^ GFo
ARcB'z\r # my version ]Q]W5WDe: myver="1.0RC1" "ju6XdZ
o ][}0#'/mV # wake up every 120s if last check found abuse client iq(
)8nxi wakeup_time_min=120 rZ8`sIWQt W9NX=gE4 # wake up every 300s if last check found no abuse client dy_:-
2S wakeup_time_max=300 %p%%~ewmx n ; {76Q # rule timeout 3600s LL:_L< rule_timeout=3600 4apL4E"r 8M!:N(a # check port list <b,~:9*? portlist="80" [eTSZjIN7 8WnwQ%;m? # max established connection per ip ]U"94S U:) max_active_conn=8 1GzAG;UUo6 -GxaV #{ # iptables chain name Hh+
2mkg iptables_chain_name="RH-Lokkit-0-50-INPUT" c/sC&i;%O p5G?N(l # log facility K6R.@BMN log_facility="local0" p,#o<W J{Q|mD= # Block policy % >=!p ipchains_block_policy="DENY" ZHa"isl$e iptables_block_policy="REJECT" E>K!Vrh-L {
;2PL^i # myself hIT+gnhh myself=`basename $0` i{`:(F5* 0)gdB'9V_ mylogger_info() RCpR3iC2 { ~sh`r{0 logger -p $log_facility.info -t $myself $@ 2>/dev/null 'tH_p } c24dSNJg, r 8RoE`/T mylogger_debug() F'21jy& {
< | |