Linked by Thom Holwerda on Sun 19th Feb 2006 11:24 UTC, submitted by Falko Timme
Thread beginning with comment 97286
To read all comments associated with this story, please click here.
To read all comments associated with this story, please click here.
Althogh i too like the (I)PF syntax better then any off the ones supported by Linux-Netfilter:
iptables -A INPUT -p tcp -i eth0 -m state --state NEW
--dport 22 -m recent --update --seconds 30 -j DROP
iptables -A INPUT -p tcp -i eth0 -m state --state NEW
--dport 22 -m recent --set -j ACCEPT




Member since:
2006-02-19
FWIW, I’ve be using OpenBSD’s Packet Filter (PF) to address this for quite a while now:
pass in log quick on $ext_if inet proto tcp from ! $int_if:network to
( $ext_if ) port ssh flags S/SA keep state
( max-src-conn 5, max-src-conn-rate 3/30 ) queue ( default, interac )
Basically, if more than three connections are made to ssh in 30 seconds, subsequent connections from the offending IP within this time frame are blocked.
And while I don’t use Linux, the following rule actually blocks most of these “attacks”:
block in log quick on $ext_if inet proto tcp from any os Linux to
( $ext_if ) port ssh