Take the 2-minute tour ×
Webmasters Stack Exchange is a question and answer site for pro webmasters. It's 100% free, no registration required.

I inherited a couple of sites that send the webmaster an email with each 404 error. I get a smattering of errors each day, but there are times when I'll get dozens, even hundreds, of errors from these sites in just a couple of minutes. Given what they're looking for (directories like phpmyadmin, wp-admin, register, admin, etc. and files like setup.php, register.php, admin.php, etc.) it's obviously a spambot trying to get access to the site.

Is there a way to prevent them from even looking at the site? Should I set up a honeypot that provides some bogus info or something? And how do I accomplish this?

I'm guessing that other sites (maybe all?) that I manage are being "attacked" in the same way, but I don't have a script that reports those errors in the same way so the squeaky wheel is getting my attention.

share|improve this question

2 Answers 2

Every site is being attacked in the same way. There's no way to stop this from happening in the first place. It's just not practical. You can monitor your server logs and try to block IPs that are consistently offering your problems but the best you can really do is keep your software up to date.

An interesting thing I found recently is 5G Blacklist. It uses .htaccess to protect against that sort of garbage attacks. It's worth checking out.

share|improve this answer

There isn't much you can do to prevent them. They are just automated scripts checking for vulnerable scripts. They will use lots of different IP addresses so there is no real way that I know of to prevent this.

The real question is should you worry about this? The answer is no.

Do you really need an email when someone hits a 404? What are you going to do??? Fix it at once? I would just regularly check my logs and stop the sending of IMHO unneeded emails.

On my server I have installed OSSEC in which you can define rules. So I will only get email alerts when I really need to (e.g. when the rubbish hits the fan).

share|improve this answer
    
I agree that the 404 notifications are extreme. But that's the way that I inherited it and it did bring to my attention the fact that there are bots hitting our sites all the time. I have since implemented rules to file those alerts so I can review them at my leisure. I'll probably evolve that thinking to just remove the notifications altogether. –  WebDevKev Feb 7 '12 at 23:04

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.