Double Meta Refresh and redirects

Status
Not open for further replies.
If anyone ever wants to check and make sure the script is working and your referrer URL is not showing, just do this:

1. Make a blank text file from Notepad. Label it: visitorlog.txt.

2. Upload the .txt file and Chmod it to 777

3. Copy and paste this code into any .php page you want to track. For example test.php.

PHP:
<?php
function writeFile($a,$b="",$c="")
{
	clearstatcache();
	$fh = (file_exists($a)? fopen($a, 'r+') : fopen($a, 'w+'));
	$read = chop(@fread($fh, filesize($a)));
	$c = ($b=="counter"? (file_exists($a)? $read+1 : "1") : ($b=="after"? 

$read.$c : $c));
	if(file_exists($a)) while(1)
		if(flock($fh, LOCK_EX))
		{
			rewind($fh);
			fwrite($fh, $c);
			fflush($fh);
			ftruncate($fh, ftell($fh));
			flock($fh, LOCK_UN);
			break;
		}
	else fwrite($fh, $c);
	fclose($fh);
}
writeFile("./visitorlog.txt","after","\r\n".date("Y-m-d H:i")." - ".$_SERVER["REMOTE_ADDR"]." - ".($_SERVER["HTTP_REFERER"] ? "Referer: ".$_SERVER["HTTP_REFERER"] : "Direct access"));
?>

4. Upload the .php file.

5. Now test the code that XIMSCREAMINGX posted by putting the test.php page within the refresh page (page 2)

Example:
PHP:
<?php
    $referer = $_SERVER['HTTP_REFERER'];
    if($referer == "")
    {
        echo "<meta http-equiv=\"refresh\" content=\"0;url=http://www.test.php\">";    
    }
?>

Conclusion: Now go to your visitorlog.txt page (http://www.test.php/visitorlog.txt) and look for your IP. If XIMSCREAMINGX's script works (and it does), then the log should state "Direct Access" and nothing else.

This is a surefire way for all you non-believers to ensure the script does work.


:cool2:
 
if i have an image, <img src="myreferer1.php", on my whitehat site, will this then redirect to the meta refresh page without the visitor knowing? Or how can i put this script on an image to stuff?

Or how wud I go about that?
 
if i have an image, <img src="myreferer1.php", on my whitehat site, will this then redirect to the meta refresh page without the visitor knowing? Or how can i put this script on an image to stuff?

Or how wud I go about that?

Meta refresh doesn't work with images as far as I know.
 
Whats the point of redirecting them to URL2, and checking the referer again if URL1 already checks it?

This will redirect them to site.com and wont pass a referer.
Code:
<?PHP

header('Location: http://www.site.com');

?>

or
Code:
<?PHP

$referer=$_SERVER['HTTP_REFERER'];

if($referer==""){
header('Location: http://www.site.com');
}

?>
If youre that concerned about checking the referer first..
 
any idea how to blank out the referer header when operais used?
i tried meta and javascript..the referer sticks throughout
 
whats the difference if you use the back slashes:


echo "<meta http-equiv=\"refresh\" content=\"0;url=URL2\">";


Or no slashes:


echo '<meta http-equiv="refresh" content="0;url=URL">


I've seen both types of code, and both seem to work.

The difference is in what you use to enclose the string. If you do 'stuff with "other stuff"' then php sees the beginning and ending ' and assumes everything inside is one string. If you do "stuff "with other stuff" it assumes that "stuff " is one string and with other stuff" is random crap on the end of it.

Computers are smart....but dumb :)
 
any idea how to blank out the referer header when operais used?
i tried meta and javascript..the referer sticks throughout

you dont worry about it, just let it fail the check and drop it back to your homepage.

Or... you could redirect your failed meta traffic to an offer that you don't care about the referrer.
 
Fascinating thread guys...question though.

If the Aff Manager see DIRECT ACCESS as the referrer for all traffic, won't that flag as suspicious...

Would genuine DIRECT ACCESS be by a user typing in the URL?
 
Fascinating thread guys...question though.

If the Aff Manager see DIRECT ACCESS as the referrer for all traffic, won't that flag as suspicious...

Would genuine DIRECT ACCESS be by a user typing in the URL?

You don't have to divulge your traffic sources. This is how you make your living, and can't be expected to just hand over the keys to your business. If push comes to shove with a network over blank referrers, move on to a different network.

Having said that, if you are generating fraudulent leads, you will get caught. Just don't do it. It makes legit whitehat/grayhat/blackhat even more difficult for the rest of us.
 
I would like to make the traffic from my bh site look like it is coming from my wh site. Is this possible? right now my bh site is using the double meta refresh.
 
I would like to make the traffic from my bh site look like it is coming from my wh site. Is this possible? right now my bh site is using the double meta refresh.

Sure. Just have the first redirect redirect from your BH to WH site, and then from your WH site redirect to wherever it is.
 
Doesn't it all depend on which browser is used? I think that's what troubles people. They think their problems are solved with the double meta and then read that certain browsers pass the referer no matter what and then panic sets in.

We all just want something "bulletproof". There's people here that dangle the possibility that they have something that already does it, but never deliver a final, foolproof script.

If I had the coding skills, here's things I'd try:

(Let's imagine we're using PPC to drive traffic)

Here's the 3 components we're dealing with -

Adwords Click ==> Black Hat Landing Page(s) ==> CPA Offer

