Blocking MSN ads

Although probably not the best way to block MSN ads, I discovered this method accidentally while debugging my PHP app. Here’s what you do:

  • Download and install Fiddler
  • Run Fiddler and launch MSN live
  • Watch the web sessions window in fiddler until you see something like “ads1.msn.com” in the hosts column – this might be different for other PC’s, I’m not sure
  • Add this line to your “C:\WINDOWS\system32\drivers\etc\hosts” file:
  • 127.0.0.1    ads1.msn.com

This redirects any requests to the ad server to your localhost. A minor drawback is the annoying popup messages you get when it fails to connect, but it works 🙂 No more ads!

I’m sure with a little more inspiration and time you could hack it to serve up whatever image you want, your very own MSN skinner! Enjoy 🙂

Wireshark

I installed Wireshark out of curiosity – I’d seen it mentioned and wanted to see how I could find a use for the network protocol analyzer. It sat lying around until a friend asked whether or not it would be possible to skew a particular poll result.

The poll used a flash frontend. I knew there had to be backend it communicated with, so I fired up Wireshark, started logging and cast my vote. A simple ping to the web host revealed the IP address of the destination host which I used to sort the Wireshark result set. There it was – a post to a PHP script to record my vote, complete with HTTP headers and URL string.

Thanks to the Zend Framework and a few lines of code later, my very own poll skewer:

<?php

require_once(‘C:/php/libs/Zend/Http/Client.php’);

$client = new Zend_Http_Client(‘http://www.somedomain.com/poll/poll.php’);
$client->setParameterPost(‘pollId’, ‘7654’);
$client->setParameterPost(‘answerId’, ‘3’);

$response = $client->request(‘POST’);
print urldecode($response->getBody());

?>

Throw that in a loop and iterate a few thousand times and you quickly begin to understand how important it is to add restrictions based on a user’s IP address and / or cookies – even though these often cause more trouble than they’re worth.