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

Simple fake referer script

Discussion in 'CPA' started by 39ster, Nov 27, 2012.

  1. 39ster

    39ster Junior Member

    Joined:
    Dec 12, 2009
    Messages:
    174
    Likes Received:
    58
    I made this little script to make fake referer simple. Name the file "fakereferer.php" and copy paste this script into the file:

    Code:
    <?php
    
    function removeqsvar($url, $varname) {
        return preg_replace('/([?&])'.$varname.'=[^&]+(&|$)/','$1',$url);
    }
    
    if(isset($_GET["l"]))
    {
        $url = $_GET["l"];
        setcookie("redirect", $url);
        $newRequest = removeqsvar($_SERVER["REQUEST_URI"], "l");
        
        if(substr($newRequest, -1) == "?") {
            $newRequest = substr($newRequest, 0, strlen($newRequest) - 1);
        }
        
        $redirectUrl = "http://" . $_SERVER["SERVER_NAME"] . $newRequest;
        header("location: $redirectUrl");
        exit();
    } else if(isset($_COOKIE["redirect"]))
    {
        $url = $_COOKIE["redirect"];
        setcookie("redirect", "");
        echo "<script>window.location.replace(\"$url\")</script>";
        exit();
    }
    ?>
    On your white hat site, put this at the top of the php page (after the "<?php" line) that will be used as the fake referer
    Code:
    include("fakereferer.php");
    So if my white hat url is http://mywhitesite.com/index.php and i want to redirect a link through it, i would do this:

    "http://mywhitesite.com/index.php?l=http%3A%2F%2Fgoogle.com%2F"

    This will redirect me to http://google.com/ and make the referer "http://mywhitesite.com/index.php" (it removes the ?l=blahblah) part.

    NOTE: The part after "?l=" must be encoded using this: http://meyerweb.com/eric/tools/dencoder/


    So, if i was using Content Locker Pro, and i want to add an offer...let's say the url to the offer is http://admedia.com/?offerid=3747 then in CLP i would make the URL of the offer "http://mywhitesite.com/index.php?l=http%3A%2F%2Fadmedia.com%2F%3Fofferid%3D3747". When a user clicks this URL, it will appear as the traffic is coming from "http://mywhitesite.com/index.php"


    If you don't add "?l=blahblah" it will just show the normal white hat site
     
    • Thanks Thanks x 2
    Last edited: Nov 28, 2012
  2. pasenseoso

    pasenseoso Power Member

    Joined:
    Aug 19, 2011
    Messages:
    754
    Likes Received:
    136
    Occupation:
    hachetman
    Location:
    - - P I L I P I N A S - -
    Home Page:
    is there a way to make the url look cleaner?
     
  3. ewwink

    ewwink Newbie

    Joined:
    Feb 6, 2009
    Messages:
    37
    Likes Received:
    8
    you mean like _http://example.com/?go=http://google.com
    try with this code
    Code:
    <?php
    if(isset($_GET["go"])){
      $url = $_GET["go"];
      header("location: $url");
      exit();
    }
    ?>
     
  4. wrayimmediate

    wrayimmediate Junior Member

    Joined:
    Jun 24, 2011
    Messages:
    167
    Likes Received:
    20
    Location:
    Deep in the trenches of YouTube
    hmm, cant get it to work. the link just goes to the white hat page and
    "include("fakereferer.php");" shows up on it. im guessing i have it coded wrong?
     
  5. 39ster

    39ster Junior Member

    Joined:
    Dec 12, 2009
    Messages:
    174
    Likes Received:
    58
    include("fakereferer.php"); must be after the "<?php" line.
     
  6. Abh_Empire

    Abh_Empire Regular Member

    Joined:
    Sep 21, 2010
    Messages:
    220
    Likes Received:
    46
    Location:
    Romania
    Is there a way to show the traffic coming from whitehat.com if you don't actually own the site? :)
    So that if people click on the offer on my site, the referrer would show as whitehat.com.
     
  7. gypsyr0ad

    gypsyr0ad Regular Member

    Joined:
    Aug 11, 2011
    Messages:
    240
    Likes Received:
    281
    I dont get the point of this...
    If your getting said person to click your link to begin with, why would you even need to fake anything?

    Or is this so you can click it yourself and pretend to be your own ref?
     
  8. 39ster

    39ster Junior Member

    Joined:
    Dec 12, 2009
    Messages:
    174
    Likes Received:
    58
    @Abh_Empire
    no because you need to be able to upload this script onto the white hat site and include it into the page that you want to be the referer.

    @gypsyr0ad
    Because a lot of networks have rules about what content can be locked and your traffic sources. Some, such as peerfly, don't even allow incentive. They will ban you and take your unpaid earnings if you break their rules.
     
    Last edited: Nov 29, 2012
  9. wrayimmediate

    wrayimmediate Junior Member

    Joined:
    Jun 24, 2011
    Messages:
    167
    Likes Received:
    20
    Location:
    Deep in the trenches of YouTube
    thanks for the share. im a little confused though...

     
    Last edited: Nov 29, 2012
  10. 39ster

    39ster Junior Member

    Joined:
    Dec 12, 2009
    Messages:
    174
    Likes Received:
    58
    In the same folder that the white hate page is in.

    If there's no line for that, then your white hat page isn;t using PHP. Is the extension .html or .php?
     
  11. MrCom

    MrCom Newbie

    Joined:
    Nov 26, 2012
    Messages:
    8
    Likes Received:
    0
    thank you, it's very useful ..:)
     
  12. wrayimmediate

    wrayimmediate Junior Member

    Joined:
    Jun 24, 2011
    Messages:
    167
    Likes Received:
    20
    Location:
    Deep in the trenches of YouTube
    my white hat pages are just hunky dory, my other fake referer script using php works just fine with them.

    however, I did not have a "<?php" line anywhere so I just added...
    Code:
    <?php
    include("fakereferer.php");
    ?>
    
    ...to the head of my white hat page & your script worked just fine!:D

    thanks given