PHP class : socks 4, socks 5 and proxy lists validation (based on curl lib)
Anonymity is one of my favourites’ interests :) (try ksb26) .
This simple PHP 5 class validates Socks4 , Socks5 and Proxy lists.
Version: 0.2
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 | <?php // PHP anonymity checker // // (c) Involutive 2008 http://www.involutive.com // author: Paolo Ardoino < paolo@involutive.com > // // Usage: // $anons = array( // array("ip" => "1.2.3.4", "port" => 8080, "type" => "socks4"), // array("ip" => "1.2.3.5", "port" => 8080, "type" => "socks5"), // array("ip" => "1.2.3.6", "port" => 8080, "type" => "proxy") // ); // // $pa = new phpanon(array("anons" => $anons)); // $pa->check(); // $pa->done(); // // $anons is an array of triples ("ip" => ip, "port" => port, "type" => type) // ip: ip address of the socks / proxy // port: port of the socks / proxy // type: socks5 (for socks5), socks4 (for socks4), proxy (for proxy) // // Other options: // "url" => "http://www.example.com" : connection test page // "needle" => "someword" : some word contained in the page set by "url" // "user_agent" => "Mozilla Firefox" : set an alternative user_agent // "url_referer" => "http://www.mypage.com" : set a referer url class phpanon { public $anons = array(); public $opts = array("user_agent" => "", "url_referer" => "", "url" => "http://www.google.com", "needle" => "groups"); function __construct($opts) { if(sizeof($opts["anons"]) > 0) { $this->anons = $opts["anons"]; } if($opts["user_agent"] != "") { $this->opts["user_agent"] = $opts["user_agent"]; } if($opts["url_referer"] != "") { $this->opts["url_referer"] = $opts["url_referer"]; } } function check() { echo "PHP anonymity checker v0.2\n\t(c) 2007 Involutive http://www.involutive.com\n"; echo "\tAuthor: Paolo Ardoino < paolo@involutive.com >\n"; if(sizeof($this->anons) > 0) { for($i = 0, $cnt_good = 0, $cnt_gad = 0, $y = sizeof($this->anons); $i < $y; $i++) { $anon = &$this->anons[$i]; if($anon["ip"] != "" && $anon["port"] != "" && $anon["type"]) { echo "Checking ".$anon["ip"].":".$anon["port"]." [ type ".$anon["type"]." ] ... "; $ch = curl_init($this->opts["url"]); curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1); curl_setopt($ch, CURLOPT_HEADER, 0); curl_setopt($ch, CURLOPT_CONNECTTIMEOUT, 10); curl_setopt($ch, CURLOPT_TIMEOUT, 10); curl_setopt($ch, CURLOPT_FOLLOWLOCATION, 1); if($this->opts["user_agent"] != "") { curl_setopt($ch, CURLOPT_USERAGENT, $this->opts["user_agent"]); } if($this->opts["url_referer"] != "") { curl_setopt($ch, CURLOPT_REFERER, $this->opts["url_referer"]); } curl_setopt($ch, CURLOPT_PROXY, $anon["ip"].":".$anon["port"]); if($anon["type"] == "socks4") curl_setopt($ch, CURLOPT_PROXYTYPE, CURLPROXY_SOCKS4); else if($anon["type"] == "socks5") curl_setopt($ch, CURLOPT_PROXYTYPE, CURLPROXY_SOCKS5); $html = curl_exec($ch); if(curl_errno($ch) || $html == "" || strpos($html, $this->opts["needle"]) === FALSE) { $anon["status"] = 0; $cnt_gad++; echo "not working\n"; } else { $anon["status"] = 1; $cnt_good++; echo "working\n"; } curl_close ($ch); unset($ch); } unset($anon); } } echo "Done.\n"; } } ?> |


Notice: Use of undefined constant CURLPROXY_SOCKS4 - assumed ‘CURLPROXY_SOCKS4′ :((
Well, you aren’ t a master of writing install instructions. How should somebody install and use this script?
As far as i understand it, this script checks if the user comes via a proxy or not and if it closes the connection? It checks the proxies online, how? And no tore nodes?
By the way, thanks for the sitemap script. I am using it form time to time for a static website, because it can be configured very easy via the robots.txt file.
Dieter
If you know PHP, this snippet does not need installation instructions as it does not need to be installed.
Thanks, works a treat, slightly modified it my end.
Thanks for this. It’s very helpfull, it saved me a lot of time from having to write my own. (why reinvent the wheel, right?)
And Dieter:
This is used to check if a proxy is good or not, for use in whatever your script may need it for. It doesn’t check to see if a user is using a proxy. And as Arkin said, you don’t “install” it. It has perfectly helpful usage instructions at the beginning.