1

One IP address was accessing my site too frequently to be a real user, it was accessing so much that it caused site to slow down. Is there any application that can automatically block IP, if it is accessing too frequently to my site? My server is Linux Debian.

3 Answers 3

2

You can use fail2ban to do this. You will probably have to write a custom jail for it, to read your server log and determine how many attempts is too many. Be careful that you don't ban legitimate users.

1

You can use iptables for this.

iptables -I INPUT -p tcp --dport 22 -i eth0 -m state --state NEW -m recent --set

iptables -I INPUT -p tcp --dport 22 -i eth0 -m state --state NEW -m recent --update --seconds 60 --hitcount 4 -j DROP

These two rules will limit incoming connections to port 22 to 3 attemps in a minute, any more than that will be dropped.

See source.

1

I can see, that Snort can do it too and a lot more. http://manual.snort.org/node201.html

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .