Forum Moderators: phranque

Message Too Old, No Replies

Blocking Form Spambots on Godaddy

         

DXL

4:13 am on Oct 16, 2006 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



I only have one or two sites left on Godaddy's servers, I've had a bot from South America spamming the submit forms on one of them every hour of the day for the last few days. Godaddy's hosting support said I can't block IP addies from my control panel, and that they don't know how I can block them on my own outside of using the cpanel.

Does anyone have any experience blocking abusive bots on godaddy?

rocknbil

10:05 am on Oct 16, 2006 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Have you tried denying the ip addresses via your server-side form processor?

I find it surprising you can't create an .htaccess file on your domain with godaddy, that would be easier to maintain. If not, a perly method,

@banned = (
'123\.456\..*',
'789\..*',
);
foreach $b (@banned) {
if ($ENV{'REMOTE_ADDR'} =~/$b/) { &exit_banned; last; }
}

Where &exit_banned prints a denied message and immediately exits the program without satisfaction. In the list, 789\..* bans all IPs in the class starting with 789, if it's specific single IP's use the whole address:

'123\.456\.789\.123'

DXL

11:43 am on Oct 16, 2006 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



The problem is that I typically never used .htaccess files to ban specific IP addresses. In this case, I don't need any wildcards, the spammer is using the same IP address consistently.

Will the code you posted work if I add it to an .htaccess file?

jtara

4:55 pm on Oct 16, 2006 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Will the code you posted work if I add it to an .htaccess file?

No. It's Perl code. The idea is, you add this to whatever program you use to process your form data. IF it's written in Perl. Of course, if it's written in PHP, you'd have to do something similar in PHP, etc.

The key thing here is that the IP address of the visitor is available in an environment variable. So, you can test it in the program that processes your forms, and refuse to process the form for certain IP addresses.

rocknbil

7:07 pm on Oct 16, 2006 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



<Limit GET POST>
allow from all
deny from 123.456.789.12
</Limit>

This in an .htaccess file will provide a 'forbidden' over your entire site to 123.456.789.12.

DXL

10:10 pm on Oct 16, 2006 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



thanks rocknbil, I think that's exactly what I was looking for.

How do you add strings for additional IP addies?

rocknbil

9:40 pm on Oct 17, 2006 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Just add lines.

<Limit GET POST>
allow from all
deny from 123.456.789.12
deny from 123.543.210.45
deny from 221
deny from 222
</Limit>