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

[TUT and CODE][UPDATED 2013] How to Fake your Referer, Fake Referrer Script

Discussion in 'Making Money' started by JohnsonDaniel, Jul 6, 2013.

  1. JohnsonDaniel

    JohnsonDaniel Regular Member

    Joined:
    May 16, 2008
    Messages:
    389
    Likes Received:
    1,390
    Location:
    In a bright place---------------------------------
    This is an update to this thread, posted in 2011:

    [TUT and CODE]★★★ How to Fake your Referer, Fake Referer Any Offer, Fake Referrer Script

    In that thread there were two issues:

    1. Some of the code resulted in junk being appended to the link if there were no parameters used.
    The code was then updated to fix that, on the 2nd page, but, so many posts on, it's hard to find.

    2. The code used the split() function, which has since been deprecated in more recent PHP versions.
    Unless PHP error warnings were set to "OFF" via php.ini or .htaccess, this deprecated function caused warnings
    to be displayed.

    What THIS thread contains is a copy-paste of the details and explanations from the previous thread,
    but with
    updated code, which
    corrects the two issues explained above.


    Here is a script I made for Content Lock Pro buyers which will provide Fake Referer functionality.

    I have decided to share with BHW for free - awesome for when you don't quite have
    the <cough> right <cough> type of traffic :)

    It will allow you to fake http referer when sending traffic.
    Spoof referer, fake http refer, fake referrer, they can all be done.

    We all know the value of a decent solution, and this one works in all
    browsers tested so far.

    Reports on further test results are welcomed in this thread.

    The requirement:

    Transfer, including any parameters (even dynamically generated) to a
    destination link, whilst replacing the original referer info in the surfer's
    browser to a new referer of our choice.

    Self-host the script which will handle the transfer.

    If the script is hosted on
    HTML:
    http://handler.com
    construct fake referer urls like:
    HTML:
    http://handler.com/?url=http://DestUrlIncludingParameters&referer=http://FakeRefUrl
    Steps to Make this work for you:

    1. Save the following code as index.php and upload to the domain of your choice. The domain will "handle" the redirections, and will not be seen:

    PHP:
    <?php
    // Extract URI minus http://handlerdomain.com/
    $full_url urldecode($_SERVER['REQUEST_URI']);
    // Extract urls we need
    $l strlen($full_url);
    $p_referer strpos ($full_url'referer=');
    $p_dest_2 $p_referer 1;
    $p_referer strpos ($full_url'=',$p_referer) + 1;
    $url_referer substr ($full_url $p_referer);
    $p_dest_1 strpos ($full_url'=') + 1;
    $l $p_dest_2 $p_dest_1;
    $url_dest substr ($full_url $p_dest_1$l);

    // Create self-posting form.
    if ($url_referer != '') {
        echo 
    '<html><head><META NAME="ROBOTS" CONTENT="NOINDEX, NOFOLLOW"></head><body>
        <form action="'
    .urldecode($url_referer).'" method="post" id="myform">
        <input type="hidden" name="ref_spoof" value="'
    .urldecode($url_dest).'">
        </form><script language="JavaScript"> document.getElementById('
    myform').submit();</script></body></html>';
    } else {
        echo 
    'You must provide a referer';
    }
    ?>
    2. Insert the following code in any page (must either be a php page, or an
    html page on a server which will execute php code within html files), any
    WP page or post, or, if wanting to be able to use "any" post on your WP
    blog as your referer, insert it in the WP header.php file (this will even permit
    a fake referer to be a post which doesn't actually exist):

    PHP:
    <?php
    if ($_POST['ref_spoof'] != NULL) {
        
    $offer urldecode($_POST['ref_spoof']);
        
    $p1 strpos ($offer'?') + 1;
        
    $url_par substr ($offer $p1);
        
    $paryval explode ('&'$url_par);
        
    $p = array();
        foreach (
    $paryval as $value) {
            
    $p[] = explode ('=',$value);
        }
        echo
    '<html><head><META NAME="ROBOTS" CONTENT="NOINDEX, NOFOLLOW"></head><body><form action="'.$offer.'" method="get" id="myform">';
        if (
    $p1 != 1) {
        foreach (
    $p as $value) {
            echo 
    '<input type="hidden" name="'.$value[0].'" value="'.$value[1].'">';
        }
        }
        echo 
    '</form><script language="JavaScript"> document.getElementById('myform').submit();</script></body></html>';
    }
    ?>
    3. Usage:

    Say, for example, you upload the first file, as index.php, to handler.com,
    and you place the second code in a Wordpress Header.php, on myfavewpsite.com, which, say,
    has a post like: myfavewpsite.com/post-with-ads.

    Now, you want to send your visitors to this offer link:

    http://myCPAnetwork.com?oid=12345&pid=6789&sid=yy7456

    The link you would post or display or send your visitors to would be:

    HTML:
    http://handler.com/?url=http://myCPAnetwork.com?oid=12345&pid=6789&sid=yy7456&referer=http://myfavewpsite.com/post-with-ads
    As mentioned above, tests are welcomed, but please, if using or testing, post observed results, and
    leaks, if any (there shouldn't be, ever) in this thread.

    Also, this will not work to use ASP-based pages as the fake referer, the page must be able to interpret php
    code (most servers do).

    Finally, if you end up on a 403-Forbidden page, you need to ask your host to add an exception rule to MOD_Security to allow PHP redirections.


    Feel free to check other threads started by me to find my other shares:

    1. Content Locking Methods to make $$$ per day:

    a) [METHOD Step-by-Step with CODE] My Twisted Method to $1k+ a week - NOOB friendly

    b)
    My Twist to Content Locking for $80 a day

    2. Yourls Plugin, Shorten a Url, Iframe the Destination, and Execute Code (locker or other code):

    a) [SCRIPT] Shortener with iFrame and any code you like - Gauging interest, will release free

    b)
    [GET] Plugin - Url Shortener - Create Iframe Of Long Url - Lock It Or Call Any Code

    3. Use your US-based VPS as a secure VPN for your private use.

    [METHOD] Got Server/VPS? Need an IP? Private VPN on your Server

    4. Send postbacks from your OWN thank-you page to any postback script or
    url (thank-you for completing offer, for submitting email, whatever):

    [SHARE] Set up postbacks for conversion tracking. No Tracking = No Money!

    ENJOY!

    If you like my stuff, please post on the threads with your thoughts, your mods, your methods or your spins.

    Please - no PMs, keep questions to the relevant threads.
     
    • Thanks Thanks x 34
  2. Mr.Whitehat

    Mr.Whitehat Senior Member

    Joined:
    Apr 23, 2009
    Messages:
    857
    Likes Received:
    221
    Occupation:
    Affiliate Marketer
    Location:
    Canada
    Thats a great share :)
     
  3. lietuvis002

    lietuvis002 BANNED BANNED

    Joined:
    Aug 3, 2012
    Messages:
    2,415
    Likes Received:
    2,578
    Awesome share :)
     
  4. Vic Sage

    Vic Sage Jr. VIP Jr. VIP

    Joined:
    Sep 5, 2010
    Messages:
    1,786
    Likes Received:
    2,168
    Gender:
    Male
    Occupation:
    Franklin Hattchet Method
    Location:
    Franklin Hattchet Method
    Home Page:
    Extra ordinary......BIG thanks to op.
     
  5. densoya

    densoya Regular Member

    Joined:
    Feb 23, 2012
    Messages:
    291
    Likes Received:
    75
    Damn... I'd like to learn this but I have no time. What's the difference in using this script with Easy Redirect Script? I am using easy redirect for a year now but I want to know this as well.

    Thanks for your answers!
     
  6. JohnsonDaniel

    JohnsonDaniel Regular Member

    Joined:
    May 16, 2008
    Messages:
    389
    Likes Received:
    1,390
    Location:
    In a bright place---------------------------------
    I'm not familiar with that script but I can see two main differences:

    1. It's $77! Mine is shared FREE

    &

    2. Looks to me like that script is used to hide your destination from your traffic. i.e. so your traffic doesn't know where they will end up, nor do they know you're an affiliate.
    My script is used to hide your traffic sources from the destination, ie so the owner (advertiser or Network) of your affiliate offer does not know where your traffic is coming from.
    In this regard, they have opposite functionality.

     
    • Thanks Thanks x 1
  7. MrBeastsOnToast

    MrBeastsOnToast Jr. VIP Jr. VIP

    Joined:
    Dec 17, 2011
    Messages:
    1,015
    Likes Received:
    547
    Location:
    The Internetz
    just implemented this and the redirect is not working as it should - it redirects to the referrer. also you need to escape ('myform')

    Edit: Now redirects as it should - its been a long day! but you still need to escape
    ('myform'), replace all instances of ('myform') with (\'myform\')
     
    • Thanks Thanks x 1
    Last edited: Aug 2, 2013
  8. exmaster

    exmaster Newbie

    Joined:
    Aug 2, 2013
    Messages:
    22
    Likes Received:
    3
    Location:
    Online
    nice share

    thanks to op for sharing with us
     
  9. domainmadness

    domainmadness Senior Member

    Joined:
    Jun 22, 2011
    Messages:
    1,107
    Likes Received:
    350

    I just implemented this also and yes, it redirects to the referrer. How did you fixed it?
     
  10. JohnsonDaniel

    JohnsonDaniel Regular Member

    Joined:
    May 16, 2008
    Messages:
    389
    Likes Received:
    1,390
    Location:
    In a bright place---------------------------------
    That's normally caused by MOD_Security. Just ask your host to enable a MOD_Sec rule to allow PHP redirections and it should then work.
     
  11. nanavlad

    nanavlad Jr. VIP Jr. VIP

    Joined:
    Dec 2, 2009
    Messages:
    2,488
    Likes Received:
    921
    Gender:
    Male
    Occupation:
    SEO Consultant
    Location:
    Proxy Central
  12. umerjutt00

    umerjutt00 Jr. VIP Jr. VIP

    Joined:
    Oct 28, 2011
    Messages:
    3,822
    Likes Received:
    2,061
    Occupation:
    Ninja
    Well let's say if I don't enter anything for the referrer filed, then will it blank the referrer?
     
  13. Aldavero

    Aldavero Newbie

    Joined:
    Jul 29, 2013
    Messages:
    19
    Likes Received:
    3
    Occupation:
    Student
    Location:
    Spain
    Hey nice script!
    I've tried to implement it and I get this error:

    Parse error: syntax error, unexpected 'myform' (T_STRING), expecting ',' or ';' in /home/xxxxx/public_html/index.php on line 19
     
  14. JohnsonDaniel

    JohnsonDaniel Regular Member

    Joined:
    May 16, 2008
    Messages:
    389
    Likes Received:
    1,390
    Location:
    In a bright place---------------------------------
    No, search my username for threads started by me...I shared a referer blanker which you should use instead

    Try escaping 'myform' as suggested by another user (i.e. replace 'myform' with \'myform\')
     
  15. umerjutt00

    umerjutt00 Jr. VIP Jr. VIP

    Joined:
    Oct 28, 2011
    Messages:
    3,822
    Likes Received:
    2,061
    Occupation:
    Ninja
  16. MadVlad

    MadVlad Newbie

    Joined:
    Oct 13, 2011
    Messages:
    40
    Likes Received:
    3
    Hi
    First, thank you for the script.

    I was wandering if you could help me.
    I made a fake referral script that rotates url's randomly and it works fine.
    Now I would like to add a fake referrer and user agents in it.
    I found some tutorials online (using PHP, curl and javascript) but since I am not that great with the code yet I don't understand how to proceed.
    The guy gave the code but didin't say if it has to be in the same file and I don't know where the referring url's go and user agents ...
    I wonder if you have an idea how to proceed about it?
     
  17. Andres128

    Andres128 Newbie

    Joined:
    Aug 15, 2012
    Messages:
    16
    Likes Received:
    0
    Thanks, great share friend.

    :)
     
  18. scysys

    scysys Newbie

    Joined:
    Oct 19, 2013
    Messages:
    2
    Likes Received:
    0
    Not working, always redirects to Referer. (mod_security) is disabled.
     
  19. scysys

    scysys Newbie

    Joined:
    Oct 19, 2013
    Messages:
    2
    Likes Received:
    0
    I can´t edit, so i must reply.

    ---
    (Anything is working now, i have make an mistake.)

    Sometimes the redirect, redirects to url´s such domain.com/?

    How can i fix this?

    Thanks for your Script :)
     
  20. Baasje

    Baasje Registered Member

    Joined:
    Apr 9, 2011
    Messages:
    89
    Likes Received:
    15
    Location:
    Tampa, Florida
    Hi JohnsonDaniel, first of all, thanks you for this wonderful script, it works like a charm, except for one thing;

    As mentioned here above sometimes a "?" is added at the end of the URL and therefor some of my affiliate links don't work. It would be amazing if you could help us out with a fix :)

    Thanks in advance!