My previous posts here and here talked about compiling Cassini and using it from Visual Studio. After all that, I found that Cassini doesn’t understand NTLM, and writing it is complicated. So what to do now?
Warning: I do not know about the legality of this. This is for informational purposes only (will that hold up in a court of law?) Additionally, make backup copies of your files before you go replacing them with your hacked versions. You can recover the originals by reinstalling Visual Studio, but do you really want to sit through all of that?
Looking at the web server that Visual Studio uses, it consists of two parts: C:\Program Files\Common Files\microsoft shared\DevServer\9.0WebDev.WebServer.exe, and WebDev.WebHost, version=9.0.0.0, PublicKeyToken=b03f5f7f11d50a3a. Really, the only thing I wanted to change about this program is the IPEndPont should use a IPAddress.Any instead of IPAddress.Loopback.
So the solution, let’s modify the IL, reassemble, re-sign (not resign) and reuse.
First thing to do is get the WebDev.WebHost file, make a copy (I copied to c:\temp) and disassemble. You must copy this from a Command Prompt, as if you try to navigate here with Windows Explorer, you will start the shell extension and won’t be able to copy the file. So:
xcopy c:\Windows\assembly\GAC_32\WebDev.WebHost\9.0.0.0__b03f5f7f11d50a3a\webdev.webhost.dll c:\temp
Now:
- Run ildasm
- Select File | Open…c:\temp\webdev.webhost.dll.
- Select File | Dump, and check everything. I saved mine to c:\temp\webdev.webhost.il

Now, open the IL file in Visual Studio. On line 8559, change System.Net.IPAddress::Loopback to System.Net.IPAddress::Any.
8559 IL_0020: /* 7E | (0A)0000A2 */ ldsfld class [System/*23000003*/]System.Net.IPAddress/*01000035*/ [System/*23000003*/]System.Net.IPAddress/*01000035*/::LoopbackAny /* 0A0000A2 */
Do the same for the IPV6 line, line 8577:
8577 IL_004a: /* 7E | (0A)0000A2 */ ldsfld class [System/*23000003*/]System.Net.IPAddress/*01000035*/ [System/*23000003*/]System.Net.IPAddress/*01000035*/::IPv6LoopbackAny /* 0A0000A2 */
And lastly, let’s change the version number, so we can be side-by-side with the “real” file in the GAC when we are finished. Line 2078 contains the version:
2078 .ver 9:0:0:0
(change to)
Now save the file and reassemble. There are two things to remember when reassembling: don’t forget the resources, and resign with a strong key. You will need to create a new key file using the sn.exe utility.
ilasm /dll /resource=webdev.webhost.res /key=c:\temp\mykey.snk webdev.webhost.il
And put it in the GAC
gacutil /i c:\temp\webdev.webhost.dll
Congratulations, you have a patched file in the GAC ready for use. So how do we use it? Now we have to patch WebDev.WebServer.exe.
Start the same way as above:
- Run ildasm
- File | Open…C:\Program Files\Common Files\microsoft shared\DevServer\9.0\webdev.webserver.exe
- File | Dump, check everything.
Now again, open the webdev.webserver.il file in Visual Studio. There is only one thing we need to change, and that is the reference to webdev.webhost.dll.
On line 3043, update the WebDev.WebHost reference information:
3043 .assembly extern /*23000005*/ WebDev.WebHost
3044 {
3045 .publickeytoken = (B0 3F 5F 7F 11 D5 0A 3A ) // .?_....:
3046 .ver 9:0:0:0
3047 }
Change it to:
3043 .assembly extern /*23000005*/ WebDev.WebHost
3044 {
3045 .publickeytoken = (BA 91 52 DE BC 13 88 58 ) // .?_....:
3046 .ver 9:1:0:0
3047 }
But the public key token will be the public key token of your signing key. Don’t use this one…this is off of my key. Not yours. It’s easy to find out your public key token: Open Windows Explorer and navigate to c:\windows\assembly. Scroll down to WebDev.WebHost version 9.1.0.0, and your public key token is listed.
Save that IL file, and let’s reassemble again. Don’t forget the resources and strong name key:
ilasm /exe /resource=WebDev.WebServer.res /key=c:\temp\mykey.snk WebDev.WebServer.il
And boom goes the dynamite.
Run a web site or web project:
c:\temp\WebDev.WebServer.exe /port:1234 /path:c:\temp\myweb /vpath:myweb [/ntlm]
Go to a different machine, and connect your browser of choice: http://originalMachine:1234/MyWeb and revel and bask in the fact that you got everyone kissin’ your ass.
70540d49-9cb9-4296-8d07-64c5c4284b7b|0|.0
Development
asp.net | visual studio