Server Fault is a question and answer site for system and network administrators. It's 100% free, no registration required.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I'm getting bored by all those muieblackcat's and similar scripts ran on web sites. Can I block an IP address (for example with iptables) automatically, like for a hour or so, as soon as it accesses

This is on Linux, with Apache.

share|improve this question
up vote 6 down vote accepted

Consider tarpitting these requests instead.

HAProxy (and I assume other HTTP proxies) has the ability to identify 'malicious' scan hits and delay the response (thus temporarily slowing the attack script).

Blocking the response entirely will just have the attack script move along to its next target immediately.

share|improve this answer
That's a nice idea. HAProxy seems documented well too. I think I will use it! – Simon A. Eugster Dec 21 '11 at 7:55

You could, but that would make denial-of-service attacks trivial. All an attacker needs to do is access your site through the same proxy I'm using and hit one of those URLs and then I can't access your site. There are still entire cities that use a web proxy.

share|improve this answer
And then there are the users whose PCs are infected with vulnerability scanning malware. One infected PC on, say, a University intranet could cause a denial of service for the whole campus. – Phil Dec 19 '11 at 19:34
Thanks for the hint – this is a good point. Especially for well-known web sites. – Simon A. Eugster Dec 21 '11 at 7:47
Countries too, c.f. China – Tom O'Connor Dec 29 '11 at 9:38

See Fail2Ban, it can parse Apache log files too.

share|improve this answer

I would start by using a program to watch the log files; if a particular URL is accessed, it should show up in the Apache logs. You can use SEC to watch for this URL access.

When the URL access happens, then SEC can run an iptables command to block the IP address.

share|improve this answer

Your Answer


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.