Jump to content

Snippet for open proxy blocking


ionicle

Recommended Posts

Hey there, gals and guys, here's the deal:

I'm trying to integrate a layer of open proxy blocking in my website. I found out a pretty nifty tool for that - http://www.shroomery.org/ythan/proxyblock.php . What I want to do is, create a PHP snippet that would be inserted in the header section of each one of my HTMLs/PHPs. The snippet would have to extract the REMOTE_ADDR from the request to it, and substitute it in:

http://www.shroomery.org/ythan/proxycheck.php?ip=x.x.x.x

Then do a query at that URL, and, according to the single character returned as an answer, define two separate possible actions:

1. Y ( originating IP is identified as a proxy server ): deny access to the resource

2. N or X ( originating IP is not a proxy server, found in the database ): load resource as usual

Any idea on how to do that?

I will be adding another snippet to make sure that no regular proxy headers are allowed too, but the example above would be really useful for me to deny access to a wide array of open proxies, that could be classified as anonymous.

 

Link to comment
https://forums.phpfreaks.com/topic/277422-snippet-for-open-proxy-blocking/
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.