1 mark_c Jan 24, 2007 01:30
3 mark_c Jan 25, 2007 04:35
OK- how about -
<Limit GET POST>
order deny,allow
allow from all
deny from 69.31.0
</Limit>
Is there a way to verify that 69.32.0.0 - 69.31.0.255 is blocked? Or maybe it's not blocking anything - how can I tell? Maybe it should be
<Limit GET POST>
order deny,allow
deny from 69.31.0
allow from all
</Limit>
I've manged to figure this stuff out to the point where I don't get internal server errors, but I have no way of telling if the commands or parameters or whater the heck they are called are working.
Something like this -
RewriteEngine On
RewriteBase /
RewriteCond %{HTTP_REFERER} \.biz [NC,OR]
RewriteRule ^.* - [F]
I can test using the referrer spoofing software. If I try to access the blog with a spoofed refferer like "anyoldsite.biz" it tosses back a 403 error. If i spoof "anyoldsite.com" the request goes through. If I spoof "bannedbythe antispamlist.com" it provokes the B2E antispam response.
So... Is it similarly possible to determine that IP address level blocking is working?
Thanks -
MCC
4 village_idiot Jan 25, 2007 22:40
ill post back after I get home from work, hang tough. :)
5 village_idiot Jan 28, 2007 09:47
This:
deny from 69.31.0
is only going to block 69.31.0.0 - 69.31.0.255
it wont block 69.32.0.0 (im guessing you knew that but thought I would point it out just in case.
also, you dont need to do this:
<Limit GET POST> <---
order deny,allow
deny from 69.31.0
allow from all
</Limit> <---
your trying to block a range from doing everything, so just put mod_access "stuff" at the top of your .htaccess like so, without modifier things
order allow,deny
allow from all
deny from env=keep_out
deny from blah blah blah
Know what I mean? If you already have this:
order allow,deny
allow from all
somewhere near the top, drop that new deny statement under it, like my example. You CAn use what youve done, you just dont need to since your really blocking access to everything. That tends to be used when your blocking access to specific files.
<Limit GET POST>
order deny,allow
allow from all
deny from 69.31.0
</Limit>
== No.
<Limit GET POST>
Order Deny,Allow
Deny from 69.31.0
Allow from all
</Limit>
== Yes.
Dont let the order stuff confuse you, it doesnt matter which you chose they provide the same effect, you just want to make sure you follow standard apache examples for whichever way you go.
http://httpd.apache.org/docs/1.3/mod/mod_access.html
testing IP blocks is tough, unless you want to substitute one that you can proxy just to verify your doing the rules correctly. Really, the best proof is going to be your logs. :)
Since youre using mod_rewrite, you can do this instead if you want:
RewriteCond %{REMOTE_ADDR} ^69.31.0.[0-255] [OR]
that would go right above this:
RewriteCond %{HTTP_REFERER} \.biz [NC,OR]
so it would like:
RewriteCond %{REMOTE_ADDR} ^69.31.0.[0-255] [OR]
RewriteCond %{HTTP_REFERER} \.biz [NC,OR]
RewriteCond .....
About mod_rewrite, you are making sure that the last rule doesnt contain an OR right?
RewriteCond %{REMOTE_ADDR} ^69.31.0.[0-255] [OR]
Just to clarify - that would block 69.31.0.0 - 69.31.0.255
what specifically are you looking to test? Its nearly impossible to answer that question generically.
an actual rule that youre using in your .htaccess and are wondering about would be the most helpful..