Let's examine the "Black Hat Landing Page(s)" component. This is our bait. What we want to do is funnel our mark through some steps that help us hide/fake the referer.

We want to make sure that none of these pages pass a referer. But if they DO leak accidentally, we want to make sure someone who comes from outside our site can't see the dirty work. In other words, if an AM finds the url to one of these pages and plugs it into his address bar - they won't see what the mark sees.

Our first landing page should be a sort of KEY to the rest of the black hat activity.

Can this be done with a cookie? Htaccess? A special referer that we set? Can redirect outside traffic to different pages while maintaining the exact same urls so as not to raise suspicion?

I've seen stuff like this done using two domains, but is there a way to do it on one domain?

Ok, moving on. The next step is linking to the offer. Two questions arise: Do we link off our site to an offer with a double meta that checks if the referer is blank, or can we link to a special page on our own site with the same method?

What if we link to a special page on our site with a double meta and as long as they're coming from our "key page", they'll see the offer?

My whole point is that we want to hide as much as we can with the double metas, but if there's any leakage, we'll survive a hand check by the Network or their tech dept. I think something like this would be the only way to beat Google Chrome and other browsers that aren't designed for double metas.

Anybody want to collaborate on an easily implementable system?

If anyone ever wants to check and make sure the script is working and your referrer URL is not showing, just do this:

1. Make a blank text file from Notepad. Label it: visitorlog.txt.

2. Upload the .txt file and Chmod it to 777

3. Copy and paste this code into any .php page you want to track. For example test.php.

PHP:
<?php
function writeFile($a,$b="",$c="")
{
    clearstatcache();
    $fh = (file_exists($a)? fopen($a, 'r+') : fopen($a, 'w+'));
    $read = chop(@fread($fh, filesize($a)));
    $c = ($b=="counter"? (file_exists($a)? $read+1 : "1") : ($b=="after"? 

$read.$c : $c));
    if(file_exists($a)) while(1)
        if(flock($fh, LOCK_EX))
        {
            rewind($fh);
            fwrite($fh, $c);
            fflush($fh);
            ftruncate($fh, ftell($fh));
            flock($fh, LOCK_UN);
            break;
        }
    else fwrite($fh, $c);
    fclose($fh);
}
writeFile("./visitorlog.txt","after","\r\n".date("Y-m-d H:i")." - ".$_SERVER["REMOTE_ADDR"]." - ".($_SERVER["HTTP_REFERER"] ? "Referer: ".$_SERVER["HTTP_REFERER"] : "Direct access"));
?>
4. Upload the .php file.

5. Now test the code that XIMSCREAMINGX posted by putting the test.php page within the refresh page (page 2)

Example:
PHP:
<?php
    $referer = $_SERVER['HTTP_REFERER'];
    if($referer == "")
    {
        echo "<meta http-equiv=\"refresh\" content=\"0;url=http://www.test.php\">";    
    }
?>
Conclusion: Now go to your visitorlog.txt page (http://www.test.php/visitorlog.txt) and look for your IP. If XIMSCREAMINGX's script works (and it does), then the log should state "Direct Access" and nothing else.

This is a surefire way for all you non-believers to ensure the script does work.


:cool2:
 
if i understand you correctly with what your asking then this can be done easily by a php page with a condition,

if refer=xxxxxx
then display THIS bunch of html as your webpage

else
display THIS bunch of html as your webpage instead


We want to make sure that none of these pages pass a referer. But if they DO leak accidentally, we want to make sure someone who comes from outside our site can't see the dirty work. In other words, if an AM finds the url to one of these pages and plugs it into his address bar - they won't see what the mark sees.
Anybody want to collaborate on an easily implementable system?
 
That's part of the puzzle, I have that code but am wondering if there's a way to present two different frames that appear on the same url, rather than two seperate static pages. My reasoning is that I read if you send a blank referer to a framed white hat page, it resets the referer as that white hat page. Maybe I'm wrong.
 
im not sure what you are trying to use the frames for, but i think this does the thing your trying to do without using frames. (unless you have a need for the frames for some other purpose, maybe im just not understanding you properly.)

the code example im posting is 2 different web pages that reside in one actual physical file. depending on where the visitor comes from.

so to answer your original question as i understand it, this will allow the same url to produce 2 "different" pages, depending on who is looking for it. if the visitor views the source of the page, they will only see the html source for the page created for them based on the refer they came from

Code:
<?php

//insert your own code here to check for whatever refer you want to check for right here and set $match to true or false


if($match)
{
?>
<html>
<head>
<title>Black hat page</title>
</head>
<body>

do dirty deeds here, maybe double-meta refresh or whatever else
you want to do here

</body>

<?php
}

else
{


?>

<html>

<head>
<title>White hat page</title>
</head>

<body>
stuff for white hat people to see like account managers
</body>

</html>

<?php

}

?>
 
The double meta refresh doesn't work with Opera, it keeps bouncing between redirect1.php and redirect2.php in an eternal loop. I wouldn't worry too much since it's a very small percentage of user agents, although it is likely to grow in the future, since it's such an amazing browser.
 
How about you if go through a double meta first and have it check the referer...if it's still dirty, have it go through a javascript auto form submit? Or maybe it could go through the javascript auto submit form first, then through the double meta and then check the referer? I was told you only need a javascript submit - but I'm still not sure.
 
Status
Not open for further replies.
Back
Top