Take the 2-minute tour ×
Information Security Stack Exchange is a question and answer site for Information security professionals. It's 100% free, no registration required.

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?

share|improve this question

1 Answer 1

up vote 9 down vote accepted

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.

share|improve this answer
    
Thanks for the quick response! –  Dan Dec 22 '11 at 22:50

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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