View Single Post
Old 07-13-2002, 11:14 AM  
zip
Confirmed User
 
Join Date: Jul 2001
Location: under the bridge
Posts: 567
Try this, is a combo between htaccess and php


PHP Code:
<?php 
$leechpage 
""

refferers urls ook toegestaan (zonder [url]http://[/url]) 
    
$domein["0"] = "localhost"
    
$domein["1"] = "127.0.0.1"

    
$folder["0"] = "down/loads"

idl=mijnfolder&idf=filevoorjou.exe">file voor jou</a> 

// THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED 
// WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES 
// OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE 
// DISCLAIMED.  IN NO EVENT SHALL THE AUTHOR OR 
// ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 
// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT 
// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF 
// USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND 
// ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, 
// OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT 
// OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 
// SUCH DAMAGE. 
// 

$versienumm = "<center style=\"font-family:arial\"><b>FW-ANTILEECH</b><br>Build:  1.32 "
<
p><b>FILE REQUEST DENIED</b></p></center>"; 
    if (!isset(
$HTTP_REFERER)) { 
        if (!empty(
$HTTP_SERVER_VARS) && isset($HTTP_SERVER_VARS['HTTP_REFERER'])) { 
            
$HTTP_REFERER = $HTTP_SERVER_VARS['HTTP_REFERER']; } } 
    if (!isset(
$idf)) { if (isset($HTTP_GET_VARS['idf'])) { $idf = $HTTP_GET_VARS['idf']; } } 

    if (isset(
$idf)) { $idf = stripslashes($idf); $idf = urldecode($idf); htmlentities($idf, ENT_QUOTES); 
        
$idf = preg_replace('/([;\:,`\'\\\|"* !+=?~#%&<>^\/\(\)\[\]\{\}\$\n\r])/',"", $idf); $idf = ereg_replace('\.\.', '', $idf); }     
    
if (!isset($idl)) { if (isset($HTTP_GET_VARS['idl'])) { $idl $HTTP_GET_VARS['idl']; } } 


    if (isset(
$idl)) { $idl stripslashes($idl); $idl urldecode($idl); htmlentities($idlENT_QUOTES); 
        
$idl preg_replace('/([;\:,.`\'\\\|"* !+=?~#%&<>^\/\(\)\[\]\{\}\$\n\r])/',""$idl); $idl ereg_replace('\.\.'''$idl); } 
    if (!empty(
$domein) && isset($HTTP_REFERER) && isset($idf)) { 
        if (
ereg("//",$HTTP_REFERER)) { list($begone1,$refoke) = split('//'$HTTP_REFERER2); } 
        else { 
$refoke $HTTP_REFERER; } 
        if (
ereg("/",$domein[0])) { list($domain,$begone2) = split('/'$domein[0], 2); } 
        else { 
$domain $domein[0]; } 
        
$a count($domein); 
        for (
$i 0$i $a$i++) { 


            if (
eregi($domein[$i],$refoke)) { 

                if (isset(
$idl) && isset($folder[$idl])) { 
                    if (
ereg("//",$folder[$idl])) { 
                        list(
$begone3,$domwww) = split('//'$folder[$idl], 2); 
                        list(
$domain,$defolds) = split('/'$domwww2); $fileonweb $defolds."/".$idf; } 
                    else { 
$fileonweb $folder[$idl]."/".$idf; } } 
                else { 
$fileonweb $folder["0"]."/".$idf; } 
                
$fileow "http://".$domain."/".$fileonweb
// open http on loop 
                
$id_wi fsockopen($domain,80); 
                
fputs($id_wi,"GET /$fileonweb HTTP/1.0\r\nHost: $domain\r\n\r\n");         
                
$buff fgets($id_wi1024); 
                
fclose($id_wi); 
// on file oke open file 
                
if (ereg("HTTP/1.1 200 OK"$buff)) { 
                    
$id_wi fopen($fileow"r"); 
                    if (
$id_wi) { 


                        if (
eregi(".htm"$idf)) { $welktype "text/html"; } 
                        else if (
eregi(".html"$idf)) { $welktype "text/html"; } 
                        else if (
eregi(".txt"$idf)) { $welktype "text/plain"; } 
                        else if (
eregi(".jpg"$idf)) { $welktype "image/jpg"; } 
                        else if (
eregi(".gif"$idf)) { $welktype "image/gif"; } 
                        else if (
eregi(".mpeg"$idf)) { $welktype "audio/mpeg"; } 
                        else if (
eregi(".mp3"$idf)) { $welktype "audio/mpeg"; } 
                        else if (
eregi(".doc"$idf)) { $welktype "application/msword"; } 
                        else if (
eregi(".rtf"$idf)) { $welktype "application/msword"; } 
                        else if (
eregi(".zip"$idf)) { $welktype "application/x-zip-compressed"; } 
                        else if (
eregi(".exe"$idf)) { $welktype "application/x-msdownload"; } 
                        else if (
eregi(".pdf"$idf)) { $welktype "application/pdf"; } 
                        else { 
$welktype "application/octet-stream"; } 
                        
Header("Content-Type: $welktype"); 
                        
Header("Accept-Ranges: bytes"); 
                        
Header("Content-Disposition: ; Filename=$idf"); 
                       
readfile($fileow); 
                        
fclose($id_wi); 
                        exit; 
                    } 
                } break; 
            } 
        } 
        if (
$leechpage != "") { header("Location: $leechpage"); exit; } 
        echo 
"$versienumm"; exit; } 
// geen referer url - exit of naar antileech.html 
    
else { if ($leechpage != "") { header("Location: $leechpage"); } } 
    echo 
"$versienumm"; exit; 
?> 

-------------------- 
htaccess file in dir. 
-------------------- 
ErrorDocument 403 /down/leech.html 
order deny,allow 
deny from all 
allow from 127.0.0.1 
allow from .localhost 
<Files .htaccess> 
order allow,deny 
deny from all 
</Files> 
IndexIgnore *
zip is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote