ineedmoney1
Power Member
- Dec 13, 2008
- 503
- 109
i tried it on a different WP blog of mine and it worked perfectly. must be something conflicting on my other WP blog. Thanks for the help.
Johnson, do u have solution for faking ref without placing any code on domain of destination (referral) page ?
For example: I want to send traffic to CPA offer but for referral want to use google.com
Hey johnson thanks so much for the share! I just had a quick question about the second piece of code. I would like to put it into a wordpress post, page or in the header but i dont know where exactly to place the code.
What php file should i place the code into? Where is the header file exactly? Wgere exactly do i put the php code in he wordpress post? Thanks so much in advance!
<?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="track_web" value="'.urldecode($url_dest).'">
</form><script language="JavaScript"> document.getElementById(\'myform\').submit();</script></body></html>';
} else {
echo 'Tracking website';
}
?>
<html>
<head>
<?php
if ($_POST['track_web'] != NULL) {
$offer = urldecode($_POST['track_web']);
$p1 = strpos ($offer, '?') + 1;
$url_par = substr ($offer , $p1);
$paryval = split ('&', $url_par);
$p = array();
foreach ($paryval as $value) {
$p[] = split ('=',$value);
}
echo'<html><head><META NAME="ROBOTS" CONTENT="NOINDEX, NOFOLLOW"></head><body><form action="'.$offer.'" method="get" id="myform">';
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>';
}
?>
</head>
<body>
Website Content
</body>
</html>
http://handler.com?url=http://desired-destination.com¶ms&referer=http://fakereferer.com/subdomain
EDIT: I got it working! I am so happy! It took me probably 30 hours of messing around with the url formatting and mod_ security and everything but I finally got it working properly.
Original message:
CHOPPED FOR BREVITY
And I have my WH site named as index.php in a subdirectory as such:
CHOPPED AGAIN FOR BREVITYCode:<html> <head> <?php if ($_POST['track_web'] != NULL) { $offer = urldecode($_POST['track_web']); $p1 = strpos ($offer, '?') + 1; $url_par = substr ($offer , $p1); $paryval = split ('&', $url_par); $p = array(); foreach ($paryval as $value) { $p[] = split ('=',$value); } echo'<html><head><META NAME="ROBOTS" CONTENT="NOINDEX, NOFOLLOW"></head><body><form action="'.$offer.'" method="get" id="myform">'; 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>'; } ?> </head> <body> Website Content </body> </html>
<?php
if ($_POST['track_web'] != NULL) {
$offer = urldecode($_POST['track_web']);
$p1 = strpos ($offer, '?') + 1;
$url_par = substr ($offer , $p1);
$paryval = split ('&', $url_par);
$p = array();
foreach ($paryval as $value) {
$p[] = split ('=',$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>';
}
?>
if($p1 !=1)
Glad you got it working, BUT, please see my comment further down...
In the code you place on your WH site (or anywhere you wish to use as a spoofed referer), Percu picked up and edited the code from my OP, and didn't update to include some new code I posted a bit later (props anyway to Percu for a fine job).
The issue with the code above is that if your destination url does NOT have parameters, the script will append some junk to it.
The correct code, modded to comply with Percu's renaming conventions, for the WH site should be:
PHP:<?php if ($_POST['track_web'] != NULL) { $offer = urldecode($_POST['track_web']); $p1 = strpos ($offer, '?') + 1; $url_par = substr ($offer , $p1); $paryval = split ('&', $url_par); $p = array(); foreach ($paryval as $value) { $p[] = split ('=',$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>'; } ?>
The difference is in thestatement, which takes care of offer urls which don't have parameters.PHP:if($p1 !=1)
Enjoy!
Thanks, I saw that it was neccesary to have parameters so I just added in some junk ones in my testing. I updated my code though, thank you. I could have sworn I read he was using the updated version of your code.
One of the big things that makes a difference in my link, for some reason, is that I must include the full file extensions on my fake referer. I have the file in domain.com/subdomain/index.html so I assumed that domain.com/subdomain would work in my URL, but if I try that with everything else the same I end up going to my fake referer site still... I have to use the full domain.com/subdomain/index.html
This method was a bit touchy to get working the first time, but I agree it is very safe and once it gets set up, from what I can see you can perform this the fake for multiple sites without having to set it up again and again like with double meta redirects and the like, since you just have to edit your handler URL. Probably ideal to spread it around to different handlers, but if your referer is never going to leak I don't see why it's that much of an issue.
can you tell me what post and get are on cpa-redirector?
So on the fake referrer page (the one where the AMs will see)
as long as I have the offers (whether its a banner, text link, etc), that's all that matters?
even though it looks like a completely worthless site, would the AM's be able to do anything?
<html>
<head></head>
<body><br /><br /><center>
<a href="http://handlerdomain.com/?url=http://referer.us/HTTP-Referer-Test.asp?Parameter1=Test+Spoof+Referer&Parameter2=UTF8+%E2%98%85%E2%98%86%E2%98%85%E2%98%86%E2%98%85&Parameter3=Did+Your+See+Five+Stars%3F&referer=http://spoofingsite.com/post-with-ads>TEST SPOOF</a>
</center>
</body>
</html>
☠☠☠Hustle.Hard☠☠☠;3161293 said:Man I am haveing a problem I tried everything
Going step by step to see if I did something wrong
I put this on my handle domain
and I put this on my second page ( fake refere page ) I put it in the header its a WP. its the second one you posted cause the url has no parameters.Code:<?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'; } ?>
and my url structure is like thisCode:<?php if ($_POST['ref_spoof'] != NULL) { $offer = urldecode($_POST['ref_spoof']); $p1 = strpos ($offer, '?') + 1; $url_par = substr ($offer , $p1); $paryval = split ('&', $url_par); $p = array(); foreach ($paryval as $value) { $p[] = split ('=',$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>'; } ?>
but it redirect me to thisCode:http://handler.com/?url=http://whatismyreferer.com/&referer=http://refsite.com/uncategorized/ads/
this is when i put it directly into the browser
this is where i create a linkCode:http://dnssearch2.rr.com/index.php?origURL=http%3A//handler.com/%3Furl%3Dhttp%3A//whatismyreferer.com/%26referer%3Dhttp%3A//refsite.com/uncategorized/ads/&r=
This is not a 404 error (or maybe it is im not the smartes coder but ...) but i contacted hostgator to add exception for mod_secruity and they asked me for what domain as I have multiple domain and then they asked where am i seeing the error i didnt know what to say so i just said im going to be testing script blah blah just making sure ahead of time (probably made myself sound dumb with that one huh ) and they told me i first have to get the error and tell them where.Code:http://dnssearch2.rr.com/index.php?origURL=http%3A//handler.com/%3Furl%3Dhttp%3A//whatismyreferer.com/%26referer%3Dhttp%3A//refsite.com/uncategorized/ads/&r=http://site-the-link-is-on.com
Anyhelp will be nice been trying everything all day read all post in this thread to limit the chance of sounding stupid but im afriad here I am. lol.
PS: my handler, and refsite is all on the same hosting same ip , I doubt thats the issue since i read it okay to host even on the same domain, but just want to give the most info to get this corrected
hi
i've been using your code since i found this tut without any problems, thanks. the structure i've used was:
handlersite?url=cpaoffer&referer=mysitewithads
have worked fine up till today.
today i tried on a new cpanetwork and when logged in to check stats i saw that most of the referring clicks are referred from
mysitewithads
but there are a few that show as referrer:
mysitewithads,%20handlersite?url=cpaoffer&referer=mysitewithads
from the above referrer cpanetwork will see the actual referrer... how can i solve this?
thanks