4

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 example.com/muieblackcat?

This is on Linux, with Apache.

4 Answers 4

6

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.

1
  • That's a nice idea. HAProxy seems documented well too. I think I will use it! Dec 21, 2011 at 7:55
22

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.

3
  • 1
    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, 2011 at 19:34
  • Thanks for the hint – this is a good point. Especially for well-known web sites. Dec 21, 2011 at 7:47
  • Countries too, c.f. China Dec 29, 2011 at 9:38
15

See Fail2Ban, it can parse Apache log files too.

2

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.

You must log in to answer this question.

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