Hi seanpaulcail
leech as in, someone displaying downloads on their site, that are on your server...using your bandwidth.
the script:
//your domain, no [url]http://[/url]
$domain="www.domain.com";
//folder that the hidden Downloads files are in, no lead or trailing slashes
$folder="hid";
$filename=stripslashes(urldecode($QUERY_STRING));
if ($filename==""){readfile("http://www.domain.com/invalidfile.html");exit;}
$refr=getenv("HTTP_REFERER");
list($remove,$stuff)=split('//',$refr,2);
list($home,$stuff)=split('/',$stuff,2);
if ($home!=$domain){readfile("http://www.domain.com/leecher.html");exit;
}else{
$fp=@fopen("http://".$domain."/".$folder."/".$filename,"r");
if($fp)
{
if (ereg(".mp3",$filename)){$xtype="audio/mpeg";}
elseif(ereg(".zip",$filename)){$xtype="application/x-zip-compressed";}
elseif(ereg(".exe",$filename)){$xtype="application/x-msdownload";}
else{$xtype="application/octet-stream";}
Header("Content-Type: $xtype");
Header("Accept-Ranges: bytes");
Header("Content-Disposition: ; attachment; Filename=$filename");
while (!feof($fp)) {
echo(fgets($fp, 4096));
} //end while
fclose ($fp);
}else{
readfile("http://www.domain.com/filenotfound.html")
;exit;
}
}