<?xml version="1.0" encoding="UTF-8" ?>
<?xml-stylesheet type="text/xsl" href="http://blogs.msdn.com/utility/FeedStylesheets/rss.xsl" media="screen"?><rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:slash="http://purl.org/rss/1.0/modules/slash/" xmlns:wfw="http://wellformedweb.org/CommentAPI/"><channel><title>Random Thoughts and Hints on Software Development : Security</title><link>http://blogs.msdn.com/eldar/archive/tags/Security/default.aspx</link><description>Tags: Security</description><dc:language>en</dc:language><generator>CommunityServer 2.1 SP1 (Build: 61025.2)</generator><item><title>Honey, where are my keys???</title><link>http://blogs.msdn.com/eldar/archive/2007/12/11/honey-where-are-my-keys.aspx</link><pubDate>Tue, 11 Dec 2007 13:07:00 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:6733451</guid><dc:creator>EldarM</dc:creator><slash:comments>1</slash:comments><comments>http://blogs.msdn.com/eldar/comments/6733451.aspx</comments><wfw:commentRss>http://blogs.msdn.com/eldar/commentrss.aspx?PostID=6733451</wfw:commentRss><description>&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;&lt;FONT face="Times New Roman" size=3&gt;&lt;SPAN style="FONT-SIZE: 12pt"&gt;No, really? Suppose, you’ve got a certificate from some certificate authority, installed it in the localmachine store, and then your application cannot see it!!! What happened? Is it a bug? Is it&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp; &lt;/SPAN&gt;a virus? Did somebody stole you precious key??? Not quite…&lt;/SPAN&gt;&lt;/FONT&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;&lt;FONT face="Times New Roman" size=3&gt;&lt;SPAN style="FONT-SIZE: 12pt"&gt;&lt;?xml:namespace prefix = o ns = "urn:schemas-microsoft-com:office:office" /&gt;&lt;o:p&gt;&amp;nbsp;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/FONT&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;&lt;FONT face="Times New Roman"&gt;&lt;SPAN style="FONT-SIZE: 12pt"&gt;Let’s see what’s happening when you install the certificate. The certificate itself is stored in the registry, and it includes the public key. However, the private key is stored separately in a special folder. That’s&lt;/SPAN&gt;&lt;FONT size=3&gt;&lt;SPAN style="mso-ansi-language: RU"&gt; &lt;/SPAN&gt;“%system drive%\Documents and Settings\All Users\Application Data\Microsoft\Crypto\RSA\MachineKeys”&lt;SPAN lang=RU style="mso-ansi-language: RU"&gt;,&lt;/SPAN&gt; or whatever it is in a localized version. &lt;/FONT&gt;&lt;/FONT&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;&lt;SPAN style="FONT-SIZE: 12pt"&gt;&lt;o:p&gt;&lt;FONT face="Times New Roman"&gt;&amp;nbsp;&lt;/FONT&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;&lt;FONT face="Times New Roman" size=3&gt;&lt;SPAN style="FONT-SIZE: 12pt"&gt;This folder is quite special. First of all, a normal consumer Windows does not have much to keep there. Sometimes, it’s just empty. Unfortunately, this is important to our story. Read on!&lt;/SPAN&gt;&lt;/FONT&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;&lt;FONT face="Times New Roman" size=3&gt;&lt;SPAN style="FONT-SIZE: 12pt"&gt;&lt;o:p&gt;&amp;nbsp;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/FONT&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;&lt;FONT face="Times New Roman" size=3&gt;&lt;SPAN style="FONT-SIZE: 12pt"&gt;So, you install the certificate, and the file with the private key is created in this folder. Where does it gets its permissions? Right, from the folder. That’s quite logical, isn’t it?&lt;/SPAN&gt;&lt;/FONT&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;&lt;FONT face="Times New Roman" size=3&gt;&lt;SPAN style="FONT-SIZE: 12pt"&gt;&lt;o:p&gt;&amp;nbsp;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/FONT&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;&lt;FONT face="Times New Roman" size=3&gt;&lt;SPAN style="FONT-SIZE: 12pt"&gt;Step 2, and that a smart thing, maybe a too smart thing, happens. Crypto layer, which created this file, removes the permissions for Everyone (WD) identity on this file. Which is also quite logical, you cannot have a private key that everybody can read, can you?&lt;/SPAN&gt;&lt;/FONT&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;&lt;FONT face="Times New Roman" size=3&gt;&lt;SPAN style="FONT-SIZE: 12pt"&gt;&lt;o:p&gt;&amp;nbsp;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/FONT&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;&lt;FONT face="Times New Roman" size=3&gt;&lt;SPAN style="FONT-SIZE: 12pt"&gt;Now, what does it mean if Everyone was the only one having access to this folder? Right, nobody can get your key. Not even Admin or SYSTEM – semi-divine identity in Windows used to run system processes.&lt;/SPAN&gt;&lt;/FONT&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;&lt;FONT face="Times New Roman" size=3&gt;&lt;SPAN style="FONT-SIZE: 12pt"&gt;&lt;o:p&gt;&amp;nbsp;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/FONT&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;&lt;FONT face="Times New Roman" size=3&gt;&lt;SPAN style="FONT-SIZE: 12pt"&gt;That’s not fun, but wait, here is more! If for some reason at some moment in the history of the machine this folder gets empty, it may – I repeat, it may – be deleted by the same code that created file for private key and maintained it so far. Then, some other application starts and tried to import a private key. Guess, what happens? The folder is magically recreated. Sounds good? Wait a bit for a small detail. It’s recreated under the current user. Ouch, ouch, ouch!&lt;/SPAN&gt;&lt;/FONT&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;&lt;FONT face="Times New Roman" size=3&gt;&lt;SPAN style="FONT-SIZE: 12pt"&gt;&lt;o:p&gt;&amp;nbsp;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/FONT&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;&lt;FONT face="Times New Roman" size=3&gt;&lt;SPAN style="FONT-SIZE: 12pt"&gt;What does it mean for you? It means that on any well used Windows system you don’t have a predictable state of this folder and your private keys. And if you install certificates under one user, it may not work under another user.&lt;/SPAN&gt;&lt;/FONT&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;&lt;FONT face="Times New Roman" size=3&gt;&lt;SPAN style="FONT-SIZE: 12pt"&gt;&lt;o:p&gt;&amp;nbsp;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/FONT&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;&lt;FONT face="Times New Roman" size=3&gt;&lt;SPAN style="FONT-SIZE: 12pt"&gt;So, the generic word of wisdom is: take care of ACLs on your private keys, if you install them, or it may be the last time you’ve seen them!&lt;/SPAN&gt;&lt;/FONT&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;&lt;FONT face="Times New Roman" size=3&gt;&lt;SPAN style="FONT-SIZE: 12pt"&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/FONT&gt;&lt;/P&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=6733451" width="1" height="1"&gt;</description><category domain="http://blogs.msdn.com/eldar/archive/tags/Security/default.aspx">Security</category><category domain="http://blogs.msdn.com/eldar/archive/tags/C_2B002B00_/default.aspx">C++</category><category domain="http://blogs.msdn.com/eldar/archive/tags/Windows/default.aspx">Windows</category></item><item><title>Ghosts and ghouls in your server: 0x80004015 -- NT Service out-of-body experience</title><link>http://blogs.msdn.com/eldar/archive/2007/03/14/ghosts-and-ghouls-in-your-server-0x80080005-nt-service-out-of-body-experience.aspx</link><pubDate>Wed, 14 Mar 2007 23:41:00 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:1882721</guid><dc:creator>EldarM</dc:creator><slash:comments>2</slash:comments><comments>http://blogs.msdn.com/eldar/comments/1882721.aspx</comments><wfw:commentRss>http://blogs.msdn.com/eldar/commentrss.aspx?PostID=1882721</wfw:commentRss><description>&lt;P&gt;Authors in the New Age genre like to quote so called out-of-body-experience like memories of people who survivedd clinical death, tunnel with the light in the end and so on. Today I found that this is not a purely human phenomena...&lt;/P&gt;
&lt;P&gt;Suppose you wrote an NT service and implemented a COM object inside. Sure thing, you have to call CoRegisterClassObject to register the class factory. Then you quickly start and stop your service and CoRegisterClassObject returns 0x80004015, which means that identity to run COM object and identity of the process don't match. EXCUSE ME? BUT HOW? The only way to do so is to set RunAs property on AppId registry key for your class CLSID, and you did not do that!!!&lt;/P&gt;
&lt;P&gt;Well, the secret is easy. Your initialization got a little late and your process already got shutdown event and even killed most of the threads. While it prepares itself for the better world and observes the light in the end of the tunnel, it's idenity SYSTEM evaporates and it transgresses into a new, sort of semi-divine entity that exists mostly as a memory inside the OS core... The problem is that what's allowed to SYSTEM, is not allowed to Jupiter, including registering a class with a different identity. Amazing, isn't it?&lt;BR&gt;&lt;/P&gt;And the fix is easy. It only happens if your service already shuts down, so you can just ignore this specific code. Well, not always -- it can also mean that your registry is bad -- but in this specific case that's just it. One-line fix, a whole day of investigation!...&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=1882721" width="1" height="1"&gt;</description><category domain="http://blogs.msdn.com/eldar/archive/tags/COM/default.aspx">COM</category><category domain="http://blogs.msdn.com/eldar/archive/tags/General+Windows/default.aspx">General Windows</category><category domain="http://blogs.msdn.com/eldar/archive/tags/Security/default.aspx">Security</category><category domain="http://blogs.msdn.com/eldar/archive/tags/Mines/default.aspx">Mines</category></item><item><title>I am Annoyed with Spam …and I don’t get it, why is it still a problem.</title><link>http://blogs.msdn.com/eldar/archive/2006/09/11/736255.aspx</link><pubDate>Mon, 11 Sep 2006 17:27:00 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:736255</guid><dc:creator>EldarM</dc:creator><slash:comments>18</slash:comments><comments>http://blogs.msdn.com/eldar/comments/736255.aspx</comments><wfw:commentRss>http://blogs.msdn.com/eldar/commentrss.aspx?PostID=736255</wfw:commentRss><description>...Frankly, when I think of spam fighting today, it reminds me the fight for communism in the former Soviet Union. It takes a lot of time, it creates jobs, and it does not bring tangible results......(&lt;a href="http://blogs.msdn.com/eldar/archive/2006/09/11/736255.aspx"&gt;read more&lt;/a&gt;)&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=736255" width="1" height="1"&gt;</description><category domain="http://blogs.msdn.com/eldar/archive/tags/General/default.aspx">General</category><category domain="http://blogs.msdn.com/eldar/archive/tags/Security/default.aspx">Security</category><category domain="http://blogs.msdn.com/eldar/archive/tags/Design+and+architecture/default.aspx">Design and architecture</category></item><item><title>Impersonation and authentication with ASP.Net</title><link>http://blogs.msdn.com/eldar/archive/2006/06/12/628535.aspx</link><pubDate>Mon, 12 Jun 2006 22:34:00 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:628535</guid><dc:creator>EldarM</dc:creator><slash:comments>3</slash:comments><comments>http://blogs.msdn.com/eldar/comments/628535.aspx</comments><wfw:commentRss>http://blogs.msdn.com/eldar/commentrss.aspx?PostID=628535</wfw:commentRss><description>&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;&lt;B style="mso-bidi-font-weight: normal"&gt;&lt;I style="mso-bidi-font-style: normal"&gt;&lt;SPAN style="COLOR: blue"&gt;The task: make a web user authenticated (either with him directly providing user ID or password or through domain, if he is already logged in) and run ASP.Net code under his/her ID.&lt;?xml:namespace prefix = o ns = "urn:schemas-microsoft-com:office:office" /&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/I&gt;&lt;/B&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;&lt;o:p&gt;&amp;nbsp;&lt;/o:p&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;Frankly, that’s very easy, but I noticed that sometimes even very good developers don’t know how to do that. In short, impersonation element in web.config does the trick. If you know the rest, that’s it, you don't need the rest of this post. &lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;&lt;o:p&gt;&amp;nbsp;&lt;/o:p&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;Otherwise, let’s just go through the process. First, go to your IIS folder, usually C:\Inetpub\wwwroot, and create a folder for your application/webservice, say C:\Inetpub\wwwroot\Hello. You can do that in Windows Explorer. I will show an example with webservice, &lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;&lt;o:p&gt;&amp;nbsp;&lt;/o:p&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;In this folder you will need two files: web.config and Hello.asmx (assuming you want to call your webservice Hello).&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;&lt;o:p&gt;&amp;nbsp;&lt;/o:p&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;Simple web.config looks like that:&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;&lt;o:p&gt;&amp;nbsp;&lt;/o:p&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;&amp;lt;?xml version="1.0"?&amp;gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;&amp;lt;configuration xmlns="http://schemas.microsoft.com/.NetConfiguration/v2.0"&amp;gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;&lt;SPAN style="mso-tab-count: 1"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;&amp;lt;appSettings/&amp;gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;&lt;SPAN style="mso-tab-count: 1"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;&amp;lt;connectionStrings/&amp;gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;&lt;SPAN style="mso-tab-count: 1"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;&amp;lt;system.web&amp;gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;&lt;SPAN style="mso-tab-count: 2"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;&amp;lt;customErrors mode="Off" /&amp;gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;&lt;SPAN style="mso-tab-count: 2"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;&amp;lt;compilation debug="true" defaultLanguage="c#" /&amp;gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;&lt;SPAN style="mso-tab-count: 1"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;&amp;lt;/system.web&amp;gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;&amp;lt;/configuration&amp;gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;&lt;o:p&gt;&amp;nbsp;&lt;/o:p&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;I have added debugging and set default language to C#, but that’s optional. Hello.asmx file is very simple:&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;&lt;o:p&gt;&amp;nbsp;&lt;/o:p&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;&amp;lt;%@ WebService Language="C#" CodeBehind="~/App_Code/Hello.cs" Class="Hello" %&amp;gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;&lt;o:p&gt;&amp;nbsp;&lt;/o:p&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;Now, create a folder App_Code (C:\Inetpub\wwwroot\Hello\App_Code), that’s where the actual code traditionally lives, and create Hello.cs file, already referenced in Hello.asmx:&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;&lt;o:p&gt;&amp;nbsp;&lt;/o:p&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;using System;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;using System.Web;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;using System.Web.Services;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;using System.Web.Services.Protocols;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;&lt;o:p&gt;&amp;nbsp;&lt;/o:p&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;[WebService(Namespace = "http://hellomedear.org/test/namespace/")]&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;[WebServiceBinding(ConformsTo = WsiProfiles.BasicProfile1_1)]&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;public class Hello : System.Web.Services.WebService&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;{&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;public Hello () {&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;}&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;&lt;o:p&gt;&amp;nbsp;&lt;/o:p&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;[WebMethod]&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;public string HelloMeDear() &lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;{&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;return "Hello, " + System.Security.Principal.WindowsIdentity.GetCurrent().Name.ToString() + "!";&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;}&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;}&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;&lt;o:p&gt;&amp;nbsp;&lt;/o:p&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;This way it will return back the name of the current user, so we can track our progress. So, are we ready? Let’s try. Enter address &lt;A href="http://yourmachine/hellome/hello.asmx"&gt;http://&lt;I style="mso-bidi-font-style: normal"&gt;yourmachine&lt;/I&gt;/hellome/hello.asmx&lt;/A&gt; in the browser. Oops... Error:&lt;/P&gt;
&lt;H1 style="MARGIN: auto 0in auto 0.5in"&gt;&lt;SPAN style="FONT-SIZE: 10pt"&gt;&lt;FONT color=#ff0000&gt;&lt;FONT face=Verdana&gt;Server Error in '/' Application. &lt;o:p&gt;&lt;/o:p&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;/SPAN&gt;&lt;/H1&gt;
&lt;H2 style="MARGIN: auto 0in auto 0.5in"&gt;&lt;FONT color=#800000&gt;&lt;FONT face=Verdana&gt;&lt;I&gt;&lt;SPAN style="FONT-SIZE: 10pt"&gt;Parser Error&lt;/SPAN&gt;&lt;/I&gt;&lt;SPAN style="FONT-SIZE: 10pt"&gt; &lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;/H2&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 12pt 0.5in"&gt;&lt;SPAN&gt;&lt;STRONG&gt;Description: &lt;/STRONG&gt;An error occurred during the parsing of a resource required to service this request. Please review the following specific parse error details and modify your source file appropriately. &lt;BR&gt;&lt;BR&gt;&lt;/SPAN&gt;&lt;B&gt;&lt;SPAN style="FONT-SIZE: 10pt; COLOR: black; FONT-FAMILY: Verdana; mso-bidi-font-family: Arial"&gt;Parser Error Message: &lt;/SPAN&gt;&lt;/B&gt;&lt;SPAN style="FONT-SIZE: 10pt; COLOR: black; FONT-FAMILY: Arial"&gt;Could not create type 'Hello'.&lt;BR&gt;&lt;BR&gt;&lt;/SPAN&gt;&lt;B&gt;&lt;SPAN style="FONT-SIZE: 10pt; COLOR: black; FONT-FAMILY: Verdana; mso-bidi-font-family: Arial"&gt;Source Error:&lt;/SPAN&gt;&lt;/B&gt;&lt;SPAN style="FONT-SIZE: 10pt; COLOR: black; FONT-FAMILY: Arial"&gt; &lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;TABLE class=MsoNormalTable style="BACKGROUND: #ffffcc; MARGIN: auto auto auto 0.5in; WIDTH: 100%; mso-cellspacing: 1.5pt" cellPadding=0 width="100%" border=0&gt;
&lt;TBODY&gt;
&lt;TR style="mso-yfti-irow: 0; mso-yfti-firstrow: yes; mso-yfti-lastrow: yes"&gt;
&lt;TD style="BORDER-RIGHT: #d4d0c8; PADDING-RIGHT: 0.75pt; BORDER-TOP: #d4d0c8; PADDING-LEFT: 0.75pt; PADDING-BOTTOM: 0.75pt; BORDER-LEFT: #d4d0c8; PADDING-TOP: 0.75pt; BORDER-BOTTOM: #d4d0c8; BACKGROUND-COLOR: transparent"&gt;&lt;PRE&gt;&lt;SPAN style="FONT-SIZE: 10pt; COLOR: black"&gt;&lt;o:p&gt;&lt;FONT face="Lucida Console"&gt;&amp;nbsp;&lt;/FONT&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/PRE&gt;&lt;PRE&gt;&lt;SPAN style="FONT-SIZE: 10pt; COLOR: red"&gt;&lt;FONT face="Lucida Console"&gt;Line 1:&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp; &lt;/SPAN&gt;&amp;lt;%@ WebService Language="C#" CodeBehind="~/App_Code/Hello.cs" Class="Hello" %&amp;gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/FONT&gt;&lt;/SPAN&gt;&lt;/PRE&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 12pt 0.5in"&gt;&lt;SPAN style="FONT-SIZE: 10pt; COLOR: black; FONT-FAMILY: Arial"&gt;&lt;BR&gt;&lt;/SPAN&gt;&lt;B&gt;&lt;SPAN style="FONT-SIZE: 10pt; COLOR: black; FONT-FAMILY: Verdana; mso-bidi-font-family: Arial"&gt;Source File: &lt;/SPAN&gt;&lt;/B&gt;&lt;SPAN style="FONT-SIZE: 10pt; COLOR: black; FONT-FAMILY: Arial"&gt;/hellome/hello.asmx&lt;/SPAN&gt;&lt;B&gt;&lt;SPAN style="FONT-SIZE: 10pt; COLOR: black; FONT-FAMILY: Verdana; mso-bidi-font-family: Arial"&gt; &amp;nbsp;&amp;nbsp; Line: &lt;/SPAN&gt;&lt;/B&gt;&lt;SPAN style="FONT-SIZE: 10pt; COLOR: black; FONT-FAMILY: Arial"&gt;1 &lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;DIV class=MsoNormal style="MARGIN: 0in 0in 0pt 0.5in; TEXT-ALIGN: center" align=center&gt;&lt;SPAN style="FONT-SIZE: 10pt; COLOR: black; FONT-FAMILY: Arial"&gt;
&lt;HR align=center width="100%" color=silver noShade SIZE=1&gt;
&lt;/SPAN&gt;&lt;/DIV&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt 0.5in"&gt;&lt;B&gt;&lt;SPAN style="FONT-SIZE: 10pt; COLOR: black; FONT-FAMILY: Verdana; mso-bidi-font-family: Arial"&gt;Version Information:&lt;/SPAN&gt;&lt;/B&gt;&lt;SPAN style="FONT-SIZE: 10pt; COLOR: black; FONT-FAMILY: Arial"&gt;&amp;nbsp;Microsoft .NET Framework Version:2.0.50727.42; ASP.NET Version:2.0.50727.42&lt;/SPAN&gt;&lt;SPAN style="FONT-SIZE: 10pt"&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;&lt;o:p&gt;&amp;nbsp;&lt;/o:p&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;Why? You forgot to tell IIS that there will be ASP.Net code in this folder. Go to &lt;B style="mso-bidi-font-weight: normal"&gt;Control Panel | Administrative Tools | Internet Information Services&lt;/B&gt;, then select default web site, open it and you’ll see your folder shown with a folder icon. Right-click on it, select &lt;B style="mso-bidi-font-weight: normal"&gt;Properties&lt;/B&gt;, and click on “&lt;B style="mso-bidi-font-weight: normal"&gt;Create&lt;/B&gt;” button near the grayed textbox &lt;B style="mso-bidi-font-weight: normal"&gt;Application name&lt;/B&gt;. The click &lt;B style="mso-bidi-font-weight: normal"&gt;OK&lt;/B&gt;, and the icon will become something mechanical. That’s what you want.&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;&lt;o:p&gt;&amp;nbsp;&lt;/o:p&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;Try again. Now you should get the list of available methods, which in our case is simply &lt;B style="mso-bidi-font-weight: normal"&gt;HelloMeDear&lt;/B&gt;. Click on it, and if you do that from the same machine, you will see a button &lt;B style="mso-bidi-font-weight: normal"&gt;Invoke&lt;/B&gt;, which let’s you try the method. &lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;&lt;o:p&gt;&amp;nbsp;&lt;/o:p&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;Click on it. A new windows will open with the result:&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;&lt;o:p&gt;&amp;nbsp;&lt;/o:p&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt 0.5in"&gt;&lt;FONT color=#0000ff&gt;&lt;SPAN class=m1&gt;&lt;SPAN style="FONT-SIZE: 9pt; FONT-FAMILY: Verdana"&gt;&amp;lt;?&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;SPAN class=pi1&gt;&lt;SPAN style="FONT-SIZE: 9pt; FONT-FAMILY: Verdana"&gt;xml version="1.0" encoding="utf-8" &lt;/SPAN&gt;&lt;/SPAN&gt;&lt;SPAN class=m1&gt;&lt;SPAN style="FONT-SIZE: 9pt; FONT-FAMILY: Verdana"&gt;?&amp;gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/FONT&gt;&lt;SPAN style="FONT-SIZE: 9pt; FONT-FAMILY: Verdana"&gt; &lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt 0.5in"&gt;&lt;SPAN class=m1&gt;&lt;SPAN style="FONT-SIZE: 9pt; FONT-FAMILY: Verdana"&gt;&lt;FONT color=#0000ff&gt;&amp;lt;&lt;/FONT&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;SPAN class=t1&gt;&lt;SPAN style="FONT-SIZE: 9pt; FONT-FAMILY: Verdana"&gt;&lt;FONT color=#990000&gt;string&lt;/FONT&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;SPAN class=ns1&gt;&lt;SPAN style="FONT-SIZE: 9pt; FONT-FAMILY: Verdana"&gt;&lt;FONT color=#ff0000&gt; xmlns&lt;/FONT&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;SPAN class=m1&gt;&lt;SPAN style="FONT-SIZE: 9pt; FONT-FAMILY: Verdana"&gt;&lt;FONT color=#0000ff&gt;="&lt;/FONT&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;B&gt;&lt;SPAN style="FONT-SIZE: 9pt; COLOR: red; FONT-FAMILY: Verdana"&gt;http://hellomedear.org/test/namespace/&lt;/SPAN&gt;&lt;/B&gt;&lt;SPAN class=m1&gt;&lt;SPAN style="FONT-SIZE: 9pt; FONT-FAMILY: Verdana"&gt;&lt;FONT color=#0000ff&gt;"&amp;gt;&lt;/FONT&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;SPAN class=tx1&gt;&lt;SPAN style="FONT-SIZE: 9pt; FONT-FAMILY: Verdana"&gt;&lt;STRONG&gt;Hello, NT AUTHORITY\NETWORK SERVICE!&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;SPAN class=m1&gt;&lt;SPAN style="FONT-SIZE: 9pt; FONT-FAMILY: Verdana"&gt;&lt;FONT color=#0000ff&gt;&amp;lt;/&lt;/FONT&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;SPAN class=t1&gt;&lt;SPAN style="FONT-SIZE: 9pt; FONT-FAMILY: Verdana"&gt;&lt;FONT color=#990000&gt;string&lt;/FONT&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;SPAN class=m1&gt;&lt;SPAN style="FONT-SIZE: 9pt; FONT-FAMILY: Verdana"&gt;&lt;FONT color=#0000ff&gt;&amp;gt;&lt;/FONT&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;SPAN style="FONT-SIZE: 9pt; FONT-FAMILY: Verdana"&gt; &lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;&lt;o:p&gt;&amp;nbsp;&lt;/o:p&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;That’s nice, but &lt;B style="mso-bidi-font-weight: normal"&gt;NT AUTHORITY\NETWORK SERVICE&lt;/B&gt; is not your ID. What happened?&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;&lt;o:p&gt;&amp;nbsp;&lt;/o:p&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;Go again into properties of your folder in IIS management, pick &lt;B style="mso-bidi-font-weight: normal"&gt;Directory Security&lt;/B&gt; tab, and press &lt;B style="mso-bidi-font-weight: normal"&gt;Edit&lt;/B&gt; for &lt;B style="mso-bidi-font-weight: normal"&gt;Authentication and access control&lt;/B&gt;. See “&lt;B style="mso-bidi-font-weight: normal"&gt;Enable anonymous access&lt;/B&gt;” checked? That’s the problem. Even if you’ll get impersonation, it will be that automatic user marked in the textboxes next to it. Actually, let’s try it.&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;&lt;o:p&gt;&amp;nbsp;&lt;/o:p&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;Go to your folder and open web.config file. First add&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;&lt;SPAN style="mso-tab-count: 2"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;&amp;lt;identity impersonate="true" /&amp;gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;into &amp;lt;system.web&amp;gt; element. Try again:&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;&lt;o:p&gt;&amp;nbsp;&lt;/o:p&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt 0.5in"&gt;&lt;FONT color=#0000ff&gt;&lt;SPAN class=m1&gt;&lt;SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: Verdana"&gt;&amp;lt;?&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;SPAN class=pi1&gt;&lt;SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: Verdana"&gt;xml version="1.0" encoding="utf-8" &lt;/SPAN&gt;&lt;/SPAN&gt;&lt;SPAN class=m1&gt;&lt;SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: Verdana"&gt;?&amp;gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/FONT&gt;&lt;SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: Verdana"&gt; &lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt 0.5in"&gt;&lt;SPAN class=m1&gt;&lt;SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: Verdana"&gt;&lt;FONT color=#0000ff&gt;&amp;lt;&lt;/FONT&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;SPAN class=t1&gt;&lt;SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: Verdana"&gt;&lt;FONT color=#990000&gt;string&lt;/FONT&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;SPAN class=ns1&gt;&lt;SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: Verdana"&gt;&lt;FONT color=#ff0000&gt; xmlns&lt;/FONT&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;SPAN class=m1&gt;&lt;SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: Verdana"&gt;&lt;FONT color=#0000ff&gt;="&lt;/FONT&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;B&gt;&lt;SPAN style="FONT-SIZE: 10pt; COLOR: red; FONT-FAMILY: Verdana"&gt;http://hellomedear.org/test/namespace/&lt;/SPAN&gt;&lt;/B&gt;&lt;SPAN class=m1&gt;&lt;SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: Verdana"&gt;&lt;FONT color=#0000ff&gt;"&amp;gt;&lt;/FONT&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;SPAN class=tx1&gt;&lt;SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: Verdana"&gt;&lt;STRONG&gt;Hello, YOURMACHINE\IUSR_ YOURMACHINE!&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;SPAN class=m1&gt;&lt;SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: Verdana"&gt;&lt;FONT color=#0000ff&gt;&amp;lt;/&lt;/FONT&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;SPAN class=t1&gt;&lt;SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: Verdana"&gt;&lt;FONT color=#990000&gt;string&lt;/FONT&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;FONT color=#0000ff&gt;&lt;SPAN class=m1&gt;&lt;SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: Verdana"&gt;&amp;gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: Verdana"&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/FONT&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;&lt;o:p&gt;&amp;nbsp;&lt;/o:p&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;You’ve got that impersonated user. To avoid that, go again into IIS configuration for your folder, &lt;B style="mso-bidi-font-weight: normal"&gt;Directory Security&lt;/B&gt;, edit &lt;B style="mso-bidi-font-weight: normal"&gt;Authentication and access control&lt;/B&gt;, and uncheck &lt;B style="mso-bidi-font-weight: normal"&gt;Enable anonymous access&lt;/B&gt;, plus check checkbox &lt;B style="mso-bidi-font-weight: normal"&gt;Integrated Windows authentication&lt;/B&gt;. Try now:&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;&lt;o:p&gt;&amp;nbsp;&lt;/o:p&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt 0.5in"&gt;&lt;FONT color=#0000ff&gt;&lt;SPAN class=m1&gt;&lt;SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: Verdana"&gt;&amp;lt;?&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;SPAN class=pi1&gt;&lt;SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: Verdana"&gt;xml version="1.0" encoding="utf-8" &lt;/SPAN&gt;&lt;/SPAN&gt;&lt;SPAN class=m1&gt;&lt;SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: Verdana"&gt;?&amp;gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/FONT&gt;&lt;SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: Verdana"&gt; &lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt 0.5in"&gt;&lt;SPAN class=m1&gt;&lt;SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: Verdana"&gt;&lt;FONT color=#0000ff&gt;&amp;lt;&lt;/FONT&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;SPAN class=t1&gt;&lt;SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: Verdana"&gt;&lt;FONT color=#990000&gt;string&lt;/FONT&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;SPAN class=ns1&gt;&lt;SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: Verdana"&gt;&lt;FONT color=#ff0000&gt; xmlns&lt;/FONT&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;SPAN class=m1&gt;&lt;SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: Verdana"&gt;&lt;FONT color=#0000ff&gt;="&lt;/FONT&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;B&gt;&lt;SPAN style="FONT-SIZE: 10pt; COLOR: red; FONT-FAMILY: Verdana"&gt;http://hellomedear.org/test/namespace/&lt;/SPAN&gt;&lt;/B&gt;&lt;SPAN class=m1&gt;&lt;SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: Verdana"&gt;&lt;FONT color=#0000ff&gt;"&amp;gt;&lt;/FONT&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;SPAN class=tx1&gt;&lt;SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: Verdana"&gt;&lt;STRONG&gt;Hello, YOURMACHINE\yourID!&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;SPAN class=m1&gt;&lt;SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: Verdana"&gt;&lt;FONT color=#0000ff&gt;&amp;lt;/&lt;/FONT&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;SPAN class=t1&gt;&lt;SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: Verdana"&gt;&lt;FONT color=#990000&gt;string&lt;/FONT&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;SPAN class=m1&gt;&lt;SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: Verdana"&gt;&lt;FONT color=#0000ff&gt;&amp;gt;&lt;/FONT&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: Verdana"&gt; &lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;&lt;o:p&gt;&amp;nbsp;&lt;/o:p&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;You’ve got it! Actually, it’s nice to add also:&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;&lt;o:p&gt;&amp;nbsp;&lt;/o:p&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;&lt;SPAN style="mso-tab-count: 2"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;&amp;lt;authentication mode="Windows"/&amp;gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;&lt;o:p&gt;&amp;nbsp;&lt;/o:p&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;into your web.config file along with &lt;B style="mso-bidi-font-weight: normal"&gt;impersonation&lt;/B&gt; element. That’s it.&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;&lt;o:p&gt;&amp;nbsp;&lt;/o:p&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;&lt;B style="mso-bidi-font-weight: normal"&gt;&lt;SPAN style="COLOR: blue"&gt;So, all steps in a short list:&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/B&gt;&lt;/P&gt;
&lt;OL style="MARGIN-TOP: 0in" type=1&gt;
&lt;LI class=MsoNormal style="MARGIN: 0in 0in 0pt; COLOR: blue; mso-list: l0 level1 lfo1; tab-stops: list .5in"&gt;&lt;B style="mso-bidi-font-weight: normal"&gt;Create IIS folder&lt;o:p&gt;&lt;/o:p&gt;&lt;/B&gt;&lt;/LI&gt;
&lt;LI class=MsoNormal style="MARGIN: 0in 0in 0pt; COLOR: blue; mso-list: l0 level1 lfo1; tab-stops: list .5in"&gt;&lt;B style="mso-bidi-font-weight: normal"&gt;Create web.config file (see below to get important element)&lt;o:p&gt;&lt;/o:p&gt;&lt;/B&gt;&lt;/LI&gt;
&lt;LI class=MsoNormal style="MARGIN: 0in 0in 0pt; COLOR: blue; mso-list: l0 level1 lfo1; tab-stops: list .5in"&gt;&lt;B style="mso-bidi-font-weight: normal"&gt;Create .asmx file (see above)&lt;o:p&gt;&lt;/o:p&gt;&lt;/B&gt;&lt;/LI&gt;
&lt;LI class=MsoNormal style="MARGIN: 0in 0in 0pt; COLOR: blue; mso-list: l0 level1 lfo1; tab-stops: list .5in"&gt;&lt;B style="mso-bidi-font-weight: normal"&gt;Create App_Code subfolder and create there .cs file (see above)&lt;o:p&gt;&lt;/o:p&gt;&lt;/B&gt;&lt;/LI&gt;
&lt;LI class=MsoNormal style="MARGIN: 0in 0in 0pt; COLOR: blue; mso-list: l0 level1 lfo1; tab-stops: list .5in"&gt;&lt;B style="mso-bidi-font-weight: normal"&gt;Go to Control Panel | Administrative Tools | Internet Information Services, open, select default website, select your folder under it, right click, Properties.&lt;o:p&gt;&lt;/o:p&gt;&lt;/B&gt;&lt;/LI&gt;
&lt;LI class=MsoNormal style="MARGIN: 0in 0in 0pt; COLOR: blue; mso-list: l0 level1 lfo1; tab-stops: list .5in"&gt;&lt;B style="mso-bidi-font-weight: normal"&gt;Create application (button on the left of Application name:)&lt;o:p&gt;&lt;/o:p&gt;&lt;/B&gt;&lt;/LI&gt;
&lt;LI class=MsoNormal style="MARGIN: 0in 0in 0pt; COLOR: blue; mso-list: l0 level1 lfo1; tab-stops: list .5in"&gt;&lt;B style="mso-bidi-font-weight: normal"&gt;Go to Directory Security tab, click on Edit for Authentication and access control&lt;o:p&gt;&lt;/o:p&gt;&lt;/B&gt;&lt;/LI&gt;
&lt;LI class=MsoNormal style="MARGIN: 0in 0in 0pt; COLOR: blue; mso-list: l0 level1 lfo1; tab-stops: list .5in"&gt;&lt;B style="mso-bidi-font-weight: normal"&gt;Uncheck Anonymous access, check Integrated Windows authentication&lt;o:p&gt;&lt;/o:p&gt;&lt;/B&gt;&lt;/LI&gt;
&lt;LI class=MsoNormal style="MARGIN: 0in 0in 0pt; COLOR: blue; mso-list: l0 level1 lfo1; tab-stops: list .5in"&gt;&lt;B style="mso-bidi-font-weight: normal"&gt;You are done. To try go to &lt;A href="http://yourserver/hellome/hello.asmx"&gt;http://yourserver/hellome/hello.asmx&lt;/A&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/B&gt;&lt;/LI&gt;&lt;/OL&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;&lt;o:p&gt;&amp;nbsp;&lt;/o:p&gt;&lt;/P&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=628535" width="1" height="1"&gt;</description><category domain="http://blogs.msdn.com/eldar/archive/tags/C_23002F00_dotNet+fun/default.aspx">C#/dotNet fun</category><category domain="http://blogs.msdn.com/eldar/archive/tags/Security/default.aspx">Security</category></item><item><title>Turning OFF AutoPlay</title><link>http://blogs.msdn.com/eldar/archive/2006/03/08/546530.aspx</link><pubDate>Thu, 09 Mar 2006 00:09:00 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:546530</guid><dc:creator>EldarM</dc:creator><slash:comments>2</slash:comments><comments>http://blogs.msdn.com/eldar/comments/546530.aspx</comments><wfw:commentRss>http://blogs.msdn.com/eldar/commentrss.aspx?PostID=546530</wfw:commentRss><description>&lt;P&gt;When you put a music CD in your computer, it starts to play. Is it cool? Probably, but not to everybody. Some people (including me) feel that it's annoying. You put you data CD-ROM into the disk, you are sure what you want to do about it, and Windows starts to suggest to show a picture gallery, just because there are few jpegs there. What's worse, it adds time to mount the drive, so if you have a dozen of disks and trying to find a single file on one of them, autoplay may be not the best idea. And last, but not the least, you may consider it a security problem. After all, after &lt;A href="http://blogs.technet.com/antimalware/archive/2005/11/12/414299.aspx" target=_blank&gt;Sony BMG Music Entertainment put rootkit on their music CDs&lt;/A&gt; (see also &lt;A href="http://www.computerworld.com/securitytopics/security/story/0,10801,108793,00.html" target=_blank&gt;here&lt;/A&gt;), that used autoplay to install DRM (Digital Rights Management) on user's computer, you may think twice before considering AutoPLay "cool". Where is the guarantee that a CD coming from your computer games magazine is free of such stuff? Or a CD with family photos burned by your aunt, who is notorius at catching up computer viruses? Or the memory stick, which you used in Internnet cafe? Makes think...&lt;/P&gt;
&lt;P&gt;So, here is how to turn it off on Windows 2000, XP (except Home Edition) and Windows 2003 Server:&lt;/P&gt;
&lt;OL&gt;
&lt;LI&gt;Start local policy editor (Start | Run, enter GPEDIT.MSC, press Enter) 
&lt;LI&gt;Go to Computer Configuration | Administrative Templates | System, double-click on "Turn Off Autoplay" 
&lt;LI&gt;Select "Enabled" --&amp;nbsp;I know, it's confusing. You are not enabling autoplay, you are enabling turning autoplay off. In the drop down box select either "All drives" or "CD ROM drives" If you select the second, your memory stick&amp;nbsp;still may be a problem. 
&lt;LI&gt;Click "Apply", "Ok", exit the editor, you are done.&lt;/LI&gt;&lt;/OL&gt;
&lt;P&gt;Caveats:&lt;/P&gt;
&lt;UL&gt;
&lt;LI&gt;Now that autoplay is off, Windows will get the list of files only when you clik on the drive. So, you will see a little pause, when you first look at the inserted drive in Windows Explorer. It's still much smaller delay than what Autoplay does. 
&lt;LI&gt;Setup disks that are supposed to start automatically, when you insert the disk, will stop to do so. That was the point, right?&amp;nbsp;You will need to go there in Explorer and double-click on the program to run. If in doubt, it's in autorun.inf file, which you can open with notepad. The line looks like:&lt;BR&gt;&lt;FONT face="Courier New"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; open=&lt;U&gt;&lt;STRONG&gt;Setup.exe&lt;/STRONG&gt;&lt;/U&gt;&lt;/FONT&gt;&lt;BR&gt;and the part after "open=" is the program to start. 
&lt;LI&gt;This does not work on XP Home Edition, Windows ME, 98 and below.&lt;/LI&gt;&lt;/UL&gt;
&lt;P&gt;Enjoy...&lt;/P&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=546530" width="1" height="1"&gt;</description><category domain="http://blogs.msdn.com/eldar/archive/tags/General+Windows/default.aspx">General Windows</category><category domain="http://blogs.msdn.com/eldar/archive/tags/Security/default.aspx">Security</category></item></channel></rss>