Page 1 of 1

How to restrict all proxy servers for our joomla site

Posted: Wed Oct 28, 2009 5:12 am
by krewapti
Hi all,
I am trying to restrict all proxy servers for one of my joomla site . I have set up one component to restrict specified IP Address ,But now we need Restriction for proxy servers also and I foud following
statements to put inside the .htaccess file:

# block proxy servers from site access
# http://perishablepress.com/press/2008/0 ... -htaccess/

RewriteEngine on
RewriteCond %{HTTP:VIA} !^$ [OR]
RewriteCond %{HTTP:FORWARDED} !^$ [OR]
RewriteCond %{HTTP:USERAGENT_VIA} !^$ [OR]
RewriteCond %{HTTP:X_FORWARDED_FOR} !^$ [OR]
RewriteCond %{HTTP:PROXY_CONNECTION} !^$ [OR]
RewriteCond %{HTTP:XPROXY_CONNECTION} !^$ [OR]
RewriteCond %{HTTP:HTTP_PC_REMOTE_ADDR} !^$ [OR]
RewriteCond %{HTTP:HTTP_CLIENT_IP} !^$
RewriteRule ^(.*)$ - [F]

But when I try to access my website through one of the proxy site I easily access the site or anyone easily access. It means my .htaccess file isn't working for proxy restriction.
So Anyone can help me and can get me out of this problem.

Re: How to restrict all proxy servers for our joomla site

Posted: Wed Oct 28, 2009 2:55 pm
by dynamicnet
Greetings:

From reading http://perishablepress.com/press/2008/0 ... -htaccess/ they do state, "It may not be perfect, but compared to blacklisting a million proxy domains, it’s lightweight, concise, and very effective."

Does that mean you are searching for the perfect version?

From looking at the top results of http://www.google.com/search?q=.htacces ... xy+servers it appears they are all using the same thing.

Thank you.

Re: How to restrict all proxy servers for our joomla site

Posted: Wed Oct 28, 2009 2:59 pm
by dynamicnet
Greetings:

I found http://www.codingforums.com/showthread.php?t=165164 which after reading the second post makes sense as to there not being a perfect solution via .htaccess.

"The HTTP headers that code is testing are optional and are only set by legitimate proxy servers. A legitimate proxy server is one that wants you to know it is a proxy, such as a proxy at a large company that is used by all the client computers within that company. The code would basically block visitors to your site who's Internet connection happened to be using a proxy server at their point of connection to the Internet.

The kind of proxy servers you want to block are called anonymous proxy servers (they don't want you to know they are proxy servers) and they DON"T set those HTTP headers. The only real way to block these kind of proxy servers would be to learn the IP address of each of them (each will either have one fixed IP address or a fixed block (subnet) of IP addresses) and deny connections from those IP addresses or blocks of IP addresses."

Thank you.

Re: How to restrict all proxy servers for our joomla site

Posted: Wed Oct 28, 2009 3:11 pm
by dynamicnet
Greetings:

http://coding-talk.com/f14/htaccess-block-proxy-2903/ had an interesting warning.

"RewriteCond %{HTTP:FORWARDED} !^$ [OR] will ban most mobiles as well"

Thank you.

Re: How to restrict all proxy servers for our joomla site

Posted: Wed Oct 28, 2009 10:50 pm
by thefactory
it's pretty hard to make sure you ban ALL proxies. Some you will get through that rewrite, but there are a lot that won't send those kind of headers.

Re: How to restrict all proxy servers for our joomla site

Posted: Thu Oct 29, 2009 4:22 am
by krewapti
dynamicnet wrote:Greetings:

From reading http://perishablepress.com/press/2008/0 ... -htaccess/ they do state, "It may not be perfect, but compared to blacklisting a million proxy domains, it’s lightweight, concise, and very effective."

Does that mean you are searching for the perfect version?

From looking at the top results of http://www.google.com/search?q=.htacces ... xy+servers it appears they are all using the same thing.

Thank you.
hello friend thatnks for your reply..
I have tried out all the things from this your provided "http://perishablepress.com" url but i am not getting success.

Re: How to restrict all proxy servers for our joomla site

Posted: Thu Oct 29, 2009 1:28 pm
by fw116
well, i would recommend to switch to a host which have apache mod_security installed and your problems are gone...