<?php
/************************************************** *****************************
************************************************** *****************************/
$stdsite="http://wieistmeineip.de/";
// Startseite
$content="disabled";
// Content Standard-Einstellung
//
// Prüft effizient ob 2 Strings gleich sind (return: TRUE=ja, FALSE=nein)
//
function strequals($string1, $string2){
if(strlen($string1)==strlen($string2)){
$x=0;
$strlen1=strlen($string1);
while($string1[$x]==$string2[$x]){
if($x==$strlen1)
return TRUE;
$x++;
}
}
return FALSE;
}
//
// Rekursiv HTTP-Links mit Proxy-Fokus erweitern ("link" wird zu "http://proxy?url=link")
// "href=" "href='" 'href="'
function rekursiv_href($string, $host){
if(($pos=stripos($string, "href="))!=FALSE){
// wenn href drin
$adr=$pos+5;
// uri ist dahinter
if(($string[$adr]=="\"")||($string[$adr]=="\'")){
// wenn " oder ' gehört nicht zur uri
$adr++;
}
if((!strequals(substr($string, $adr, 7), "http://"))&&
(!strequals(substr($string, $adr, 8), "https://"))&&(TRUE))
if($string[$adr]=="/")
$string=substr($string, 0, $adr).$host.
rekursiv_href(substr($string, $adr, (strlen($string)-$adr)), $host);
else
$string=substr($string, 0, $adr).$host.
"/".rekursiv_href(substr($string, $adr, (strlen($string)-$adr)), $host);
}
return $string;
}
if($_GET['url']){
if((!strequals(substr($_GET['url'], 0, 7), "http://"))&&
(!strequals(substr($_GET['url'], 0, 8), "https://")))
$stdsite="http://".$_GET['url'];
else
$stdsite=$_GET['url'];
}
if($_GET['content'])
$content=$_GET['content'];
echo "<html><head><title>Your Own High Anonymity Web Proxy | ".$stdsite."</title>
</head><body><table width=\"100%\" vspace=0 hspace=0 border=0 cellspacing=0 cellpading=0>
<tr><td><center><form action=\"\" method=get>
<a title=\"Return Home\" alt=\"Return Home\" href=\"?home\">Home</a>
<input size=100 type=text name=url value=\"".$stdsite."\" title=\"URL\" alt=\"URL\">
<input type=submit value=\"go\" alt=\"go\" title=\"go\"> Content:
<select title=\"JavaScript / Java / Flash / PlugIns / ...\" name=content size=1>";
if($content=="enabled")
echo "<option selected>enabled</option><option>disabled</option>";
else
echo "<option>enabled</option><option selected>disabled</option>";
echo "</select></form></center></td></tr><tr><td>\n\n\n";
// $prothost=substr($_GET['url'],0,stripos(substr($_GET['url'],7,strlen($_GET['url'])-7),"/")+7);
if(stripos(substr($_GET['url'],7,strlen($_GET['url'])-7),"/"))
// Korrektur von Nilos
$prothost=substr($_GET['url'],0,stripos(substr($_GET['url'],7,strlen($_GET['url'])-7),"/")+7);
else
$prothost=$_GET['url'];
if($seite=file($stdsite)){
foreach($seite as $ausgabe){
$ausgabe=str_ireplace("<img", "<hidden", $ausgabe);
// DISABLE IMAGES
$ausgabe=str_ireplace("<form", "<hidden", $ausgabe);
// DISABLE FORMS
$ausgabe=str_ireplace("<frameset", "<hidden", $ausgabe);
// DISABLE FRAMESETS
$ausgabe=str_ireplace("<frame", "<hidden", $ausgabe);
// DISABLE FRAMES
$ausgabe=str_ireplace("<iframe", "<hidden", $ausgabe);
// DISABLE IFRAMES
// $ausgabe=str_ireplace("<link", "<hidden", $ausgabe); // DISABLE RELATIONSHIPS
$ausgabe=rekursiv_href($ausgabe, $prothost);
$ausgabe=str_ireplace('http://', '?url=http://', $ausgabe);
// HTTP LINKS
$ausgabe=str_ireplace('https://', '?url=https://', $ausgabe);
// HTTPS LINKS
$ausgabe=str_ireplace('ftp://', '?url=ftp://', $ausgabe);
// FTP LINKS
// $ausgabe=str_ireplace('//', '?url=http://', $ausgabe); // CURRENT LINKS
if($content=="disabled"){
$ausgabe=str_ireplace("<script", "<!-- <script", $ausgabe);
// DISABLE SCRIPTS
$ausgabe=str_ireplace("/script>", "/script> -->", $ausgabe);
$ausgabe=str_ireplace("<applet", "<!-- <applet", $ausgabe);
// DISABLE APPLETS
$ausgabe=str_ireplace("/applet>", "/applet> -->", $ausgabe);
$ausgabe=str_ireplace("<object", "<!-- <object", $ausgabe);
// DISABLE OBJECTS
$ausgabe=str_ireplace("/object>", "/object> -->", $ausgabe);
}
echo $ausgabe;
}
}
echo "\n\n\n</body></html>";