Jump to content

Snippet for open proxy blocking


ionicle
Go to solution Solved by lemmin,

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
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • 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.