1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

Free PHP Cloaking Script

Discussion in 'Adwords' started by pearse1916, May 12, 2012.

  1. pearse1916

    pearse1916 Junior Member

    Joined:
    Mar 10, 2009
    Messages:
    181
    Likes Received:
    16
    Home Page:
    I found this while doing some research into php redirects I hope some of you find it useful, not sure if I am going to use it as not sure how effective this is anymore, so any advice on that would be good.

    This script is for the anti-Google! It causes redirects according to four situations: 1) Googlebot visited the page: he was sent to a page 2) Image Googletbot-visit the page: he was sent to a page 3) a user visits the page from Google: just redirect to the page displaying the results for the same query but Yauba, Yahoo or Ixquick 4) a user visits the page by not coming from Google: just redirect to a page All URLs are randomly selected arrays (tables) associative, and are permanent redirects (HTTP code 301). At worst, it displays an HTML page. Some code comes from Article Romain Follet. Warning! Since this script is based on the engine, its use is an SEO strategy including pattern of concealment. You risk being banned from Google's index. I suggest you sacrifice a subdomain of your site to this script if you want to use it safely. In addition, the redirection of visitors without warning is a practical anti-ergonomic to avoid! Edition Sunday, May 31, 2009: * redirects are temporary (if Google does not pass again) * Detection of Google by IP and DNS host ( much more reliable than the signature of the agent-user) * removed the meta refresh redirection for non-AT Google. Page backup script (if Google would place it on black-list).


    Code:
    
    <?php/* STEP 1 : detection if  the visitor comes from Google + catch the query *//* does the visitor comes from Google ? */ if ( isset ($_SERVER["HTTP_REFERER"]) && preg_match('!^http://(www|images)\.google\.[a-z]{2,3}(\.[a-z]{2,3})?/!i', $_SERVER["HTTP_REFERER"]) )    { $isGoogleReferer = true; } else     { $isGoogleReferer = false; } /* if yes, we catch its query (param. q in the URL) */ if ( $isGoogleReferer && preg_match ('!q=([^\&#]*)!i',$_SERVER["HTTP_REFERER"],$matches) )    { $googleQuery = $matches[1]; } else     { $googleQuery = null; } /* if the query were captured, we make it usable */ if ( $googleQuery )    { $googleQuerySanitize =  preg_replace('![^a-z0-9éèàùçÇÉÀÈÙêÊ\s]!i', ' ', rawurldecode($googleQuery) );$google = str_replace("+", " ", $googleQuerySanitize); } else     { $googleQuery = ''; } // END STEP 1 (detection of Google if it's the referer) // credit for this part : most of the code is a // simplier rewriting of a snipet by Romain Follet : // http://www.cooldev.net/article-93-ya-pas-que-google-dans-la-vie.html // thanks to him for this piece of code :D/* STEP 1 BIS : détection of Google by the IP or DNS host */$ip = strval($_SERVER['REMOTE_ADDR']);  // conversion to string$host = gethostbyaddr($ip);$GoogleByHost = false;$GoogleByIP = false ; // default valuesif (preg_match("/crawl-66-249-[\d]{1,3}-[\d]{1,3}\.googlebot\.com/", $host))    {$GoogleByDNS = true;}if (preg_match("/66\.249\.[\d]{1,3}\.[\d]{1,3}/", $ip))    {$GoogleByIP = true;}// END STEP 1 BIS// credits : http://www.actulab.com/identification-des-robots.php// and : http://www.robots.darkseoteam.com/// ----- ----- ----- ----- ----- ----- ----- ----- ----- -----  /* STEP 2 : definig  the redirection URLs*//* URL for Googlebot-Image */$URLsForGooglebotImage = array( "http://www.someurl.net","http://www.someurl.net","http://www.someurl.net"); /* URL for Googlebot */$URLsForGooglebot = array("http://www.someurl.net","http://www.someurl.net","http://www.someurl.net");  /* building the same query in others search engines */$sameQueryButInYauba = "http://www.yauba.com/?q={$googleQuery}&target=all";$sameQueryButInYahoo ="http://search.yahoo.com/search?p={$googleQuery}";$sameQueryButInIxquick = "http://ixquick.com/do/metasearch.pl?query={$googleQuery}&cat=web&pl=ff&language=english";/* URLS to which people coming not from Google will be redirected */$UrlsForThoseComingFromGoogle = array("$sameQueryButInYauba","$sameQueryButInYauba","$sameQueryButInYauba","$sameQueryButInYauba","$sameQueryButInYauba","$sameQueryButInYahoo", "$sameQueryButInYahoo", "$sameQueryButInYahoo","$sameQueryButInIxquick", "$sameQueryButInIxquick"); // Yauba 50%, Yahoo 30%, Ixquick 20%/* URL pfor the other visitors */$UrlsForThoseComingNotFromGoogle = array( "http://www.someurl.net","http://www.someurl.net","http://www.someurl.net"); // END STEP 2 (defining redirection URLs)// ----- ----- ----- ----- ----- ----- ----- ----- ----- -----/* STEP 3 : detection of the user-agent *//* looking for "Googlebot-Image" or "Googlebot" in the signature of the UA */$IsGooglebotImage = strpos($_SERVER["HTTP_USER_AGENT"],"Googlebot-Image");$IsGooglebot = strpos($_SERVER["HTTP_USER_AGENT"],"Googlebot");// END STEP 3// ----- ----- ----- ----- ----- ----- ----- ----- ----- -----/* STEP 4 : redirection *//* if UA is Googlebot ou Googlebot-Image */if ($GoogleByDNS || $GoogleByIP || $IsGooglebot !== false) {    if ($GoogleByIP || $GoogleByDNS)    {    /* choosing an url randomly */    $indice = array_rand($URLsForGooglebot);    $destinationFinale = $URLsForGooglebot[$indice];    }    /* is the UA is Googlebot-Image */     elseif ($IsGooglebotImage !== false)     {    $indice = array_rand($URLsForGooglebotImage);    $destinationFinale = $URLsForGooglebotImage[$indice];     }    /* if UA is Googlebot (normal) */    else    {            /* chosing randomly one URL */            $indice = array_rand($URLsForGooglebot);            $finalDestination = $URLsForGooglebot[$indice];    }    /* final operation in case of Google visiting the page */ header("Location: ".$finalDestination."",TRUE,302);    echo '<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN""http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"><html xmlns="http://www.w3.org/1999/xhtml" xml:lang="mis"><head>    <title>Content</title>    <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />     <meta http-equiv="refresh" content="0;URL='.$finalDestination.'"></head><body><p><a href="'.$finalDestination.'" rel="me">my website</a>.</p></body></html>';} // END id UA is Googlebot or Googlebot-Image /* if UA is no Googlebot */else {    /* if visitor comes form Google */    if ($isGoogleReferer && $googleQuery)     {            $indice = array_rand($UrlsForThoseComingFromGoogle);            $finalDestination = $UrlsForThoseComingFromGoogle[$indice];    }    /* if not from Google */    else     {            $indice = array_rand($UrlsForThoseComingNotFromGoogle);            $finalDestination = $UrlsForThoseComingNotFromGoogle[$indice];    }/* finale operation : redirecting */header("Location: ".$finalDestination."",TRUE,302);}// END STEP 4 (redirection) // ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- exit;?><!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN""http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"><html xmlns="http://www.w3.org/1999/xhtml" xml:lang="fr"><head>    <title>First name NAME</title>    <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" /></head><body><p><a href="http://wwww.mywebsite.net" rel="me">my web site</a>.</p></body> 
    </html>
     
    • Thanks Thanks x 1
  2. pearse1916

    pearse1916 Junior Member

    Joined:
    Mar 10, 2009
    Messages:
    181
    Likes Received:
    16
    Home Page:
    This one cloaks by ip and dns

    Code:
    # Free PHP script to sniff Google or people coming from this search engine# Feel free to use this cloaking script ! (Licence CC BY.)
    # HTML version : http://mathiaspoujolrost.net/phpsources.org/scripts512-PHP_pieger-tromper-google-deceive-mislead.php
    
    
    /* STEP 1 : detection if  the visitor comes from Google + catch the query */
    /* does the visitor comes from Google ? */ 
    if ( isset ($_SERVER["HTTP_REFERER"]) && 
    preg_match('!^http://(www|images)\.google\.[a-z]{2,3}(\.[a-z]{2,3})?/!i', 
    $_SERVER["HTTP_REFERER"]) )
        { $isGoogleReferer = true; } 
    else     { $isGoogleReferer = false; } 
    
    
    /* if yes, we catch its query (param. q in the URL) */ 
    if ( $isGoogleReferer && preg_match ('!q=([^\&#]*)!i',$_SERVER["HTTP_REFERER"],
    $matches) )
        { $googleQuery = $matches[1]; } 
    else     { $googleQuery = null; } 
    
    
    /* if the query were captured, we make it usable */ 
    if ( $googleQuery )
        { $googleQuerySanitize =  preg_replace('![^a-z0-9Žˆ‚ƒËéôæ\s]!i', 
    ' ', rawurldecode($googleQuery) );
    $google = str_replace("+", " ", $googleQuerySanitize); } 
    else     { $googleQuery = ''; } 
    // END STEP 1 (detection of Google if it's the referer) 
    // credit for this part : most of the code is a 
    // simplier rewriting of a snipet by Romain Follet : 
    // http://www.cooldev.net/article-93-ya-pas-que-google-dans-la-vie.html 
    // thanks to him for this piece of code :D
    
    
    /* STEP 1 BIS : dŽtection of Google by the IP or DNS host */
    $ip = strval($_SERVER['REMOTE_ADDR']);  // conversion to string
    $host = gethostbyaddr($ip);
    
    
    $GoogleByHost = false;
    $GoogleByIP = false ; // default values
    
    
    if (preg_match("/crawl-66-249-[\d]{1,3}-[\d]{1,3}\.googlebot\.com/", $host))
        {$GoogleByDNS = true;}
    
    
    if (preg_match("/66\.249\.[\d]{1,3}\.[\d]{1,3}/", $ip))
        {$GoogleByIP = true;}
    // END STEP 1 BIS
    // credits : http://www.actulab.com/identification-des-robots.php
    // and : http://www.robots.darkseoteam.com/
    // ----- ----- ----- ----- ----- ----- ----- ----- ----- -----
     
     
    /* STEP 2 : definig  the redirection URLs*/
    /* URL for Googlebot-Image */
    $URLsForGooglebotImage = array( 
    "http://www.someurl.net",
    "http://www.someurl.net",
    "http://www.someurl.net"
    ); 
    
    
    /* URL for Googlebot */
    $URLsForGooglebot = array(
    "http://www.someurl.net",
    "http://www.someurl.net",
    "http://www.someurl.net"
    ); 
     
    /* building the same query in others search engines */
    $sameQueryButInYauba = "http://www.yauba.com/?q={$googleQuery}&target=all";
    $sameQueryButInYahoo ="http://search.yahoo.com/search?p={$googleQuery}";
    $sameQueryButInIxquick = "http://ixquick.com/do/metasearch.pl?query=
    {$googleQuery}&cat=web&pl=ff&language=english";
    
    
    /* URLS to which people coming not from Google will be redirected */
    $UrlsForThoseComingFromGoogle = array(
    "$sameQueryButInYauba",
    "$sameQueryButInYauba",
    "$sameQueryButInYauba",
    "$sameQueryButInYauba",
    "$sameQueryButInYauba",
    "$sameQueryButInYahoo", 
    "$sameQueryButInYahoo", 
    "$sameQueryButInYahoo",
    "$sameQueryButInIxquick", 
    "$sameQueryButInIxquick"
    ); // Yauba 50%, Yahoo 30%, Ixquick 20%
    
    
    /* URL pfor the other visitors */
    $UrlsForThoseComingNotFromGoogle = array( 
    "http://www.someurl.net",
    "http://www.someurl.net",
    "http://www.someurl.net"
    ); 
    // END STEP 2 (defining redirection URLs)
    // ----- ----- ----- ----- ----- ----- ----- ----- ----- -----
    
    
    
    
    /* STEP 3 : detection of the user-agent */
    /* looking for "Googlebot-Image" or "Googlebot" in the signature of the UA */
    $IsGooglebotImage = strpos($_SERVER["HTTP_USER_AGENT"],"Googlebot-Image");
    $IsGooglebot = strpos($_SERVER["HTTP_USER_AGENT"],"Googlebot");
    // END STEP 3
    // ----- ----- ----- ----- ----- ----- ----- ----- ----- -----
    
    
    
    
    /* STEP 4 : redirection */
    /* if UA is Googlebot ou Googlebot-Image */
    if ($GoogleByDNS || $GoogleByIP || $IsGooglebot !== false) 
    {
        if ($GoogleByIP || $GoogleByDNS)
        {
    	/* choosing an url randomly */
    	$indice = array_rand($URLsForGooglebot);
    	$destinationFinale = $URLsForGooglebot[$indice];
        }
        /* is the UA is Googlebot-Image */ 
        elseif ($IsGooglebotImage !== false) 
        {
    	$indice = array_rand($URLsForGooglebotImage);
    	$destinationFinale = $URLsForGooglebotImage[$indice]; 
        }
        /* if UA is Googlebot (normal) */
        else
        {
                /* chosing randomly one URL */
                $indice = array_rand($URLsForGooglebot);
                $finalDestination = $URLsForGooglebot[$indice];
        }
        
    /* final operation in case of Google visiting the page */ 
    header("Location: ".$finalDestination."",TRUE,302);    
    echo '<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
    "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
    <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="mis">
    <head>
        <title>Content</title>
        <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
         <meta http-equiv="refresh" content="0;URL='.$finalDestination.'">
    </head>
    <body>
    <p><a href="'.$finalDestination.'" rel="me">my web site</a>.</p>
    </body>
    </html>
    ';
    } // END if UA is Googlebot or Googlebot-Image 
    
    
    /* if UA is no Googlebot */
    else 
    {
        /* if visitor comes form Google */
        if ($isGoogleReferer && $googleQuery) 
        {
                $indice = array_rand($UrlsForThoseComingFromGoogle);
                $finalDestination = $UrlsForThoseComingFromGoogle[$indice];
        }
        /* if not from Google */
        else 
        {
                $indice = array_rand($UrlsForThoseComingNotFromGoogle);
                $finalDestination = $UrlsForThoseComingNotFromGoogle[$indice];
        }
    /* final operation : redirecting */
    header("Location: ".$finalDestination."",TRUE,302);
    }
    // END STEP 4 (redirection) 
    // ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- 
    exit;
    
    
    ?>
    !DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
    "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
    <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="fr">
    <head>
        <title>First name Name</title>
        <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
    </head>
    <body>
    <p><a href="http://wwww.mywebsite.net" rel="me">my website</a>.</p>
    </body>
    </html>
    
    
    
    
    # END of the script
    
    
    
     
  3. john78544

    john78544 Newbie

    Joined:
    Oct 19, 2011
    Messages:
    27
    Likes Received:
    0
    interesting idea... I found out about this trick from amish shah seminar
     
  4. BlackTagine

    BlackTagine BANNED BANNED

    Joined:
    Aug 24, 2011
    Messages:
    378
    Likes Received:
    33
    Noobish question : Can this be modified to bypass the adword review for an affiliate landing page ??Otherwise can you guys share such script ??
     
  5. sonicpunk32

    sonicpunk32 Regular Member

    Joined:
    Dec 22, 2009
    Messages:
    331
    Likes Received:
    472
    I would also like to know this as well.
     
  6. re2020

    re2020 Newbie

    Joined:
    Apr 7, 2012
    Messages:
    28
    Likes Received:
    2
    i can use this with adfly
     
  7. MINION007

    MINION007 Newbie

    Joined:
    Feb 22, 2014
    Messages:
    22
    Likes Received:
    3
    Occupation:
    Technical Officer @ My Own Firm
    Location:
    Minion House
    thanks for the share mate
     
  8. AlreadyBanned

    AlreadyBanned BANNED BANNED

    Joined:
    Sep 13, 2013
    Messages:
    873
    Likes Received:
    139
    Congratulations on getting 15 posts & GTFO for spamming this forum with useless posts !
     
  9. myplaysoft

    myplaysoft Newbie

    Joined:
    Feb 18, 2014
    Messages:
    8
    Likes Received:
    1
    Location:
    Aye
    Home Page:
    the purpose of this script appears very obscure to me: why anybody in this world would want to send traffic from google to Yauba?

    here:
    php has a native function named parse_url that does a lot better the job (returns an array with all URL components from where you can extract host).

    and this block of code detects nothing (or almost):
    because gethostbyaddr may fail or send unreliable data and the patterns given:
    crawl-66-249-[\d]{1,3}-[\d]{1,3}\.googlebot\.c *o*m and
    66\.249\.[\d]{1,3}\.[\d]{1,3}

    are of a little relevance.

    But maybe I couldn't understand it as I should, please provide details if possible.
     
  10. UnoUltimo

    UnoUltimo Regular Member

    Joined:
    Jan 20, 2014
    Messages:
    267
    Likes Received:
    5
    Location:
    Humhama
    Damn, this whole thread a Cr*P and full of m*r*ns...This belongs to cloaking section.
     
  11. robertdicosta

    robertdicosta Newbie

    Joined:
    Apr 4, 2014
    Messages:
    1
    Likes Received:
    0
    Can anyone help me in customizing the script as per my requirement, I can pay upto $100 for this.

    PM me if anyone interested.

    thanks..
     
  12. Bileks

    Bileks BANNED BANNED

    Joined:
    Jan 30, 2015
    Messages:
    138
    Likes Received:
    80
    What is your requirement. What niche you want to run and on what network ? Let me know.

    Thanks!
     
  13. Vasim Shaikh

    Vasim Shaikh Newbie

    Joined:
    Jul 5, 2016
    Messages:
    7
    Likes Received:
    0
    Gender:
    Male
    I am running a tech support business for USA and I need a cloaking script for my website. Let me know if someone can help me with this. I have fair knowledge about html but I have 0 knowledge about php. I am ready to pay.
     
  14. Ganie

    Ganie Regular Member

    Joined:
    Oct 14, 2015
    Messages:
    408
    Likes Received:
    77
    Gender:
    Male
    Occupation:
    IM'er
    Location:
    106.192.181.5
    And you know that you just bumped a 4 years OLD Thread ?
    That's classified as SPAM in here !
    Post Reported !