Mod rewrite configuration Blocking proxies

This is a discussion on Mod rewrite configuration Blocking proxies within the Apache Web Server forums, part of the Web Server and Related Forums category; Hi I would like to block access through a proxy server to some of my web pages I want to ...


Go Back   Usenet Forums > Web Server and Related Forums > Apache Web Server

FAQ Members List Calendar Search Today's Posts Mark Forums Read
  #1 (permalink)  
Old 01-18-2007
Thank You
 
Posts: n/a
Default Mod rewrite configuration Blocking proxies

Hi

I would like to block access through a proxy server to some of my web
pages
I want to block the access to all the files with the .asp extension
Coud you please tell me what is wrong with these rules ? If any of thge
environment variables is not Null then I would like to block that
client.

Thank you


<Directory />
Options FollowSymLinks
AllowOverride None
Options +FollowSymLinks
RewriteEngine On
RewriteCond %{HTTP_FORWARDED} !^$
RewriteCond %{HTTP_X_FORWARDED_FOR} !^$
RewriteCond %{HTTP_VIA} !^$
RewriteCond %{XPROXY_CONNECTION} !^$
RewriteCond %{PROXY_CONNECTION} !^$
RewriteRule asp$ - [F]

</Directory>

  #2 (permalink)  
Old 01-18-2007
shimmyshack
 
Posts: n/a
Default Re: Mod rewrite configuration Blocking proxies


Thank You wrote:
> Hi
>
> I would like to block access through a proxy server to some of my web
> pages
> I want to block the access to all the files with the .asp extension
> Coud you please tell me what is wrong with these rules ? If any of thge
> environment variables is not Null then I would like to block that
> client.
>
> Thank you
>
>
> <Directory />
> Options FollowSymLinks
> AllowOverride None
> Options +FollowSymLinks
> RewriteEngine On
> RewriteCond %{HTTP_FORWARDED} !^$
> RewriteCond %{HTTP_X_FORWARDED_FOR} !^$
> RewriteCond %{HTTP_VIA} !^$
> RewriteCond %{XPROXY_CONNECTION} !^$
> RewriteCond %{PROXY_CONNECTION} !^$
> RewriteRule asp$ - [F]
>
> </Directory>


see here:
http://httpd.apache.org/docs/2.2/mod...ml#rewritecond


AND is implicit so you should have [OR] after each RewriteCond line,
since your rule is trigger if any are not null
next since you are testing against the empty string you dont need
regular expression matching so you can use
RewriteCond %{HTTP_X_FORWARDED_FOR} !=""
next _and I havent tried it_ how about urls of the form
http://server.com/path/file.asp/

Also there are many times when proxies wont revela this info to apache,
have you thought about looking around for a list (of IPs or hosts). I
wonder what your motivation is for this really as the almost all web
users will go through proxies to reach your server, and there are
better ways to ban 99% of users!

  #3 (permalink)  
Old 01-18-2007
Thank You
 
Posts: n/a
Default Re: Mod rewrite configuration Blocking proxies

Now my rules look like this

<Directory />
Options FollowSymLinks
AllowOverride None
Options +FollowSymLinks
RewriteEngine On
RewriteCond %{HTTP_FORWARDED} !="" [OR]
RewriteCond %{HTTP_X_FORWARDED_FOR} !="" [OR]
RewriteCond %{HTTP_VIA} !="" [OR]
RewriteCond %{XPROXY_CONNECTION} !="" [OR]
RewriteCond %{PROXY_CONNECTION} !="" [OR]
RewriteRule php$ - [F]


I am using a test proxy that reveals HTTP_X_FORWARDED_FOR but rewrite
is blocking everything no matter what I am using (proxy or direct
access). What am I doing wrong ?

Is there any way to log the values of the environment variables ?
I enabled the rewrite logging (level 9) and I can not see much there.

I am trying to stop trolls from writing on my forum
Very few proxies allow you to post and even less are high anonimity
proxies
Later I am going to extend this settings with a perl script that will
test the remote hosts to see if there is a proxy installed.

Thank you






