Jump to content

Detect proxy (couldn't find it)


Tasc0

Recommended Posts

Hi, well.. I've used this site a lot thanks to Google but now I'd like to do something in a web site but I can't find it or eiter understand it very well.
My question is: Can I detect if a user from a web site is using a proxy and if he is, don't let him enter the site?

I've found some stuff about it but I can't understand it very well. Here they are:
/http://www.phpbuddy.com/article.php?id=22
/http://joot.com/dave/writings/articles/php-examples.shtml

I'd aprecciate any reply.
Thanks in advance.
Link to comment
Share on other sites

[quote author=mainewoods link=topic=117312.msg478868#msg478868 date=1165283948]
aol users are all proxied

--try printing out headers recieved from proxy sites and non proxy sites
[code]print_r($_SERVER);[/code]
--if there is anything you can use, it would be there
[/quote]
I have this in a file:
[code]
<?
print_r($_SERVER);
?>[/code]
And this is what I get on my browser:
print_r($_SERVER);ER); ?>

Is that what you meant?
Link to comment
Share on other sites

no that should be printing out a bunch of variables like host, referer, user-agent, ect.  try full php tags
[code]<?php
?>[/code]
once you get that printing out the variables then you will have to call that page directly and then call the page through various proxies as you can and look for some telltale variables.
Link to comment
Share on other sites

Those $_SERVER variables contain everything sent in the headers of the request for the page.  If you can detect a proxy, it would be using one of those variables(looking for a value of or the presence of one of them). 

That's all you got, there ain't nothing else that you can use.
Link to comment
Share on other sites

  • 4 weeks later...
Hi, I'm back.
I found this script that shows the IP adress even if the users is navigating with a proxy. Doesn't work with elite proxies.
I'd like to know if I can show the user the proxy IP.
[code]<?php

function getIP() {
    if (isset($_SERVER['HTTP_X_FORWARDED_FOR'])) {
      $ips = $_SERVER['HTTP_X_FORWARDED_FOR'];
    } 
    elseif (isset($_SERVER['HTTP_VIA'])) {
      $ips = $_SERVER['HTTP_VIA'];
    } 
    elseif (isset($_SERVER['REMOTE_ADDR'])) {
      $ips = $_SERVER['REMOTE_ADDR'];
    }
    else { 
      $ips = "unknown";
    }
   
    echo "Your IP is: $ips";

}

if (isset($_SERVER['HTTP_X_FORWARDED_FOR'])) {
      $ip1 = $_SERVER['HTTP_X_FORWARDED_FOR'];
    } 
    elseif (isset($_SERVER['HTTP_VIA'])) {
      $ip1 = $_SERVER['HTTP_VIA'];
    } 
    elseif (isset($_SERVER['REMOTE_ADDR'])) {
      $ip1 = $_SERVER['REMOTE_ADDR'];
    }
    else { 
      $ip1 = "unknown";
    }

getIP();
?>[/code]
Thanks in advance.
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.