Permanent Rick Rolls – A Technical How-To

Posted by Vincent / February 19, 2010, 6:29 pm

Today, and for the last few days in fact, Tim, our wayward designer, who parts these shores today to embark on a burgeoning music career, and for which we all wish him well (I digress), has taken MUCH delight in rick-rolling his soon to be EX work mates. Needless to say we were having none of this and decided to throw all our technical muster at the problem. As the saying goes: “fight fire with fire!”

To this end we basically hijacked his computer’s host file, and set up various popular domains and redirected them to a computer internally, so that we could then redirect his browser out to our new favourite YouTube page. When he discovered his own site site, may have been “hacked”, his face was aghast, much to our amusement; and he was even more bemused when it seemed like his computer was getting “the special treatment”.

So here’s how we did it, for those interested in getting one over their fellow work chums:

  1. Start Web Sharing in your “Sharing” system preference on your Mac.
  2. Pop an index.php file with a header location redirect in it, as follows:


<?php
header('Location: http://www.youtube.com/watch?v=oHg5SJYRHA0');
die();

  1. You should then be able to test this in your browser locally.
  2. On the remote suspect’s computer, open Terminal and run the command “sudo pico /etc/hosts”
  3. When prompted for the password, enter your admin password.
  4. In pico, scroll to the bottom of the page, and paste in the following, where youtube.com is the domain you wish to target and 192.168.10.11 is the IP of your computer:

www.youtube.com 192.168.10.11

  1. Click “CTRL + X” and then “Y” and then “ENTER”
  2. Your victim should now be ripe for the picking!

Good Luck and enjoy the fun!

PS. Thanks Tim for your great teamsmanship over the last year and a half, and you will be missed! Am sure the other members of Stink Digital and all the peeps who have had the pleasure of working with you will not mind joining me in wishing you every best.