Ok earlier on IRC a discussion about editing MSN ads to show a custom message for use punters at LAN parties. So basically heres how I did it, be kind its my first post.

Here's how I started

First I launched wireshark and started to capture packets then I loaded up MSN Messenger.

Once the ad had loaded I stopped capturing packets on wireshark and looked at the packets which have been received for anything ad related. This was the interesting packet which i found:

fg><abchconfig><url>http://contacts.msn.com/abservice/abservice.asmx</url></abchconfig></AbchCfg><AdMainConfig><AdDownloadTimeInMinutes>120</AdDownloadTimeInMinutes><AdMainCfg>http://rad.msn.com/ADSAdClient31.dll?GetAd?PG=IMSUKR?SC=HF</AdMainCfg></AdMainConfig><AdPhoneConfig>http://rad.msn.com/ADSAdClient31.dll?GetAd?PG=IMSRUK?SC=HF</AdPhoneConfig><LocalizedConfig Market="en-GB"><AdMainConfig><AdBanner20URL Refresh="3600">http://rad.msn.com/ADSAdClient31.dll?GetAd=&amp;PG=IMSUKM&amp;AP=1007</AdBanner20URL><StdAd AdVisible="30" Vid

This is the important bit from that packet


When you load this up in a web browser it shows the ad. Once we look at the source code you should get:

<script type="text/javascript">
document.write('<iframe src="http://view.atdmt.com/MUK/iview/msnnkmuk001234x60Ximsukm00021muk/direct;wi.234;hi.60/01/993216791?click=" frameborder="0" scrolling="no" marginheight="0" marginwidth="0" topmargin="0" leftmargin="0" width="234" height="60"><scr'+'ipt language="JavaScript" type="text/javascript">document.write('<a href="http://clk.atdmt.com/MUK/go/msnnkmuk001234x60Ximsukm00021muk/direct;wi.234;hi.60/01/993216791" target="_blank"><img src="http://view.atdmt.com/MUK/view/msnnkmuk001234x60Ximsukm00021muk/direct;wi.234;hi.60/01/993216791" /></a></scr'+'ipt></iframe>');

This is what is loaded in MSN.

Or sometimes you will get this which is just the MSN Messenger logo

<!--NOAD--><img src="http://global.msads.net/defaultads/ads/defaultads/TR.gif?N=B55&R=BLU"/>

Now this is quite important as normally when I tried with the normal code on my custom page (which I will explain in a min) I get an error in MSN but it still loads fine but you get an error. But if you use that and just change the image to your custom one you wont get an error.

Ok thats how I did it heres how you can do it.

First you will need:

  1. Apache web server (you could do it with any but this is what I did it with

And that's all for this I did it on ubuntu 7.10 but it should work on any.

First open up /etc/mime.types with your favourite text editor and find

application/x-msdos-program                     com exe bat dll

Remove the dll from this.

Go up to text/html and add dll to the end

text/html                                       html htm shtml dll 

Almost done.

Restart apache and create the file ADSAdClient31.dll in your main html directory in my case its /var/www/ but it will vary for you.

In the dll file you should have

<!--NOAD--><img src="yourimgurlhere"/>

And that's for the server side now for the client side you can do it via dns for your network for example or for one client machine to test like I did.

On the client machine open up if its windows with notepad


Add the line rad.msn.com

The IP address for me is a server on my network or can be depending on where your apache server is. Now restart MSN Messenger and you should have you custom ad.


Any feedback regarding the post is appreciated.