shimmyshack wrote:
> Thank You wrote:
> > Hi
> >
> > I would like to block access through a proxy server to some of my web
> > pages
> > I want to block the access to all the files with the .asp extension
> > Coud you please tell me what is wrong with these rules ? If any of thge
> > environment variables is not Null then I would like to block that
> > client.
> >
> > Thank you
> >
> >
> > <Directory />
> > Options FollowSymLinks
> > AllowOverride None
> > Options +FollowSymLinks
> > RewriteEngine On
> > RewriteCond %{HTTP_FORWARDED} !^$
> > RewriteCond %{HTTP_X_FORWARDED_FOR} !^$
> > RewriteCond %{HTTP_VIA} !^$
> > RewriteCond %{XPROXY_CONNECTION} !^$
> > RewriteCond %{PROXY_CONNECTION} !^$
> > RewriteRule asp$ - [F]
> >
> > </Directory>

>
> see here:
> http://httpd.apache.org/docs/2.2/mod...ml#rewritecond
>
>
> AND is implicit so you should have [OR] after each RewriteCond line,
> since your rule is trigger if any are not null
> next since you are testing against the empty string you dont need
> regular expression matching so you can use
> RewriteCond %{HTTP_X_FORWARDED_FOR} !=""
> next _and I havent tried it_ how about urls of the form
> http://server.com/path/file.asp/
>
> Also there are many times when proxies wont revela this info to apache,
> have you thought about looking around for a list (of IPs or hosts). I
> wonder what your motivation is for this really as the almost all web
> users will go through proxies to reach your server, and there are
> better ways to ban 99% of users!


  #4 (permalink)  
Old 01-18-2007
Thank You
 
Posts: n/a
Default Re: Mod rewrite configuration Blocking proxies

Because that doesn't test the proxy conditions.

Thank you

Davide Bianchi wrote:
> On 2007-01-18, Thank You <rewrite321123@yahoo.com> wrote:
> >
> > I would like to block access through a proxy server to some of my web
> > pages
> > I want to block the access to all the files with the .asp extension

>
> Why don't you use the <Files> directive? Like
>
> <Files ~ "^\.asp">
> Order allow,deny
> Deny from all
> </Files>
>
> Davide
>
> --
> Normally, machines behave, 'cause they know what's good for them. This
> is the main way to tell servers apart from lusers. The lusers don't know
> what's good for them. -- Graham Reed on alt.sysadmin.recovery


  #5 (permalink)  
Old 01-18-2007
shimmyshack
 
Posts: n/a
Default Re: Mod rewrite configuration Blocking proxies


Thank You wrote:
> Now my rules look like this
>
> <Directory />
> Options FollowSymLinks
> AllowOverride None
> Options +FollowSymLinks
> RewriteEngine On
> RewriteCond %{HTTP_FORWARDED} !="" [OR]
> RewriteCond %{HTTP_X_FORWARDED_FOR} !="" [OR]
> RewriteCond %{HTTP_VIA} !="" [OR]
> RewriteCond %{XPROXY_CONNECTION} !="" [OR]
> RewriteCond %{PROXY_CONNECTION} !="" [OR]
> RewriteRule php$ - [F]
>
>
> I am using a test proxy that reveals HTTP_X_FORWARDED_FOR but rewrite
> is blocking everything no matter what I am using (proxy or direct
> access). What am I doing wrong ?
>
> Is there any way to log the values of the environment variables ?
> I enabled the rewrite logging (level 9) and I can not see much there.
>
> I am trying to stop trolls from writing on my forum
> Very few proxies allow you to post and even less are high anonimity
> proxies
> Later I am going to extend this settings with a perl script that will
> test the remote hosts to see if there is a proxy installed.
>
> Thank you
>
>
>
>
>
>
> shimmyshack wrote:
> > Thank You wrote:
> > > Hi
> > >
> > > I would like to block access through a proxy server to some of my web
> > > pages
> > > I want to block the access to all the files with the .asp extension
> > > Coud you please tell me what is wrong with these rules ? If any of thge
> > > environment variables is not Null then I would like to block that
> > > client.
> > >
> > > Thank you
> > >
> > >
> > > <Directory />
> > > Options FollowSymLinks
> > > AllowOverride None
> > > Options +FollowSymLinks
> > > RewriteEngine On
> > > RewriteCond %{HTTP_FORWARDED} !^$
> > > RewriteCond %{HTTP_X_FORWARDED_FOR} !^$
> > > RewriteCond %{HTTP_VIA} !^$
> > > RewriteCond %{XPROXY_CONNECTION} !^$
> > > RewriteCond %{PROXY_CONNECTION} !^$
> > > RewriteRule asp$ - [F]
> > >
> > > </Directory>

