<?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>What User Identity does IIS use to run code like ISAPI and CGI, Part 2</title><link>http://blogs.msdn.com/david.wang/archive/2005/06/29/IIS-User-Identity-to-Run-Code-Part-2.aspx</link><description>I seem to have forgotten to describe how the following aspect of IIS functions in the prior post because I was concentrated on clarifying something else (that your Windows logon is NOT the same as logon via IIS). Thus, I got the following followup: Question:</description><dc:language>en-US</dc:language><generator>CommunityServer 2.1 SP1 (Build: 61025.2)</generator><item><title>What User Identity does IIS use to run code like ISAPI and CGI?</title><link>http://blogs.msdn.com/david.wang/archive/2005/06/29/IIS-User-Identity-to-Run-Code-Part-2.aspx#434085</link><pubDate>Thu, 30 Jun 2005 06:02:35 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:434085</guid><dc:creator>David Wang</dc:creator><description>What User Identity does IIS use to run code like ISAPI and CGI.</description></item><item><title>HOWTO: Diagnose 401.x HTTP errors on IIS</title><link>http://blogs.msdn.com/david.wang/archive/2005/06/29/IIS-User-Identity-to-Run-Code-Part-2.aspx#439574</link><pubDate>Sat, 16 Jul 2005 11:34:20 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:439574</guid><dc:creator>David Wang</dc:creator><description>One of the most common questions asked about IIS on the newsgroups as well as Microsoft Product Support...</description></item><item><title>HOWTO: Diagnose 401.x HTTP errors on IIS</title><link>http://blogs.msdn.com/david.wang/archive/2005/06/29/IIS-User-Identity-to-Run-Code-Part-2.aspx#441256</link><pubDate>Thu, 21 Jul 2005 09:43:54 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:441256</guid><dc:creator>David Wang</dc:creator><description>One of the most common questions asked about IIS on the newsgroups as well as Microsoft Product Support...</description></item><item><title>Can ISAPI Extension override its user impersonation?</title><link>http://blogs.msdn.com/david.wang/archive/2005/06/29/IIS-User-Identity-to-Run-Code-Part-2.aspx#455507</link><pubDate>Wed, 24 Aug 2005 12:11:41 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:455507</guid><dc:creator>David Wang</dc:creator><description>I usually want&amp;amp;amp;nbsp;a high ratio of answer content&amp;amp;amp;nbsp;to question content, but the following question...</description></item><item><title>re: What User Identity does IIS use to run code like ISAPI and CGI, Part 2</title><link>http://blogs.msdn.com/david.wang/archive/2005/06/29/IIS-User-Identity-to-Run-Code-Part-2.aspx#540203</link><pubDate>Tue, 28 Feb 2006 02:33:20 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:540203</guid><dc:creator>Martin Palmer</dc:creator><description>Great info. &amp;nbsp;I do have a question for you. &amp;nbsp;If the IUSR_Machinename account is out of sync with the OS how do you correct this issue?&lt;br&gt;&lt;br&gt;Thanks in advance and thanks for the article!&lt;br&gt;&lt;br&gt;Martin</description></item><item><title>re: What User Identity does IIS use to run code like ISAPI and CGI, Part 2</title><link>http://blogs.msdn.com/david.wang/archive/2005/06/29/IIS-User-Identity-to-Run-Code-Part-2.aspx#540272</link><pubDate>Tue, 28 Feb 2006 04:45:53 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:540272</guid><dc:creator>David.Wang</dc:creator><description>Martin - There are many ways to synchronize. Here is one approach:&lt;br&gt;&lt;br&gt;1. Set the NT User account to a known password:&lt;br&gt;NET USER IUSR_%COMPUTERNAME% NewPassword&lt;br&gt;&lt;br&gt;2. Change Anonymous username/password in IIS to match the known username/password:&lt;br&gt;&lt;a rel="nofollow" target="_new" href="http://blogs.msdn.com/david.wang/archive/2005/12/07/HOWTO_Synchronize_User_Credentials_in_IIS.aspx"&gt;http://blogs.msdn.com/david.wang/archive/2005/12/07/HOWTO_Synchronize_User_Credentials_in_IIS.aspx&lt;/a&gt;&lt;br&gt;&lt;br&gt;//David</description></item><item><title>re: What User Identity does IIS use to run code like ISAPI and CGI, Part 2</title><link>http://blogs.msdn.com/david.wang/archive/2005/06/29/IIS-User-Identity-to-Run-Code-Part-2.aspx#547250</link><pubDate>Thu, 09 Mar 2006 19:33:57 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:547250</guid><dc:creator>Martin Palmer</dc:creator><description>Thanks for your answer to my question and I did do what you sugested. &amp;nbsp;This is how I know the password is out of sync. &lt;br&gt;&lt;br&gt;What I really want to know is how do I tell IIS to get the new password for the IUSR accnt or how do I manually reset it. &amp;nbsp;&lt;br&gt;&lt;br&gt;I'm a programmer and create a number of sites on several different servers. &amp;nbsp;Usally when a site is created IIS populates the ananymous access option with the ISUR accnt and correct password. In the case of this server it doesn't.&lt;br&gt;&lt;br&gt;For the sanity of myself and other programmers in the company it would be benifitial if all the servers behaved consistently.&lt;br&gt;&lt;br&gt;Thanks again.&lt;br&gt;&lt;br&gt;Martin</description></item><item><title>re: What User Identity does IIS use to run code like ISAPI and CGI, Part 2</title><link>http://blogs.msdn.com/david.wang/archive/2005/06/29/IIS-User-Identity-to-Run-Code-Part-2.aspx#547733</link><pubDate>Fri, 10 Mar 2006 01:09:17 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:547733</guid><dc:creator>David.Wang</dc:creator><description>Martin - You cannot tell IIS to get the new password because it does not &amp;quot;own&amp;quot; the account. IIS can create the account when it doesn't exist, so it can obviously set the password and synchronize at that point. This is how it usually works and no one has to do anything. However, if you subsequently change things, either by changing the password for the user account or if you configure a different anonymous user, you are obviously responsible for synchronizing it at all places.&lt;br&gt;&lt;br&gt;At this point, it sounds like you either have:&lt;br&gt;1. W3SVC/AnonymousUser* is out of sync with the NT user account on that server&lt;br&gt;2. Your creation of websites is explicitly setting AnonymousUser* that is out of sync with that server&lt;br&gt;&lt;br&gt;For #1, my previous comment should allow you to address your issue. For #2, you need to fix your website creation code to use the right password.&lt;br&gt;&lt;br&gt;Personally, I suggest #1, where your site creation code does *not* set AnonymousUser* and let the local inheritance automatically work out... unless for some reason you need to explicitly control the anonymous user account... in which case you must do the work of #2.&lt;br&gt;&lt;br&gt;//David</description></item><item><title>re: What User Identity does IIS use to run code like ISAPI and CGI, Part 2</title><link>http://blogs.msdn.com/david.wang/archive/2005/06/29/IIS-User-Identity-to-Run-Code-Part-2.aspx#572690</link><pubDate>Mon, 10 Apr 2006 21:57:25 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:572690</guid><dc:creator>Laxmikanth</dc:creator><description>I really appreciate the time you take out to write out such detailed articles. They are definitely a great read.
&lt;br&gt;
&lt;br&gt;Are there any subtle differences in Worker Process’s impersonation of ASP ISAPI extension when it is configured to run as a predefined Network Service Identity and run as a Windows Network User Account?
&lt;br&gt;
&lt;br&gt;If your point 2 (describing the way IIS is designed to execute ISAPI extensions) is true, an ASP page executed as a result a user’s request should give identical results irrespective of the associated AppPool identity. However, my observation is that this is not entirely true for a situation with AppPool configured to use Network Service identity.
&lt;br&gt;
&lt;br&gt;Details:
&lt;br&gt;OS – Windows Server 2003 SP1 – member of Active Directory domain
&lt;br&gt;IIS – 6.0
&lt;br&gt;Windows SharePoint Services 2.0 SP2 installed and configured 
&lt;br&gt;
&lt;br&gt;We have an ASP application running under a user defined application pool. The AppPool is configured to run under a Windows Network user identity (this identity is not an administrator on this computer). An ASP page in this application (has some bad code) uses Windows Scripting host to make calls to a SharePoint’s STADM.EXE. This particular EXE requires that the calling user be a local administrator of the current system. This page (and the call to STSADM.EXE) executes without an error when the requestor is a local administrator. This fits into your explanation of the Worker Process impersonating the calling user to execute the ASP page under the Authenticated identity. 
&lt;br&gt;
&lt;br&gt;However, the same page requested by the same user fails to execute when the AppPool is configured for Network Service Identity. 
&lt;br&gt;
&lt;br&gt;Could you help me understand this?
&lt;br&gt;
&lt;br&gt;Btw, you look good in the white turtle….
&lt;br&gt;
&lt;br&gt;
&lt;br&gt;</description></item><item><title>re: What User Identity does IIS use to run code like ISAPI and CGI, Part 2</title><link>http://blogs.msdn.com/david.wang/archive/2005/06/29/IIS-User-Identity-to-Run-Code-Part-2.aspx#572784</link><pubDate>Mon, 10 Apr 2006 23:58:04 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:572784</guid><dc:creator>David.Wang</dc:creator><description>Laxmikanth - Actually, your question illustrates the detailed understanding one must have to distinguish when code is run &amp;quot;by ASP&amp;quot; or &amp;quot;by something else&amp;quot;.&lt;br&gt;&lt;br&gt;The difference here is NOT in the user impersonation done by the Worker Process but rather how CreateProcess() and the code it invokes interprets it.&lt;br&gt;&lt;br&gt;1. The Run() method of the Windows Scripting Host &amp;quot;WScript.Shell&amp;quot; object uses CreateProcess() to launch the command (you can easily figure this out by attaching a debugger with public symbols, setting breakpoints on CreateProcess*, and watching what gets hit)&lt;br&gt;&lt;br&gt;2. Here is documentation for CreateProcess() &lt;a rel="nofollow" target="_new" href="http://msdn.microsoft.com/library/default.asp?url=/library/en-us/dllproc/base/createprocess.asp"&gt;http://msdn.microsoft.com/library/default.asp?url=/library/en-us/dllproc/base/createprocess.asp&lt;/a&gt;&lt;br&gt;&lt;br&gt;3. Note that the documentation states:&lt;br&gt;If the calling process is impersonating another user, the new process uses the token for the calling process, not the impersonation token. To run the new process in the security context of the user represented by the impersonation token, use the CreateProcessAsUser or CreateProcessWithLogonW function.&lt;br&gt;&lt;br&gt;Thus, it is the Process Identity, not Impersonated Identity, which is used to run the STSADM.EXE. Thus, when you configure the AppPool as Network Service, it should not work, regardless of impersonated identity.&lt;br&gt;&lt;br&gt;As for why it &amp;quot;worked&amp;quot; when the Process Identity is not a local administrator - I am not sure, but it is easy to attach a debugger and use lsaexts.dumpToken() to figure out the difference.&lt;br&gt;&lt;br&gt;In any case, the difference is not in how IIS performs the Impersonation (there's only one way to do it) but rather in how invoked code use and interpret the Impersonation.&lt;br&gt;&lt;br&gt;//David</description></item><item><title>re: What User Identity does IIS use to run code like ISAPI and CGI, Part 2</title><link>http://blogs.msdn.com/david.wang/archive/2005/06/29/IIS-User-Identity-to-Run-Code-Part-2.aspx#573568</link><pubDate>Tue, 11 Apr 2006 21:19:42 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:573568</guid><dc:creator>Laxmikanth</dc:creator><description>David,&lt;br&gt;Thanks for your quick and prompt respone. &lt;br&gt;I believe I do not understand your response completely, but I would take time to read through it and discuss with my friends.&lt;br&gt;I shall write back to you in case of further questions.&lt;br&gt;&lt;br&gt;Once again, thanks a ton for your prompt response.&lt;br&gt;&lt;br&gt;</description></item><item><title>Is it ok to Change the IIS6 Service User Account?</title><link>http://blogs.msdn.com/david.wang/archive/2005/06/29/IIS-User-Identity-to-Run-Code-Part-2.aspx#581129</link><pubDate>Sat, 22 Apr 2006 05:22:12 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:581129</guid><dc:creator>David Wang</dc:creator><description>Sigh... security continues to befuddle users... because why would you change the Service User Account&amp;amp;amp;nbsp;from...</description></item><item><title>HOWTO: Run Console Applications from IIS6 on Windows Server 2003, Part 2</title><link>http://blogs.msdn.com/david.wang/archive/2005/06/29/IIS-User-Identity-to-Run-Code-Part-2.aspx#585977</link><pubDate>Fri, 28 Apr 2006 15:17:35 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:585977</guid><dc:creator>David Wang</dc:creator><description>I finally have enough blog entries about various portions of IIS6 request processing that I can stitch...</description></item><item><title>Office Automation and IIS</title><link>http://blogs.msdn.com/david.wang/archive/2005/06/29/IIS-User-Identity-to-Run-Code-Part-2.aspx#595991</link><pubDate>Fri, 12 May 2006 12:49:35 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:595991</guid><dc:creator>David Wang</dc:creator><description>Every once in a while, I see users asking about how to automate Office applications on the server, either...</description></item><item><title>re: What User Identity does IIS use to run code like ISAPI and CGI, Part 2</title><link>http://blogs.msdn.com/david.wang/archive/2005/06/29/IIS-User-Identity-to-Run-Code-Part-2.aspx#603236</link><pubDate>Sun, 21 May 2006 16:29:23 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:603236</guid><dc:creator>Michael Norton</dc:creator><description>David - you seem like the right resource for this question. I have a client who has created their own Web site. This was built over time from simple HTML pages and eventually grew into ASP pages and the like. They use a database for authentication of users and save the user token in a cookie. I don't believe this to be relevant except that I want you to understand they do NOT use NT Authentication for users and will not in the forseeable future.&lt;br&gt;&lt;br&gt;There is one page in their site that programatically creates, modifies, or deletes files on the site. Currently, the IUSR_account has fill rights to the site directory (create, modify, ...). I would like to set the IUSR_account rights to something lower and have this single page run as a different user.&lt;br&gt;&lt;br&gt;How can this be done?&lt;br&gt;</description></item><item><title>re: What User Identity does IIS use to run code like ISAPI and CGI, Part 2</title><link>http://blogs.msdn.com/david.wang/archive/2005/06/29/IIS-User-Identity-to-Run-Code-Part-2.aspx#607525</link><pubDate>Fri, 26 May 2006 02:38:00 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:607525</guid><dc:creator>AnilR</dc:creator><description>David, great article thanks. That cleared up my somewhat hazy view of the subject. &lt;br&gt;&lt;br&gt;So now the obvious question: I want to use Windows Authentication, and I want my ASP page (not ASP.Net) to know who the user is. However, I don't want to execute code using a users account; I want to use the application pool account, how?&lt;br&gt; &lt;br&gt;Thanks</description></item><item><title>re: What User Identity does IIS use to run code like ISAPI and CGI, Part 2</title><link>http://blogs.msdn.com/david.wang/archive/2005/06/29/IIS-User-Identity-to-Run-Code-Part-2.aspx#623646</link><pubDate>Fri, 09 Jun 2006 13:37:37 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:623646</guid><dc:creator>David.Wang</dc:creator><description>Michael - I suggest configuring a dedicated user account for use as Anonymous user account for that specific page, and give this user account full rights on the necessary directories/files to create/modify/delete files.&lt;br&gt;&lt;br&gt;Now, you may choose to limit the privileges of this particular user (user privileges are different from account rights to resources) as well as configure which part of the URL namespace has this anonymous user applicable. Of course, this approach has other security ramifications (such as repudiation), but that is really a flaw within this custom authorization scheme.&lt;br&gt;&lt;br&gt;//David</description></item><item><title>re: What User Identity does IIS use to run code like ISAPI and CGI, Part 2</title><link>http://blogs.msdn.com/david.wang/archive/2005/06/29/IIS-User-Identity-to-Run-Code-Part-2.aspx#623650</link><pubDate>Fri, 09 Jun 2006 13:42:18 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:623650</guid><dc:creator>David.Wang</dc:creator><description>AnilR - since ASP runs all code as the impersonated user and has no functionality to configure nor change that user identity, what you want to do is impossible with just &amp;nbsp;ASP.&lt;br&gt;&lt;br&gt;You can use or create 3rd party COM component DLLs that call RevertToSelf() on the thread, and then you invoke the COM component within the ASP page to change the user identity executing that ASP page from that point forward. Just remember that every time the ASP page is executed, IIS re-impersonates.&lt;br&gt;&lt;br&gt;//David</description></item><item><title>re: What User Identity does IIS use to run code like ISAPI and CGI, Part 2</title><link>http://blogs.msdn.com/david.wang/archive/2005/06/29/IIS-User-Identity-to-Run-Code-Part-2.aspx#649603</link><pubDate>Wed, 28 Jun 2006 15:29:48 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:649603</guid><dc:creator>Chris</dc:creator><description>David,&lt;br&gt;&lt;br&gt;The inforamtion you have provided here has been very helpful however I am still getting a cgi error. I created an anonymous user account specifically for the purpose of running .pl files on the local box as you suggest and given the create, modify, delete rights &amp;nbsp;to the appropriate folder/files yet I still get the following cgi error &amp;quot;The specified CGI application misbehaved by not returning a complete set of HTTP headers.&amp;quot; I also changed the anonymous account specified at the site level under &amp;quot;Authentication and access control&amp;quot; in IIS 6. What am I missing?&lt;br&gt;&lt;br&gt;Thank you,&lt;br&gt;Chris </description></item><item><title>re: What User Identity does IIS use to run code like ISAPI and CGI, Part 2</title><link>http://blogs.msdn.com/david.wang/archive/2005/06/29/IIS-User-Identity-to-Run-Code-Part-2.aspx#649616</link><pubDate>Wed, 28 Jun 2006 15:43:03 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:649616</guid><dc:creator>David.Wang</dc:creator><description>Chris - the 502 error (&amp;quot;The specified CGI application misbehaved by not returning a complete set of HTTP headers&amp;quot;) has to do with the response generated by the .pl script. It usually has nothing to do with the topic of this blog entry - user identity - unless the script blows up when running as the wrong user identity and generates a non-HTTP response -- which would then show up as a 502.&lt;br&gt;&lt;br&gt;The most important thing to diagnosing a 502 is to determine what the CGI script sent as the response. This can be done either by:&lt;br&gt;1. running the .pl script from the commandline as the appropriate user account and with the proper CGI environment variables set.&lt;br&gt;2. renaming the .pl to have a nph- prefix and make a request with a raw HTTP Client like WFetch to view the actual response generated by the .pl script as IIS runs it.&lt;br&gt;&lt;br&gt;#2 is the more realistic and my preferred verification method. It does require renaming a file and using a raw HTTP Client like WFetch from the IIS6 Resource Kit, but it is worth it because some CGI errors can only be debugged this way.&lt;br&gt;&lt;br&gt;//David</description></item><item><title>re: What User Identity does IIS use to run code like ISAPI and CGI, Part 2</title><link>http://blogs.msdn.com/david.wang/archive/2005/06/29/IIS-User-Identity-to-Run-Code-Part-2.aspx#649618</link><pubDate>Wed, 28 Jun 2006 15:50:55 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:649618</guid><dc:creator>Chris</dc:creator><description>Thank you for your detailed response David. It is curious though that if I change the IUSR account back to the old domain IUSR which is running on an old NT4 box that I don't get this error at all. It's only when I change it to the local IUSR or the guest account I created that it throws this error. After much reading I thought it was related to the lock down of IUSR in IIS 6 where IUSR is denied Write access to Web content by default. </description></item><item><title>re: What User Identity does IIS use to run code like ISAPI and CGI, Part 2</title><link>http://blogs.msdn.com/david.wang/archive/2005/06/29/IIS-User-Identity-to-Run-Code-Part-2.aspx#650003</link><pubDate>Wed, 28 Jun 2006 23:00:21 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:650003</guid><dc:creator>David.Wang</dc:creator><description>Chris - NT4 was also insecure and allowed Everyone Full Control, so the fact that it &amp;quot;works&amp;quot; on it does not mean it was anywhere near secure enough to work on Windows Server 2003 and IIS6.&lt;br&gt;&lt;br&gt;I would not assume that the problem is related to the &amp;quot;lock down of IUSR in IIS6&amp;quot; unless I see evidence. Guessing based on what you have read, without concrete evidence, is ineffective troubleshooting.&lt;br&gt;&lt;br&gt;I suggest starting from what you do observe - a 502 response - and work backwards from there because everything is then based on fact. 502 tells you that executing the CGI did not generate a proper response. There is no way that I jump from there to assuming that something is wrong with the anonymous user account and start acting on that assumption. I would try to isolate that response and examine what is not &amp;quot;proper&amp;quot; about it before making further assessments.&lt;br&gt;&lt;br&gt;If the response does not conform to CGI specifications, which IIS6 now checks (while previous IIS versions did not check), then that indicates a problem with the .pl script that needs to be fixed. Remember, just because it worked on IIS4 does not mean it is correct.&lt;br&gt;&lt;br&gt;If the response looks like an error response because of insufficient privileges, then depending on the authentication protocol, that suggests a problem with remote authenticated account. If anonymous protocol was chosen, then it is the anonymous user account that you configured. Domain IUSR and local IUSR are two totally different accounts (and Guest is a totally different account with different lockdown) with different names and possibly passwords, so I would never assume they give the same behavior when used by your script.&lt;br&gt;&lt;br&gt;My guess is that the latter is happening for local IUSR/Guest and is probably &amp;quot;by-design&amp;quot; - because it sounds like the .pl script is designed to work with the old domain IUSR.&lt;br&gt;&lt;br&gt;It is always your responsibility to figure out the correct user and privileges required by your application. If you don't know, then you need to learn how to figure it out.&lt;br&gt;&lt;br&gt;//David</description></item><item><title>re: What User Identity does IIS use to run code like ISAPI and CGI, Part 2</title><link>http://blogs.msdn.com/david.wang/archive/2005/06/29/IIS-User-Identity-to-Run-Code-Part-2.aspx#706776</link><pubDate>Sat, 19 Aug 2006 02:51:48 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:706776</guid><dc:creator>David.Wang</dc:creator><description>It's a 10K entry!&lt;br&gt;&lt;br&gt;//David</description></item><item><title>re: What User Identity does IIS use to run code like ISAPI and CGI, Part 2</title><link>http://blogs.msdn.com/david.wang/archive/2005/06/29/IIS-User-Identity-to-Run-Code-Part-2.aspx#719306</link><pubDate>Fri, 25 Aug 2006 01:57:41 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:719306</guid><dc:creator>Mark</dc:creator><description>After getting pass the 403.1 error in running perl scripts, I'm now getting a 502 error. File Monitor was able to tell me the error was caused by the script not finding the perl56.dll file. &amp;nbsp;I'm not sure why, but the script is looking for the dll file in the site's root folder. I can get around this problem by copy/paste the dll file to the root, but that's obviously not the way to solve this. I was wondering if you have any suggestions?</description></item><item><title>re: What User Identity does IIS use to run code like ISAPI and CGI, Part 2</title><link>http://blogs.msdn.com/david.wang/archive/2005/06/29/IIS-User-Identity-to-Run-Code-Part-2.aspx#724892</link><pubDate>Sat, 26 Aug 2006 06:00:23 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:724892</guid><dc:creator>Tiago</dc:creator><description>David,&lt;br&gt;&lt;br&gt;hope this does not fall out of context in the current blog, but given its importance here goes.&lt;br&gt;&lt;br&gt;While all the above is correct, there should be an important security awareness related to ASP.NET and the impersonated account with which the current request is being executed whether its anonymous/basic/IWA.&lt;br&gt;&lt;br&gt;While the whole request execution (inside the extension processing, not filter) is done through the impersonated account the Application_Start event is unfortunatelly executed under the process account (the account with which filters execute, not extensions) and that should also be noted as a security issue since ASP.NET web applications - AppDomains - at start time, lose their isolation at this precise time. Any web application can query the same data the other web applications query at that event. web applications should not involve authorized accesses inside this Application_Start event.&lt;br&gt;&lt;br&gt;There are several ways to circumvent this situation: using Session_Start (if using sessions), using an Application level auto-reset event used at some point inside the first http request processing and others ...&lt;br&gt;</description></item><item><title>re: What User Identity does IIS use to run code like ISAPI and CGI, Part 2</title><link>http://blogs.msdn.com/david.wang/archive/2005/06/29/IIS-User-Identity-to-Run-Code-Part-2.aspx#726808</link><pubDate>Sun, 27 Aug 2006 15:41:53 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:726808</guid><dc:creator>David.Wang</dc:creator><description>Mark - Your question is not really related to IIS.&lt;br&gt;&lt;br&gt;IIS just loads the ISAPI DLL or executes the CGI EXE. Any additional dependencies is the responsibility of the ISAPI/CGI itself.&lt;br&gt;&lt;br&gt;For example, if it is a runtime DLL loading dependency, then it is really PERL not installed correctly - which I can only suggest to contact the Perl support groups for advice.&lt;br&gt;&lt;br&gt;//David</description></item><item><title>re: What User Identity does IIS use to run code like ISAPI and CGI, Part 2</title><link>http://blogs.msdn.com/david.wang/archive/2005/06/29/IIS-User-Identity-to-Run-Code-Part-2.aspx#726812</link><pubDate>Sun, 27 Aug 2006 15:45:38 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:726812</guid><dc:creator>David.Wang</dc:creator><description>Tiago - thanks for the useful info.&lt;br&gt;&lt;br&gt;FYI: It really falls under the context of the specific ISAPI. IIS will run ISAPI and CGI as I describe above. What the ISAPI/CGI does in turn to execute its extensibility API... it is totally dependent on the ISAPI/CGI. There is no IIS configuration to affect this behavior.&lt;br&gt;&lt;br&gt;//David</description></item><item><title>re: What User Identity does IIS use to run code like ISAPI and CGI, Part 2</title><link>http://blogs.msdn.com/david.wang/archive/2005/06/29/IIS-User-Identity-to-Run-Code-Part-2.aspx#2261549</link><pubDate>Tue, 24 Apr 2007 19:07:07 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:2261549</guid><dc:creator>Anonymous Coward</dc:creator><description>&lt;p&gt;Can you further clarify the identity used when using an ISAPI extension such as PHP and you're using the default Application Pool identity of &amp;quot;NETWORK SERVICE&amp;quot;? The article seems to imply it should be using the app pool id as it's identity but it looks like its still using the IUSR id.&lt;/p&gt;
&lt;p&gt;When trying to call a PHP page anonymously (with anonymous access on for the website), I get the following from Authentication &amp;amp; Access Control Monitoring:&lt;/p&gt;
&lt;p&gt;ProcIdentity=&amp;quot;NT AUTHORITY\NETWORK SERVICE&amp;quot; ThreadIdentity=&amp;quot;XXXX\IUSR_YYYYYYY&amp;quot;&lt;/p&gt;
&lt;p&gt;I want to tie down file access and ACLS for the PHP installation to the Service not the IUSR!&lt;/p&gt;
</description></item><item><title>re: What User Identity does IIS use to run code like ISAPI and CGI, Part 2</title><link>http://blogs.msdn.com/david.wang/archive/2005/06/29/IIS-User-Identity-to-Run-Code-Part-2.aspx#2262608</link><pubDate>Tue, 24 Apr 2007 20:59:08 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:2262608</guid><dc:creator>Anonymous Coward</dc:creator><description>&lt;p&gt;Addendum....&lt;/p&gt;
&lt;p&gt;not the right log entries...&lt;/p&gt;
&lt;p&gt;To summarise.. looks like the verification of &amp;nbsp;the PHP DLL is done using the NETWORK SERVICE. This works because NTFS perms have been set, but &amp;nbsp;then subsequent access is using the IUSR id. GRR.&lt;/p&gt;
&lt;p&gt;Any help would be appreciated.&lt;/p&gt;
</description></item><item><title>re: What User Identity does IIS use to run code like ISAPI and CGI, Part 2</title><link>http://blogs.msdn.com/david.wang/archive/2005/06/29/IIS-User-Identity-to-Run-Code-Part-2.aspx#3421443</link><pubDate>Wed, 20 Jun 2007 13:14:21 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:3421443</guid><dc:creator>John Ortega</dc:creator><description>&lt;p&gt;Hello,&lt;/p&gt;
&lt;p&gt;I'm working on an ASP website with IIS 6 and Windows Server 2003. Something weird is happening and you seem like the one to help.&lt;/p&gt;
&lt;p&gt;I get page cannot be displayed on any attempt to call a shell command from the asp page. I've set all (I*) users in with full permissions. &lt;/p&gt;
&lt;p&gt;The funny thing is that when I remote login it works fine.&lt;/p&gt;
&lt;p&gt;Could you help?&lt;/p&gt;
&lt;p&gt;Thanks,&lt;/p&gt;
&lt;p&gt;John&lt;/p&gt;
</description></item><item><title>re: What User Identity does IIS use to run code like ISAPI and CGI, Part 2</title><link>http://blogs.msdn.com/david.wang/archive/2005/06/29/IIS-User-Identity-to-Run-Code-Part-2.aspx#4617736</link><pubDate>Tue, 28 Aug 2007 23:15:42 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:4617736</guid><dc:creator>Priti</dc:creator><description>&lt;p&gt;Hi,&lt;/p&gt;
&lt;p&gt;My .NET application uses word automation to create new documents. With Word Identity as 'Interactive user', my application works fine on the development machine.&lt;/p&gt;
&lt;p&gt;When I deploy it on the client server, it gives error saying the 'Configured identity is incorrect'. How do I configure IIS to run for Interactive user?&lt;/p&gt;
&lt;p&gt;Thanks,&lt;/p&gt;
&lt;p&gt;Priti&lt;/p&gt;
</description></item><item><title>re: What User Identity does IIS use to run code like ISAPI and CGI, Part 2</title><link>http://blogs.msdn.com/david.wang/archive/2005/06/29/IIS-User-Identity-to-Run-Code-Part-2.aspx#6361598</link><pubDate>Sun, 18 Nov 2007 14:17:56 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:6361598</guid><dc:creator>David.Wang</dc:creator><description>&lt;p&gt;Anonymous - For PHP ISAPI **EXTENSION**, what you observed is exactly correct and what you configured.&lt;/p&gt;
&lt;p&gt;IIS runs ISAPI Extension with the impersonated identity, which you've configured as IUSR for Anonymous authentication.&lt;/p&gt;
&lt;p&gt;IIS verifies PHP ISAPI DLL using process identity since it does the impersonation right before executing the ISAPI Extension DLL, while verification happens way earlier.&lt;/p&gt;
&lt;p&gt;There is no way for you to tie down PHP ISAPI access to just the process identity. It is not how IIS works. &lt;/p&gt;
&lt;p&gt;//David&lt;/p&gt;
</description></item><item><title>re: What User Identity does IIS use to run code like ISAPI and CGI, Part 2</title><link>http://blogs.msdn.com/david.wang/archive/2005/06/29/IIS-User-Identity-to-Run-Code-Part-2.aspx#8477582</link><pubDate>Fri, 09 May 2008 08:37:33 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:8477582</guid><dc:creator>Andre Ames</dc:creator><description>&lt;p&gt;Hello David,&lt;/p&gt;
&lt;p&gt;I am Andre from the Netherlands. I just want to say that you helped me out wiht this great site.&lt;/p&gt;
&lt;p&gt;So, thank you.&lt;/p&gt;
&lt;p&gt;Best regards,&lt;/p&gt;
&lt;p&gt;Andre&lt;/p&gt;
</description></item><item><title>re: What User Identity does IIS use to run code like ISAPI and CGI, Part 2</title><link>http://blogs.msdn.com/david.wang/archive/2005/06/29/IIS-User-Identity-to-Run-Code-Part-2.aspx#8721305</link><pubDate>Fri, 11 Jul 2008 17:02:13 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:8721305</guid><dc:creator>Martin Meixger</dc:creator><description>&lt;p&gt;Hi,&lt;/p&gt;
&lt;p&gt;i discovered, that using FastCGI, PHP run's under the process identity.&lt;/p&gt;
&lt;p&gt;With fastcgi.impersonate = 1 in PHP.INI you can selectively switch back to the anonymous / authenticated user.&lt;/p&gt;
&lt;p&gt;I'm going to try this on one of my production Servers.&lt;/p&gt;
&lt;p&gt;@David: Thank you so much for this great blog. I learned so much from your postings!&lt;/p&gt;
</description></item></channel></rss>