Re: [Hampshire] apache block invalid IP address

Top Page

Reply to this message
Author: John Cooper
Date:  
To: lug, Hampshire LUG Discussion List
Subject: Re: [Hampshire] apache block invalid IP address
On 15/07/10 15:42, Vic wrote:
>
>> Hi, I'm seeing user registration attempts on one of my forums with an IP
>> address of "."
>
> Well, that's not an IP address. There's something odd going on in your
> logging. I've never seen this, and I've been unable to find out what it
> means; which version of Apache do you have, and what log formats are
> specified in your config?
>
>> How can I block (403) either an IP address of "." or an invalid IP
>> address using the .htaccess file?
>
> Once you know the address (or range) to block, it's trivial:
>
> <Files user_register.pl>
> Order Allow,Deny
> Allow from all
> Deny from 78.157.143.128/25
> ErrorDocument 403 /errordocs/sodoffspammer.html
> </Files>
>
> ASdd to the "Deny from" list as appropriate...
>
> Vic.
>
>


Hi Vic,

It is the IP address field as all the other entries have a valid IP
address. It could be the spammer has a malformed request.

I'm going to risk just trying

RewriteCond %{REMOTE_ADDR} ^\. [OR]
RewriteRule ^(.*)$ - [F,L]

and re-check the logs tomorrow to see if it has blocked them.

John.
--
--------------------------------------------------------------
Discover Linux - Open Source Solutions to Business and Schools
http://discoverlinux.co.uk
--------------------------------------------------------------