> >
> > see here:
> > http://httpd.apache.org/docs/2.2/mod...ml#rewritecond
> >
> >
> > AND is implicit so you should have [OR] after each RewriteCond line,
> > since your rule is trigger if any are not null
> > next since you are testing against the empty string you dont need
> > regular expression matching so you can use
> > RewriteCond %{HTTP_X_FORWARDED_FOR} !=""
> > next _and I havent tried it_ how about urls of the form
> > http://server.com/path/file.asp/
> >
> > Also there are many times when proxies wont revela this info to apache,
> > have you thought about looking around for a list (of IPs or hosts). I
> > wonder what your motivation is for this really as the almost all web
> > users will go through proxies to reach your server, and there are
> > better ways to ban 99% of users!



you say the rewrite log didnt tell you much, but set to level 9 it will
tell you everything you need to know, so post it here for a single
request if you need to.
what other rules are for that directory, are you using this in an
..htaccess file, are you sure you have permission etc...

to test for values i guess you could use your test proxy to request a
php with
phpinfo();
to try and see if the $_SERVER['HTTP_FORWARDED_FOR'] server variable is
set, otherwise just hard code them in a php script to get the value.

  #6 (permalink)  
Old 01-18-2007
Thank You
 
Posts: n/a
Default Re: Mod rewrite configuration Blocking proxies

I have access to the httpd.conf file so no need to use .htaccess.
I wanted to capture the values of the environment variables in the
apache log file. It seems that the CustoLog will do the trick
http://httpd.apache.org/docs/2.2/mod...og_config.html

I beleive I would have to learn how to enable CustomLog and use
%{FOOBAR}e The contents of the environment variable FOOBAR


Here is the log (fake IPs ), the only one that is real is the proxy's
IP (165.228.128.11, port 80)

111.111.111.111 is an external client, no proxy settings




