Fjor escribió el 2010-09-01:

[Bloquear brute force a SSH]
> (aunque no se puede hacer un script que agregue de
> manera automática reglas al netfilter).

I beg to differ. Sin paquetes extra, con puro shell y iptables haces la
magia:

# Restrict SSH logins 
$ipt -A INPUT -i $extif -p tcp --dport ssh -m state --state NEW -m recent --set 
--name SSH
$ipt -A INPUT -i $extif -p tcp --dport ssh -m state --state NEW -m recent \
 --rcheck --seconds 60 --hitcount 3 --name SSH -j LOG --log-prefix "SSH brute 
force 60"
$ipt -A INPUT -i $extif -p tcp --dport ssh -m state --state NEW -m recent \
 --rcheck --seconds 60 --hitcount 3 --rttl --name SSH -j DROP
$ipt -A INPUT -i $extif -p tcp --dport ssh -m state --state NEW -m recent \
 --rcheck --seconds 3600 --hitcount 12 --name SSH -j LOG --log-prefix "SSH 
brute force 3600"
$ipt -A INPUT -i $extif -p tcp --dport ssh -m state --state NEW -m recent \
 --rcheck --seconds 3600 --hitcount 12 --rttl --name SSH -j DROP
$ipt -A INPUT -i $extif -p tcp --dport ssh -m state --state NEW -j ACCEPT
-- 
bli

Responder a