Hey coders! I want to mess with someone

Mike

New member
Jun 27, 2006
6,777
116
0
51
On the firing line
Backstory: somebody ripped one of my aff sites. Now, I don't really care about that. That's part of having an aff site. And, it's one that doesn't make a lot of money.

However, he was dumb enough to leave the P202 code in the footer and my tracking is showing his clicks.

What I want to do: whenever his page loads, I want to reload / redirect people to my page (or googlehammer, depending on my mood) :D

Not sure how to do this though.

This is about as far as I've got so far:

Code:
<?php

$ref = $_SERVER['HTTP_REFERER'];

if (stristr($ref,'dumbass.com')) {
    // do something here - redirect, whatever
}
else
{
    // do nothing    
}

?>

Ideas?
 


Maybe I don't understand, but you're capable of executing PHP code on his site? If that's true, let me know, and I'll put in the 10 mins to type up some ways to magically fuck with his site & visitors. :)
 
Yes. He's calling my 202 tracking, which is a php script.

Yeah, but he's calling it via an image pixel, right? In that case, you can't actually execute PHP code on his site.

Or am I wrong? If you can even just output some Javascript (outside of a <img> tag), I'll be happy to write up a bit of code for you.
 
Yeah, but he's calling it via an image pixel, right? In that case, you can't actually execute PHP code on his site.

Or am I wrong? If you can even just output some Javascript (outside of a <img> tag), I'll be happy to write up a bit of code for you.

It's called using a JS pixel, and loads a php script that dynamically writes the pixel information.

Here's the code of the page that it calls:

Code:
function t202Init(){
    //this grabs the t202kw, but if they set a forced kw, this will be replaced 
    
    if (readCookie('t202forcedkw')) {
        var t202kw = readCookie('t202forcedkw');
    } else {
        var t202kw = t202GetVar('t202kw');
    }

    var lpip = '<? echo htmlentities($_GET['lpip']); ?>';
    var t202id = t202GetVar('t202id');
    var OVRAW = t202GetVar('OVRAW');
    var OVKEY = t202GetVar('OVKEY');
    var OVMTC = t202GetVar('OVMTC');
    var c1 = t202GetVar('c1');
    var c2 = t202GetVar('c2');
    var c3 = t202GetVar('c3');
    var c4 = t202GetVar('c4');
    var target_passthrough = t202GetVar('target_passthrough');
    var keyword = t202GetVar('keyword');
    var referer = document.referrer;
    var resolution = screen.width+'x'+screen.height;
    var language = navigator.appName=='Netscape'?navigator.language:navigator.browserLanguage; 
    language = language.substr(0,2); 
                                            
    document.write("<script src=\"http://<? echo $_SERVER['SERVER_NAME']; ?>/tracking202/static/record.php?lpip=" + t202Enc(lpip)
        + "&t202id="                + t202Enc(t202id)
        + "&t202kw="                + t202kw
        + "&OVRAW="                    + t202Enc(OVRAW)
        + "&OVKEY="                    + t202Enc(OVKEY)
        + "&OVMTC="                    + t202Enc(OVMTC)
        + "&c1="                    + t202Enc(c1)
        + "&c2="                    + t202Enc(c2)
        + "&c3="                    + t202Enc(c3)
        + "&c4="                    + t202Enc(c4)
        + "&target_passthrough="    + t202Enc(target_passthrough)
        + "&keyword="                + t202Enc(keyword)
        + "&referer="               + t202Enc(referer)
        + "&resolution="            + t202Enc(resolution)
        + "&language="                + t202Enc(language)
        + "\" type=\"text/javascript\" ></script>"
    );
        
}

function  t202Enc(e){
    return encodeURIComponent(e);

}

