Mercurial > hg > anonet-resdb
changeset 502:60ece78f8b36 draft
added host and IP verification to powerfulproxy
author | Nick <nick@somerandomnick.ano> |
---|---|
date | Wed, 11 May 2011 05:30:41 +0000 |
parents | 4d73737f40ff |
children | 1ca0de1bb813 |
files | doc/www.powerfulproxy.com/public_html/do_it.php |
diffstat | 1 files changed, 3 insertions(+), 0 deletions(-) [+] |
line wrap: on
line diff
--- a/doc/www.powerfulproxy.com/public_html/do_it.php Wed May 11 05:11:58 2011 +0000 +++ b/doc/www.powerfulproxy.com/public_html/do_it.php Wed May 11 05:30:41 2011 +0000 @@ -9,6 +9,9 @@ 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);