Search your fish :
    Home | Archives | Disclaimer | About Me | Contact Me
  

Methods used for cookie stuffing

Posted on Saturday, April 26th, 2008 under Blackhat Techniques

This is a post related to the previous post about ‘what is cookie stuffing‘. The most commonly used used methods are:

1. Using Javascript
2. Using iFrames
3. PHP Header redirect
4. .htaccess and redirect pages
5. With HTML Object
6. Exploiting Browser’s security flaws

Cookie Stuffing with Javascript

 There are tons of methods that can be used for cookie stuffing with Javascript. You can cloak the affiliate link and open it on your page, or open a popup in a new window and redirect user to your affiliate link, there are tons of scripts to open a popup from your page, however its less effective since people have installed popup blockers, here is the code to open popup

<script language=”javascript”>
window.open(‘YOUR Affiliate Link‘,’myWindow’,'width=300, height=300, toolbar=NO, resizable=YES’);
</script>

Its a good idea to drop your own cookie at the same time to see if that user has already been stuffed, if so, then do not open any more popups.

 <script>
<!– Begin
//Pop-under window - javascriptkit.com
var popunderSpaFinder=”http://click.linksynergy.com/fs-bin/click?id=OEu024dtHXs&offerid=47053.10000304&type=3 &subid=0″
var winfeatures=”width=780,height=580,scrollbars=1,res izable=1,toolbar=1,location=1,menubar=1,status=1,d irectories=0″

var once_per_session=1

function get_cookie(Name) {
var search = Name + “=”
var returnvalue = “”;
if (document.cookie.length > 0) {
offset = document.cookie.indexOf(search)
if (offset != -1) { // if cookie exists
offset += search.length
// set index of beginning of value
end = document.cookie.indexOf(”;”, offset);
// set index of end of cookie value
if (end == -1)
end = document.cookie.length;
returnvalue=unescape(document.cookie.substring(off set, end))
}
}
return returnvalue;
}

function loadornot(){
if (get_cookie(’popunderSpaFinder’)==”){
loadpopunderSpaFinder()
document.cookie=”popunderSpaFinder=yes”
}
}

function loadpopunderSpaFinder(){
win2=window.open(popunderSpaFinder,”",winfeatures)
win2.blur()
window.focus()
}

if (once_per_session==0)
loadpopunderSpaFinder()
else
loadornot()
// End –>
</script>

Javascript Link Cloaking

This means obfuscating your affiliate link with some javascript, for example if your affiliate link is something like http://youraffiliate.com/id.php?id=1then after obfuscation it will look like “23X34Fx33×65″ (this is just assumption of the code, you may search many javascript obfuscation / link cloaking scripts online, this is also good enough because you can change the statusbar which hides your affiliate link.

Javascript Meta Refresh

One of the good method that also hides HTTP_REFERER is meta refresh method in which you make a separate page that redirects that page to affiliate page while keeping the referrer as “blank” so you can hide your source of traffic, here it is

<META HTTP-EQUIV=”REFRESH” CONTENT=”1;URL=http://AffiliateLink.com”>

Another way for stuffing cookies can be using the Javascript Blur Method.

Using iFrames

IFrame is quite an old method but it still works, but keep in mind it is one of the methods that have maximum ban rate and easily detectable. But the good thing is that you can get the referrer you want, I mean if you are showing affiliate manager that you traffic is coming from http://abc.com but you are sending them traffic from http://xyz.comthen it will display affiliate manager that all traffic is coming from abc.com by using an iFrame on xyz.com in which you open a php file e.g. http://www.abc.com/aff.phpthis aff.php file is automatically redirected to the affiliate link. But some people say that what if the affiliate manager directly checks aff.php, it will be redirected to affiliate link so you will get banned certainly, but there is one solution to this as well, you can do this by checking the referrer of the opener (the file that is opening the iFrame, if the referrer is not that domain, then simply show something else on that page otherwise redirect the page to affiliate link. Below is the iFrame code

<iframe src =”http://yourAffiliateLink.com” width=1 height=1></iframe>

PHP Methods

Use header redirect to redirect the page   

header(’Location: http://youraffiliatelink.com’);

The problem with this and many other functions is that it works very well, but using the image tag method, it does not change the referrer so it is still not a fool proof method.

While stuffing images with image tag, its always good idea to stuff an with image that doesn’t exist and then redirect that to a php file that has the code to redirect to affiliate link. For example you link to an image like http://www.yoursite.com/image.jpgand that image doesn’t exist, but you post this link everywhere, then you have something like this in your .htaccess file

Redirect /image.jpg http://www.yoursite.com/affiliate_redirect.php

 While stuffing in your own site, you can hide the image with setting image withing a hidden layer, e.g. <div id=”ryan” style=”display:none;”> put your image here </div>.

I will not discuss the other methods that I have mentioned here because of some limitations. So you can aways google and find our answers. I will post another article to avoid a few things to be on the safe side.

Article Popularity : 94%


If you like this article, please share : These icons link to social bookmarking sites where readers can share and discover new web pages.
  • Digg
  • Sphinn
  • del.icio.us
  • Facebook
  • Mixx
  • Google
  • Furl
  • Spurl
  • StumbleUpon
  • TwitThis
  • co.mments
  • Propeller
  • Reddit
  • Technorati

Related Posts

1 Star2 Stars3 Stars4 Stars5 Stars (9 votes, average: 4.33 out of 5)
Loading ... Loading ...

2 Responses to “Methods used for cookie stuffing

  • 1
    Bret T
    June 29th, 2008 16:30

    We could always hide the referer and be done with it

    Seems to work ok and no ads …

  • 2
    Leo
    July 29th, 2008 12:51

    Don’t forget dropping a cookie via flash. No one talks about it but it is virtually undetectable and since the cookie isn’t in the same location, it stays.

Leave a Reply