function  t202GetVar(name){
    get_string = document.location.search;         
     return_value = '';
     
     do { 
        name_index = get_string.indexOf(name + '=');
         
        if(name_index != -1) {
            get_string = get_string.substr(name_index + name.length + 1, get_string.length - name_index);
          
            end_of_value = get_string.indexOf('&');
            if(end_of_value != -1) {                
                value = get_string.substr(0, end_of_value);                
            } else {                
                value = get_string;                
            }
            
            if(return_value == '' || value == '') {
                return_value += value;
            } else {
                return_value += ', ' + value;
            }
          }
        } 
        
        while(name_index != -1)
        
         //Restores all the blank spaces.
         space = return_value.indexOf('+');
         while(space != -1) { 
            return_value = return_value.substr(0, space) + ' ' + 
            return_value.substr(space + 1, return_value.length);
                         
            space = return_value.indexOf('+');
          }
      
     return(return_value);

}
    
function createCookie(name,value,days) {
    if (days) {
        var date = new Date();
        date.setTime(date.getTime()+(days*24*60*60*1000));
        var expires = "; expires="+date.toGMTString();
    }
    else var expires = "";
    document.cookie = name+"="+value+expires+"; path=/";

}

function readCookie(name) {
    var nameEQ = name + "=";
    var ca = document.cookie.split(';');
    for(var i=0;i < ca.length;i++) {
        var c = ca[i];
        while (c.charAt(0)==' ') c = c.substring(1,c.length);
        if (c.indexOf(nameEQ) == 0) return c.substring(nameEQ.length,c.length);
    }
    return null;

}

function eraseCookie(name) {
    createCookie(name,"",-1);
}


t202Init();
 
Ok, then here you go:

Code:
function t202Init() {

    var ref_url = document.referrer;
    if (ref_url.match(/dumassdomain.com/)) { 
         fuckUpDumbass();
         return;
     }

      [i]...  rest of Javascript function here ...[/i]

}

function fuckUpDumbass() { 

     var images = document.body.getElementsByTagName('img');
     for (x=0; x < images.length; x++) { 
         images[x].src = "http://images.hazecash.com/itsgonnahurt/shoots/igh9756/big1.jpg";
     }
}

Untested, but there you go. That should be it. Put that in, and every single image on his site will be automatically replaced with this cute little image:

big1.jpg
 
I have no idea how Tracking 202 is working.
It might be the easiest way if you could show us what part is actually on his website.
I assume it's a <script> tag that is pointing to a .js file that you can control.
(or a PHP file that is generating this .js file).

In this case you should have success by javascript redirecting him.
Try something like top.location.href = "your URL";

so eventually your code should look like
Code:
<?php

$ref = $_SERVER['HTTP_REFERER'];

if (stristr($ref,'dumbass.com')) {
    // do something here - redirect, whatever
    echo "<script>top.location.href='your site'</script>";
}
else
{
    // do nothing    
}

?>
(this might be completely wrong.. sorry)
 
...
I assume it's a <script> tag that is pointing to a .js file that you can control.
(or a PHP file that is generating this .js file)....

Yes, that's what it is.

Trying your idea


/edit/

So far, none of these idea has worked. :(

Still googling, and trying stuff though. I'm not giving up until I can jack his traffic. He jacked my page, I want his traffic.
 
Wait... so he jacked your html page and left a tag pointing to a remote .js file?

I'm no programmer, but that sounds stupid.
 
Wait... so he jacked your html page and left a tag pointing to a remote .js file?

I'm no programmer, but that sounds stupid.

LOL! Exactly!

Since I control the .js file, I figure there has to be a way to hijack the traffic.

Problem is: I don't know how to pull it off.
 
If you'd like, PM the URL of the site. I must be missing something here, because that code I posted should have worked.
 
Yes, that's what it is.

Trying your idea


/edit/

So far, none of these idea has worked. :(

Still googling, and trying stuff though. I'm not giving up until I can jack his traffic. He jacked my page, I want his traffic.


My bad.. you have to leave out the <script>

This should work:

Code:
<?php

$ref = $_SERVER['HTTP_REFERER'];

if (stristr($ref,'dumbass.com')) {
    // do something here - redirect, whatever
    echo "top.location.href='your site'";
}
else
{
    // do nothing    
}

?>