Introduction
It can be very tricky to analyze the relevant service account and its file system permissions in order to evaluate if a compromised ASP.NET application can access sensitive resources (file system / network / processes) on the web server. Especially from IIS 6 to IIS 7.5 there is quite a big change in how the service accounts are isolated on IIS.
Contents
Many different factors influence under which identity an IIS Worker Process runs. All the following settings need to be evaluated in order to be able make a clear statement which service account(s) are relevant.
Check IIS Application Pool Identity
- LocalService or LocalSystem
(Should obviously not be choosen at all, since they are high privileged built-in system accounts) - NetworkService
(Built-In service account with least privileges designed for low trusted network services like a web application. It was best practice to use this account prior to IIS6 or 7. Problem is that the web application shares the process memory and file access permissions with all the other services using the NETWORK SERVICE account. This causes insufficient application isolation.) - ApplicationPoolIdentity
(New and better application isolation with IIS 7.5: A “virtual” account is generated automatically with the name of the application pool, e.g. “IIS AppPool \ DefaultAppPool ” or IIS ” AppPool \ XSSViewStateUser ” and cannot be seen in the Users and Group Configuration Dialog. You need to specify exact user name in the FilePermission Dialog to give this account permission on a certain folder. Using this option, no custom service accounts need to be configured anymore for the application pools since IIS handles them automatically. This provides a maximum isolation of applications.)
Check IIS Anonymous Authentication Identity
- IUSR
( Built-In account with least privileges designed to provide file system access for anonymous users of web applications. ) - ApplicationPoolIdentity
(The “virtual” account configured as the Application Pool Identity. –> Check IIS Application Pool Identity )
Check ASP.NET Authentication Scheme
- <authentication mode=”Windows” /><identity impersonate=”false” />
(With Windows authentication but without impersonation, ASP.NET will run as the Application Pool Identity and needs read and write access, depending on the application. –> Check IIS Application Pool Identity
but as well needs the IIS-authenticated caller read access –> Check IIS Anonymous Authentication Identity) - <authentication mode=”Windows” /><identity impersonate=”true” />
(With Windows authentication and impersonation, ASP.NET runs as the IIS-authenticated caller and needs read and write access, depending on the application. –> Check IIS Anonymous Authentication Identity
but as well needs the Application Pool Identity read access –> Check IIS Application Pool Identity )
(Attention, In IIS 7 you need to consider the fact that impersonation can only be used with the “Classic Managed Pipeline Mode” and not the “Integrated Managed Pipeline Mode” mode. Second is the default) - <authentication mode=”None” /> or <authentication mode=”Forms” />
(Without Windows authentication, ASP.NET runs as the as the Application Pool Identity . –> Check IIS Application Pool Identity )