111.111.111.111 - - [18/Jan/2007:14:38:27 --0500] [222.222.222.222/sid#b9855e48][rid#b9aae018/initial] -4 RewriteCond: input='' pattern='!=""' => not-matched
111.111.111.112 - - [18/Jan/2007:14:38:27 --0500] [222.222.222.222/sid#b9855e48][rid#b9aae018/initial] -4 RewriteCond: input='' pattern='!=""' => not-matched
111.111.111.113 - - [18/Jan/2007:14:38:27 --0500] [222.222.222.222/sid#b9855e48][rid#b9aae018/initial] -4 RewriteCond: input='' pattern='!=""' => not-matched
111.111.111.114 - - [18/Jan/2007:14:38:27 --0500] [222.222.222.222/sid#b9855e48][rid#b9aae018/initial] -4 RewriteCond: input='' pattern='!=""' => not-matched
111.111.111.115 - - [18/Jan/2007:14:38:27 --0500] [222.222.222.222/sid#b9855e48][rid#b9aae018/initial] -4 RewriteCond: input='' pattern='!=""' => not-matched
111.111.111.116 - - [18/Jan/2007:14:38:27 --0500] [222.222.222.222/sid#b9855e48][rid#b9aae018/initial] -2 forcing '/var/www/html/Forum/index.php' to be forbidden
165.228.128.11 - - [18/Jan/2007:14:38:47 --0500] [222.222.222.222/sid#b9855e48][rid#b9aae018/initial] -3 [per-dir /] strip per-dir prefix: /var/www/html/Forum/index.php -> var/www/html/Forum/index.php
165.228.128.11 - - [18/Jan/2007:14:38:47 --0500] [222.222.222.222/sid#b9855e48][rid#b9aae018/initial] -3 [per-dir /] applying pattern 'php$' to uri 'var/www/html/Forum/index.php'
165.228.128.11 - - [18/Jan/2007:14:38:47 --0500] [222.222.222.222/sid#b9855e48][rid#b9aae018/initial] -4 RewriteCond: input='' pattern='!=""' => not-matched
165.228.128.11 - - [18/Jan/2007:14:38:47 --0500] [222.222.222.222/sid#b9855e48][rid#b9aae018/initial] -4 RewriteCond: input='' pattern='!=""' => not-matched
165.228.128.11 - - [18/Jan/2007:14:38:47 --0500] [222.222.222.222/sid#b9855e48][rid#b9aae018/initial] -4 RewriteCond: input='' pattern='!=""' => not-matched
165.228.128.11 - - [18/Jan/2007:14:38:47 --0500] [222.222.222.222/sid#b9855e48][rid#b9aae018/initial] -4 RewriteCond: input='' pattern='!=""' => not-matched
165.228.128.11 - - [18/Jan/2007:14:38:47 --0500] [222.222.222.222/sid#b9855e48][rid#b9aae018/initial] -4 RewriteCond: input='' pattern='!=""' => not-matched
165.228.128.11 - - [18/Jan/2007:14:38:47 --0500] [222.222.222.222/sid#b9855e48][rid#b9aae018/initial] -2 forcing '/var/www/html/Forum/index.php' to be forbidden



shimmyshack wrote:
> Thank You wrote:
> > Now my rules look like this
> >
> > <Directory />
> > Options FollowSymLinks
> > AllowOverride None
> > Options +FollowSymLinks
> > RewriteEngine On
> > RewriteCond %{HTTP_FORWARDED} !="" [OR]
> > RewriteCond %{HTTP_X_FORWARDED_FOR} !="" [OR]
> > RewriteCond %{HTTP_VIA} !="" [OR]
> > RewriteCond %{XPROXY_CONNECTION} !="" [OR]
> > RewriteCond %{PROXY_CONNECTION} !="" [OR]
> > RewriteRule php$ - [F]
> >
> >
> > I am using a test proxy that reveals HTTP_X_FORWARDED_FOR but rewrite
> > is blocking everything no matter what I am using (proxy or direct
> > access). What am I doing wrong ?
> >
> > Is there any way to log the values of the environment variables ?
> > I enabled the rewrite logging (level 9) and I can not see much there.
> >
> > I am trying to stop trolls from writing on my forum
> > Very few proxies allow you to post and even less are high anonimity
> > proxies
> > Later I am going to extend this settings with a perl script that will
> > test the remote hosts to see if there is a proxy installed.
> >
> > Thank you
> >
> >
> >
> >
> >
> >
> > shimmyshack wrote:
> > > Thank You wrote:
> > > > Hi
> > > >
> > > > I would like to block access through a proxy server to some of my web
> > > > pages
> > > > I want to block the access to all the files with the .asp extension
> > > > Coud you please tell me what is wrong with these rules ? If any of thge
> > > > environment variables is not Null then I would like to block that
> > > > client.
> > > >
> > > > Thank you
> > > >
> > > >
> > > > <Directory />
> > > > Options FollowSymLinks
> > > > AllowOverride None
> > > > Options +FollowSymLinks
> > > > RewriteEngine On
> > > > RewriteCond %{HTTP_FORWARDED} !^$
> > > > RewriteCond %{HTTP_X_FORWARDED_FOR} !^$
> > > > RewriteCond %{HTTP_VIA} !^$
> > > > RewriteCond %{XPROXY_CONNECTION} !^$
> > > > RewriteCond %{PROXY_CONNECTION} !^$
> > > > RewriteRule asp$ - [F]
> > > >
> > > > </Directory>
> > >
> > > see here:
> > > http://httpd.apache.org/docs/2.2/mod...ml#rewritecond
> > >
> > >
> > > AND is implicit so you should have [OR] after each RewriteCond line,
> > > since your rule is trigger if any are not null
> > > next since you are testing against the empty string you dont need
> > > regular expression matching so you can use
> > > RewriteCond %{HTTP_X_FORWARDED_FOR} !=""
> > > next _and I havent tried it_ how about urls of the form
> > > http://server.com/path/file.asp/
> > >
> > > Also there are many times when proxies wont revela this info to apache,
> > > have you thought about looking around for a list (of IPs or hosts). I
> > > wonder what your motivation is for this really as the almost all web
> > > users will go through proxies to reach your server, and there are
> > > better ways to ban 99% of users!

>
>
> you say the rewrite log didnt tell you much, but set to level 9 it will
> tell you everything you need to know, so post it here for a single
> request if you need to.
> what other rules are for that directory, are you using this in an
> .htaccess file, are you sure you have permission etc...
>
> to test for values i guess you could use your test proxy to request a
> php with
> phpinfo();
> to try and see if the $_SERVER['HTTP_FORWARDED_FOR'] server variable is
> set, otherwise just hard code them in a php script to get the value.


  #7 (permalink)  
Old 01-18-2007
Thank You
 
Posts: n/a
Default Re: Mod rewrite configuration Blocking proxies

OK I have extended the apache log format and the log and I can see that
the server can see the real identity (IP) of the client. I believe that
the test condition is not the right one.
The log shows me "-" for no values ...I don't know if this is the real
string contained by the environment variable or this is just what
apache logs instead of "NULL"




shimmyshack wrote:
> Thank You wrote:
> > Now my rules look like this
> >
> > <Directory />
> > Options FollowSymLinks
> > AllowOverride None
> > Options +FollowSymLinks
> > RewriteEngine On
> > RewriteCond %{HTTP_FORWARDED} !="" [OR]
> > RewriteCond %{HTTP_X_FORWARDED_FOR} !="" [OR]
> > RewriteCond %{HTTP_VIA} !="" [OR]
> > RewriteCond %{XPROXY_CONNECTION} !="" [OR]
> > RewriteCond %{PROXY_CONNECTION} !="" [OR]
> > RewriteRule php$ - [F]
> >
> >
> > I am using a test proxy that reveals HTTP_X_FORWARDED_FOR but rewrite
> > is blocking everything no matter what I am using (proxy or direct
> > access). What am I doing wrong ?
> >
> > Is there any way to log the values of the environment variables ?
> > I enabled the rewrite logging (level 9) and I can not see much there.
> >
> > I am trying to stop trolls from writing on my forum
> > Very few proxies allow you to post and even less are high anonimity
> > proxies
> > Later I am going to extend this settings with a perl script that will
> > test the remote hosts to see if there is a proxy installed.
> >
> > Thank you
> >
> >
> >
> >
> >
> >
> > shimmyshack wrote:
> > > Thank You wrote:
> > > > Hi
> > > >
> > > > I would like to block access through a proxy server to some of my web
> > > > pages
> > > > I want to block the access to all the files with the .asp extension
> > > > Coud you please tell me what is wrong with these rules ? If any of thge
> > > > environment variables is not Null then I would like to block that
> > > > client.
> > > >
> > > > Thank you
> > > >
> > > >
> > > > <Directory />
> > > > Options FollowSymLinks
> > > > AllowOverride None
> > > > Options +FollowSymLinks
> > > > RewriteEngine On
> > > > RewriteCond %{HTTP_FORWARDED} !^$
> > > > RewriteCond %{HTTP_X_FORWARDED_FOR} !^$
> > > > RewriteCond %{HTTP_VIA} !^$
> > > > RewriteCond %{XPROXY_CONNECTION} !^$
> > > > RewriteCond %{PROXY_CONNECTION} !^$
> > > > RewriteRule asp$ - [F]
> > > >
> > > > </Directory>
> > >
> > > see here:
> > > http://httpd.apache.org/docs/2.2/mod...ml#rewritecond
> > >
> > >
> > > AND is implicit so you should have [OR] after each RewriteCond line,
> > > since your rule is trigger if any are not null
> > > next since you are testing against the empty string you dont need
> > > regular expression matching so you can use
> > > RewriteCond %{HTTP_X_FORWARDED_FOR} !=""
> > > next _and I havent tried it_ how about urls of the form
> > > http://server.com/path/file.asp/
> > >
> > > Also there are many times when proxies wont revela this info to apache,
> > > have you thought about looking around for a list (of IPs or hosts). I
> > > wonder what your motivation is for this really as the almost all web
> > > users will go through proxies to reach your server, and there are
> > > better ways to ban 99% of users!

>
>
> you say the rewrite log didnt tell you much, but set to level 9 it will
> tell you everything you need to know, so post it here for a single
> request if you need to.
> what other rules are for that directory, are you using this in an
> .htaccess file, are you sure you have permission etc...
>
> to test for values i guess you could use your test proxy to request a
> php with
> phpinfo();
> to try and see if the $_SERVER['HTTP_FORWARDED_FOR'] server variable is
> set, otherwise just hard code them in a php script to get the value.


  #8 (permalink)  
Old 01-18-2007
HansH
 
Posts: n/a
Default Re: Mod rewrite configuration Blocking proxies

"Thank You" <rewrite321123@yahoo.com> schreef in bericht
news:1169142606.270244.11060@m58g2000cwm.googlegro ups.com...
> Now my rules look like this
>
> <Directory />
> Options FollowSymLinks
> AllowOverride None
> Options +FollowSymLinks
> RewriteEngine On
> RewriteCond %{HTTP_FORWARDED} !="" [OR]
> RewriteCond %{HTTP_X_FORWARDED_FOR} !="" [OR]
> RewriteCond %{HTTP_VIA} !="" [OR]
> RewriteCond %{XPROXY_CONNECTION} !="" [OR]
> RewriteCond %{PROXY_CONNECTION} !="" [OR]
> RewriteRule php$ - [F]
>

IIRC the pattern to match against MUST be a regex, thus those =""
are taken literal ... back to !^$

> Later I am going to extend this settings with a perl script that will
> test the remote hosts to see if there is a proxy installed.

I'ld build my proxy using different IPs for input and output ...

HansH


  #9 (permalink)  
Old 01-18-2007
Thank You
 
Posts: n/a
Default Re: Mod rewrite configuration Blocking proxies

I found a identical situation here

http://beta.nntp.perl.org/group/perl.../msg12420.html

Apparently some variable use diffrent names:

# Ban anonymous proxy requests
RewriteCond %{HTTP:Via} !^$ [OR]
RewriteCond %{HTTP_FORWARDED} !^$ [OR]
RewriteCond %{HTTP:X-Forwarded} !^$
RewriteCond %{HTTP:Client-IP} ^$
RewriteCond %{HTTP:Forwarded-For} ^$
RewriteCond %{HTTP:X-Forwarded-For} ^$
RewriteRule .* /cgi-local/not_allowed.pl [L]




shimmyshack wrote:
> Thank You wrote:
> > Now my rules look like this
> >
> > <Directory />
> > Options FollowSymLinks
> > AllowOverride None
> > Options +FollowSymLinks
> > RewriteEngine On
> > RewriteCond %{HTTP_FORWARDED} !="" [OR]
> > RewriteCond %{HTTP_X_FORWARDED_FOR} !="" [OR]
> > RewriteCond %{HTTP_VIA} !="" [OR]
> > RewriteCond %{XPROXY_CONNECTION} !="" [OR]
> > RewriteCond %{PROXY_CONNECTION} !="" [OR]
> > RewriteRule php$ - [F]
> >
> >
> > I am using a test proxy that reveals HTTP_X_FORWARDED_FOR but rewrite
> > is blocking everything no matter what I am using (proxy or direct
> > access). What am I doing wrong ?
> >
> > Is there any way to log the values of the environment variables ?
> > I enabled the rewrite logging (level 9) and I can not see much there.
> >
> > I am trying to stop trolls from writing on my forum
> > Very few proxies allow you to post and even less are high anonimity
> > proxies
> > Later I am going to extend this settings with a perl script that will
> > test the remote hosts to see if there is a proxy installed.
> >
> > Thank you
> >
> >
> >
> >
> >
> >
> > shimmyshack wrote:
> > > Thank You wrote:
> > > > Hi
> > > >
> > > > I would like to block access through a proxy server to some of my web
> > > > pages
> > > > I want to block the access to all the files with the .asp extension
> > > > Coud you please tell me what is wrong with these rules ? If any of thge
> > > > environment variables is not Null then I would like to block that
> > > > client.
> > > >
> > > > Thank you
> > > >
> > > >
> > > > <Directory />
> > > > Options FollowSymLinks
> > > > AllowOverride None
> > > > Options +FollowSymLinks
> > > > RewriteEngine On
> > > > RewriteCond %{HTTP_FORWARDED} !^$
> > > > RewriteCond %{HTTP_X_FORWARDED_FOR} !^$
> > > > RewriteCond %{HTTP_VIA} !^$
> > > > RewriteCond %{XPROXY_CONNECTION} !^$
> > > > RewriteCond %{PROXY_CONNECTION} !^$
> > > > RewriteRule asp$ - [F]
> > > >
> > > > </Directory>
> > >
> > > see here:
> > > http://httpd.apache.org/docs/2.2/mod...ml#rewritecond
> > >
> > >
> > > AND is implicit so you should have [OR] after each RewriteCond line,
> > > since your rule is trigger if any are not null
> > > next since you are testing against the empty string you dont need
> > > regular expression matching so you can use
> > > RewriteCond %{HTTP_X_FORWARDED_FOR} !=""
> > > next _and I havent tried it_ how about urls of the form
> > > http://server.com/path/file.asp/
> > >
> > > Also there are many times when proxies wont revela this info to apache,
> > > have you thought about looking around for a list (of IPs or hosts). I
> > > wonder what your motivation is for this really as the almost all web
> > > users will go through proxies to reach your server, and there are
> > > better ways to ban 99% of users!

>
>
> you say the rewrite log didnt tell you much, but set to level 9 it will
> tell you everything you need to know, so post it here for a single
> request if you need to.
> what other rules are for that directory, are you using this in an
> .htaccess file, are you sure you have permission etc...
>
> to test for values i guess you could use your test proxy to request a
> php with
> phpinfo();
> to try and see if the $_SERVER['HTTP_FORWARDED_FOR'] server variable is
> set, otherwise just hard code them in a php script to get the value.


  #10 (permalink)  
Old 01-18-2007
Thank You
 
Posts: n/a
Default Re: Mod rewrite configuration Blocking proxies

Being a troll I would block you manually sooner or later.
It takes me 2 minutes to do that
Not sure how long would take you to rebuid the proxy each time

I just realizad that some legitimate users are using internal proxy
servers at work ...for those I have to run a script to allow them to
bypass the blocking. It is getting messy :-)

Thanks, I will change that back.
What do you mean by this "I'ld build my proxy using different IPs for
input and output ..."
I use to block IP ranges for situations when I see attacks comming from
the same range.
(this is the situation for Dial-Up users) I don't have many users
comming from the same range so I do not have probelems with blcoking
other users by mistake.



HansH wrote:
> "Thank You" <rewrite321123@yahoo.com> schreef in bericht
> news:1169142606.270244.11060@m58g2000cwm.googlegro ups.com...
> > Now my rules look like this
> >
> > <Directory />
> > Options FollowSymLinks
> > AllowOverride None
> > Options +FollowSymLinks
> > RewriteEngine On
> > RewriteCond %{HTTP_FORWARDED} !="" [OR]
> > RewriteCond %{HTTP_X_FORWARDED_FOR} !="" [OR]
> > RewriteCond %{HTTP_VIA} !="" [OR]
> > RewriteCond %{XPROXY_CONNECTION} !="" [OR]
> > RewriteCond %{PROXY_CONNECTION} !="" [OR]
> > RewriteRule php$ - [F]
> >

> IIRC the pattern to match against MUST be a regex, thus those =""
> are taken literal ... back to !^$
>
> > Later I am going to extend this settings with a perl script that will
> > test the remote hosts to see if there is a proxy installed.

> I'ld build my proxy using different IPs for input and output ...
>
> HansH


 
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are Off
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On



All times are GMT +1. The time now is 02:48 AM.


Powered by vBulletin® Version 3.7.3
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO 3.0.0