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

[GET] PHP Referral Spoofing

Discussion in 'Cloaking and Content Generators' started by SEO Authority, Sep 11, 2010.

  1. SEO Authority

    SEO Authority Senior Member

    Joined:
    Apr 21, 2010
    Messages:
    808
    Likes Received:
    1,081
    I've been searching on many forums and places for a way to Spoof referrers. This is a method that has worked for me. If you test it against a page on your host, and then verify with live visitors. You will notice the fake referrer.

    There's another part of the script, which uses the visitor's IP address instead of your host. I was developing it and I have lost it since my harddrive failed.

    Below is the script:

    PHP:
    <?

    $url 'http://www.yourpage.com';

    // disguises the curl using fake headers and a fake user agent.
    function disguise_curl($url)
    {
      
    $curl curl_init();

      
    // Setup headers - I used the same headers from Firefox version 2.0.0.6
      // below was split up because php.net said the line was too long. :/
      
    $header[0] = "Accept: text/xml,application/xml,application/xhtml+xml,";
      
    $header[0] .= "text/html;q=0.9,text/plain;q=0.8,image/png,*/*;q=0.5";
      
    $header[] = "Cache-Control: max-age=0";
      
    $header[] = "Connection: keep-alive";
      
    $header[] = "Keep-Alive: 300";
      
    $header[] = "Accept-Charset: ISO-8859-1,utf-8;q=0.7,*;q=0.7";
      
    $header[] = "Accept-Language: en-us,en;q=0.5";
      
    $header[] = "Pragma: "// browsers keep this blank.

      
    curl_setopt($curlCURLOPT_URL$url);
      
    curl_setopt($curlCURLOPT_USERAGENT'Googlebot/2.1 

    (+http://www.google.com/bot.html)'
    );
      
    curl_setopt($curlCURLOPT_HTTPHEADER$header);
      
    curl_setopt($curlCURLOPT_REFERER'http://www.google.com');
      
    curl_setopt($curlCURLOPT_ENCODING'gzip,deflate');
      
    curl_setopt($curlCURLOPT_AUTOREFERERtrue);
      
    curl_setopt($curlCURLOPT_RETURNTRANSFER1);
      
    curl_setopt($curlCURLOPT_TIMEOUT10);

      
    $html curl_exec($curl); // execute the curl command
      
    curl_close($curl); // close the connection

      
    return $html// and finally, return $html
    }

    // uses the function and displays the text off the website
    $text disguise_curl($url);
    echo 
    $text;
    ?> 
     

    Attached Files:

    • Thanks Thanks x 5
  2. tomcw5

    tomcw5 Newbie

    Joined:
    Jan 30, 2010
    Messages:
    1
    Likes Received:
    0
    This is awesome! I hope you can finish/recover the IP-passing part of the code.
     
  3. neonman

    neonman Newbie

    Joined:
    Dec 29, 2009
    Messages:
    30
    Likes Received:
    3
    Any update how to use with my simple html page?
    should i call the php script
    Also waiting for IP spoofing
     
  4. smallfry

    smallfry BANNED BANNED

    Joined:
    Jul 28, 2010
    Messages:
    62
    Likes Received:
    1
    Is it possible to call curl through xhttp? if so, one should be able to spoof the referer with user's ip.
     
  5. scriptkiddies

    scriptkiddies Junior Member

    Joined:
    Aug 5, 2008
    Messages:
    121
    Likes Received:
    207
    Little up for this interressing tool : )

    Any news candybar please ?

    thanks
     
  6. entri3

    entri3 Elite Member

    Joined:
    Mar 26, 2008
    Messages:
    1,904
    Likes Received:
    418
    Yes, the Ip-passing part will be great
     
  7. seah51

    seah51 Newbie

    Joined:
    Jan 12, 2009
    Messages:
    14
    Likes Received:
    2
    thanks for sharing
     
  8. Crazy

    Crazy Jr. Executive VIP

    Joined:
    Jun 13, 2009
    Messages:
    640
    Likes Received:
    319
    Occupation:
    VB, C#, XHTML, CSS, PHP, MySQL, JavaScript, jQuery
    Location:
    Everywhere
    I'd love to see this done. As far as I can see it, it's impossible to achieve that with cURL. Post it when you can bud. I'll even pay for that ;)
     
    • Thanks Thanks x 1
  9. meannn

    meannn Supreme Member

    Joined:
    Apr 22, 2009
    Messages:
    1,461
    Likes Received:
    1,898
    Occupation:
    Unemployed Winner
    Location:
    TR
    1- Yes referrer seems from google, however, ip seems as your server ip. Means that you should use proxy with that.

    curl_setopt($ch, CURLOPT_PROXY, "174.129.93.87:80");

    2- Your code is wrong. Gives 400 Bad Request error.
    3- Working code should be this:

    PHP:

    $url 
    'http://www.site.com/page.php';

    function 
    disguise_curl($url)
    {

     
    $browser $_SERVER['HTTP_USER_AGENT'];
     
    $curl curl_init();

      
    $header[0] = "Accept: text/xml,application/xml,application/xhtml+xml,";
      
    $header[0] .= "text/html;q=0.9,text/plain;q=0.8,image/png,*/*;q=0.5";
      
    $header[] = "Cache-Control: max-age=0";
      
    $header[] = "Connection: keep-alive";
      
    $header[] = "Keep-Alive: 300";
      
    $header[] = "Accept-Charset: ISO-8859-1,utf-8;q=0.7,*;q=0.7";
      
    $header[] = "Accept-Language: en-us,en;q=0.5";
      
    $header[] = "Pragma: "// browsers keep this blank.

      
    curl_setopt($curlCURLOPT_URL$url);
      
    curl_setopt($curlCURLOPT_PROXY"174.129.93.87:80");
      
    curl_setopt($curlCURLOPT_USERAGENT$browser);
      
    curl_setopt($curlCURLOPT_HTTPHEADER$header);
      
    curl_setopt($curlCURLOPT_REFERER'http://www.google.com');
      
    curl_setopt($curlCURLOPT_ENCODING'gzip,deflate');
      
    curl_setopt($curlCURLOPT_AUTOREFERERtrue);
      
    curl_setopt($curlCURLOPT_RETURNTRANSFERtrue);
      
    curl_setopt($curlCURLOPT_TIMEOUT10);


        
    $sayfa_data curl_exec($curl);
        
    curl_close($curl);

        return 
    $sayfa_data;


    }

    echo 
    disguise_curl($url);

     
  10. weiliang

    weiliang Newbie

    Joined:
    Mar 31, 2011
    Messages:
    2
    Likes Received:
    0
    sorry noob here,

    can this method use for generate fake traffics as they come from search engine?
     
  11. jason2009

    jason2009 Senior Member

    Joined:
    Apr 23, 2010
    Messages:
    1,014
    Likes Received:
    210
    Occupation:
    Student
    Location:
    Earth
    Thanks for sharing.How can i add this at HTML website
     
    • Thanks Thanks x 1
  12. tolQu

    tolQu Newbie

    Joined:
    Dec 25, 2010
    Messages:
    33
    Likes Received:
    9
    It works, thanks ;]
     
  13. Bremenhawtster

    Bremenhawtster Junior Member

    Joined:
    Sep 28, 2009
    Messages:
    140
    Likes Received:
    20
    Looks great I'm gunna try it out later today :D
     
  14. harlekinboss

    harlekinboss Newbie

    Joined:
    Apr 27, 2011
    Messages:
    25
    Likes Received:
    3
    Location:
    $ pwd
    and for what kind of stuff is it interesting to spoof the referrers ?
     
  15. marketer14

    marketer14 Regular Member

    Joined:
    Nov 2, 2010
    Messages:
    310
    Likes Received:
    41
    Home Page:
    Is this script to be used if you want to hide the referer to your domain site? I'm looking for a way to do that.
     
  16. hardcoreblackhater

    hardcoreblackhater Newbie

    Joined:
    May 4, 2010
    Messages:
    16
    Likes Received:
    2
    nice piece of code
     
  17. jason2009

    jason2009 Senior Member

    Joined:
    Apr 23, 2010
    Messages:
    1,014
    Likes Received:
    210
    Occupation:
    Student
    Location:
    Earth
    What about HTML page.I already said that.Have any option for HTML ?
     
  18. rrkjaiswal63

    rrkjaiswal63 Junior Member

    Joined:
    Jul 25, 2010
    Messages:
    164
    Likes Received:
    37
    Occupation:
    Software developer in fortune 500 company and Webm
    Location:
    Brazil
    Home Page:
    Hey,I want to use multiple proxy for this so I just need to add after first proxy.Can I use wampserver for this?
     
  19. SEO Authority

    SEO Authority Senior Member

    Joined:
    Apr 21, 2010
    Messages:
    808
    Likes Received:
    1,081
    Funny, I'm starting a new campaign and was googling for PHP referrals, and didn't know I wrote a post on it myself lol
     
  20. dakica

    dakica Junior Member Premium Member

    Joined:
    Nov 14, 2009
    Messages:
    115
    Likes Received:
    36
    thanks for the share
     
    • Thanks Thanks x 1