[GET] PHP Referral Spoofing

SEO Authority

Senior Member
Joined
Apr 21, 2010
Messages
900
Reaction score
1,125
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($curl, CURLOPT_URL, $url);
  curl_setopt($curl, CURLOPT_USERAGENT, 'Googlebot/2.1 

(+http://www.google.com/bot.html)');
  curl_setopt($curl, CURLOPT_HTTPHEADER, $header);
  curl_setopt($curl, CURLOPT_REFERER, 'http://www.google.com');
  curl_setopt($curl, CURLOPT_ENCODING, 'gzip,deflate');
  curl_setopt($curl, CURLOPT_AUTOREFERER, true);
  curl_setopt($curl, CURLOPT_RETURNTRANSFER, 1);
  curl_setopt($curl, CURLOPT_TIMEOUT, 10);

  $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;
?>
 

Attachments

  • fake.PNG
    fake.PNG
    6 KB · Views: 373
This is awesome! I hope you can finish/recover the IP-passing part of the code.
 
Any update how to use with my simple html page?
should i call the php script
Also waiting for IP spoofing
 
Is it possible to call curl through xhttp? if so, one should be able to spoof the referer with user's ip.
 
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.
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 ;)
 
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($curl, CURLOPT_URL, $url);
  curl_setopt($curl, CURLOPT_PROXY, "174.129.93.87:80");
  curl_setopt($curl, CURLOPT_USERAGENT, $browser);
  curl_setopt($curl, CURLOPT_HTTPHEADER, $header);
  curl_setopt($curl, CURLOPT_REFERER, 'http://www.google.com');
  curl_setopt($curl, CURLOPT_ENCODING, 'gzip,deflate');
  curl_setopt($curl, CURLOPT_AUTOREFERER, true);
  curl_setopt($curl, CURLOPT_RETURNTRANSFER, true);
  curl_setopt($curl, CURLOPT_TIMEOUT, 10);


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

    return $sayfa_data;


}

echo disguise_curl($url);
 
sorry noob here,

can this method use for generate fake traffics as they come from search engine?
 
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.
 
What about HTML page.I already said that.Have any option for HTML ?
 
Hey,I want to use multiple proxy for this so I just need to add after first proxy.Can I use wampserver for this?
 
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
 
Back
Top