5

I'm getting a lot of hackers spamming my domain with requests for files that just don't exist. This is eating up a lot of my allotted bandwidth and I'd like to blacklist these IP addresses.

Is there is a way to automatically blacklist IP addresses in Apache once they have requested X number of files that 404 in a specified time frame?

9

Fail2ban does exactly what you ask.

It monitors your log files looking for certain patterns and then executes whatever action you specify. You can block an IP for a length of time.

It does require some skill in regex, but it comes packaged with regex testers.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.