Hi guys, I am creating a script as I am using this to detection the proxy server levels. <?php //proxy levels //Level 3 Elite Proxy, connection looks like a regular client //Level 2 Anonymous Proxy, no ip is forworded but target site could still tell it's a proxy //Level 1 Transparent Proxy, ip is forworded and target site would be able to tell it's a proxy if(!$_SERVER['HTTP_X_FORWARDED_FOR'] && !$_SERVER['HTTP_VIA'] && !$_SERVER['HTTP_PROXY_CONNECTION']){ echo '3'; } elseif(!$_SERVER['HTTP_X_FORWARDED_FOR']){ echo '2'; } else echo '1'; ?> PHP: I want the script to check the ip that if the proxy server is a Codeen/PlanetLab and BotNet proxy servers, then place on level one and if they are safe/unsafe to use. I cannot find the code to do the methods. Please help me! Thanks in advance.
Thanks for this danx10, so I am bit not sure what you mean by detect an ip range? I'd hope that preg_match() can find out the levels of the ip and how safe they are... Thanks!
I think you should probably know that any client can send a "HTTP_X_FORWARDED_FOR" header, even if it's not a proxy, so the only reliable info is "REMOTE_ADDR"
Thanks for this, so which one of these methods would tell me whether if the proxy is safe to use while it does not belong to the FBI, government or Ria? There are three methods that I am unsure which one I should use, preg_match(), "HTTP_X_FORWARDED_FOR and REMOTE_ADDR. For e.g: Level 3 of proxy is safe which are not belong to the FBI/Government, but level 1 are transparent and some proxy are unsafe and could be belong to FBI/Government. Hope you understand what I am trying work on. Thanks, Mark
preg_match() is a reguluar expression function. You can use it to do pattern matching, you can find more about it on google. Either use that or obtain a black/white list somewhere.
This will detect any suspicious anonymous proxy and any suspicious open socket that the user is running