My basic cloaking script

Discussion in 'Cloaking and Content Generators' started by Asprin, Oct 16, 2007.

  1. Asprin

    Asprin Newbie

    Joined:
    Oct 15, 2007
    Messages:
    15
    Likes Received:
    0
    I posted a quick and dirty cloaking tool in the tools section. I thought I might post it here too, maybe somebody would have missed it.

    I just learned about cloaking today so I decided to write a quick script that tries to filter out Google?s spider via an ACL and the user-agent.

    I know it?s very basic and only works for Google?s spider. Maybe you can give me some ideas so I can incorporate them into the script.
    I?ll definitely be updating this and I?ll make an update in this thread when I do.

    Anyways, I thought maybe somebody would have a use for it. If you have any questions, just ask.

    PHP:
    <?php

    $bip    
    = new ArrayObject();
    $bhn    = new ArrayObject();


    /*
     *    Set these variables to the location of the file that holds the black listed IP/hostnames
     */

    //$ipblacklist    = "ipblacklist.txt";
    //$hnblacklist    = "hnblacklist.txt";

    if(isset($ipblacklist))
    {
        
    $file    fopen($ipblacklist"r");
        
        while(!
    feof($file))
        {
            
    $bannedip    fgets($file1024);
            
    $bip->append();
        }
    }
    if(isset(
    $hnblacklist))
    {
        
    $file    fopen($hnblacklist"r");
        
        while(!
    feof($file))
        {
            
    $bannedhn    fgets($file1024);
            
    $bhn->append();
        }
    }

    $hostname    gethostbyaddr($_SERVER['REMOTE_ADDR']);

    if(
    in_array($_SERVER['REMOTE_ADDR'], (array)$bip) || in_array($hostname, (array)$bhn))
    {
        include(
    "spider_content.html");
    } else if(
    stristr($_SERVER['HTTP_USER_AGENT'], "Mediapartners-Google") || stristr($_SERVER['HTTP_USER_AGENT'], "Googlebot")) {
        include(
    "spider_content.html");
    } else {
        include(
    "human_content.html");
    }


    ?> 
     
  2. superuser

    superuser Newbie

    Joined:
    Oct 18, 2007
    Messages:
    44
    Likes Received:
    187
    Does cloaking get a site banned in Google?
     
  3. Asprin

    Asprin Newbie

    Joined:
    Oct 15, 2007
    Messages:
    15
    Likes Received:
    0
    I'm very new to this all, but from what I can gather IF they find out that you are cloaking, you will be banned.
    That is, of course, IF they find out. ;)
     
  4. superuser

    superuser Newbie

    Joined:
    Oct 18, 2007
    Messages:
    44
    Likes Received:
    187
    So you mean to say that cloaking is not 100% safe ... you can be caught/banned?
     
  5. Essential Clix

    Essential Clix Executive VIP

    Joined:
    Jul 30, 2007
    Messages:
    1,751
    Likes Received:
    2,804
    Location:
    USA
    That's what blackhat is all about ;)
     
  6. zoolmah

    zoolmah Newbie

    Joined:
    Oct 11, 2007
    Messages:
    26
    Likes Received:
    0
    $bannedip = fgets($file, 1024);
    $bip->append();
    bannedhn = fgets($file, 1024);
    $bhn->append();

    are these place right?