From ce951043c47a3bf383f02c72865bacd175a98baf Mon Sep 17 00:00:00 2001 From: Nick Date: Wed, 11 May 2011 05:30:41 +0000 Subject: added host and IP verification to powerfulproxy --- doc/www.powerfulproxy.com/public_html/do_it.php | 3 +++ 1 file changed, 3 insertions(+) (limited to 'doc/www.powerfulproxy.com') diff --git a/doc/www.powerfulproxy.com/public_html/do_it.php b/doc/www.powerfulproxy.com/public_html/do_it.php index 20ac8de..0a5fedb 100644 --- a/doc/www.powerfulproxy.com/public_html/do_it.php +++ b/doc/www.powerfulproxy.com/public_html/do_it.php @@ -9,6 +9,9 @@ if (count($pall) <= 1) die('Unexpected path format'); array_shift($pall); $proto = array_shift($pall); $host = array_shift($pall); +$hostparts = explode('.', $host); +if (ip2long(long2ip($host))===$host) if ($hostparts[0]!='1') die('Bad IP'); +if (!preg_match("/ano|ntwrk$/",array_pop($hostparts))) die('Bad host'); $path = implode('/', $pall); array_pop($pall); $rp = implode('/', $pall); -- cgit v1.2.3