Take the 2-minute tour ×
Server Fault is a question and answer site for system and network administrators. It's 100% free, no registration required.

I've been getting some bots trying to get hold of my database by mass attacking /sertup/scripts.php of various database program. I wanna ban such activities.

The closest I found was this: http://www.rubyrobot.org/article/protect-your-web-server-from-spambots

What is the best way, or is there any scripts to ban bots from attacking?

Thanks.

share|improve this question
    
Are there any similarities in the requests made by the bots? Are the requests/min high? Would a normal user/visitor access that script? –  Mark Mar 12 '11 at 8:36
    
No, user/visitor won't be able to access the script. The request so far is minimum, once a week. All they were trying were various setup scripts from phpmyadmin, and other mysql controller scripts. –  Victor Mar 12 '11 at 8:43
    
Cakemox answer would be the correct one. Fail2ban will track the logs for the requests made and ban them using iptables. –  Mark Mar 12 '11 at 8:50

2 Answers 2

up vote 6 down vote accepted

Fail2ban will turn the logs of the attacks into firewall rules to block them. It may suit your needs.

share|improve this answer

I use fail2ban as well, but what proved much more useful was moving the entire site to SSL and doing a redirect. Apparently most, if not all (?) bots can't do either the redirect or SSL, so since then my fail2ban seldomly finds anything anymore.

Benefits: If you have name-based vhosts, your setup gets much simpler.

share|improve this answer

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.