简体   繁体   English

IIS7 Windows 2008服务器上的经典ASP模拟问题

[英]Classic ASP Impersonation problem on IIS7 Windows 2008 server

I am trying to write to a file on a server (web05) from a classic asp site running on Windows 2008 serer on IIS7 (webadmin). 我试图从IIS7(webadmin)上的Windows 2008 serer上运行的经典asp站点写入服务器(web05)上的文件。 This fails and web05 logs an anonymous logon attempt during the course of the save operation. 这会失败,web05会在保存操作过程中记录匿名登录尝试。

Webadmin's site is running on an app pool in classic mode with a domain user as the process account. Webadmin的站点以经典模式在应用程序池上运行,域用户作为进程帐户。 The process account has rights to "Trust this user for delegation to any service (Kerberos only)". 进程帐户具有“信任此用户以委派任何服务(仅限Kerberos)”的权限。 The same applies for the web05 and webadmin servers. 这同样适用于web05和webadmin服务器。

The site is using Windows Authentication and the idea is that when I log on the site with my domain user, the rights of my user should define what I am allowed to do in the context of the IIS site. 该网站正在使用Windows身份验证,我的想法是,当我使用我的域用户登录该站点时,我的用户的权限应该定义我在IIS站点的上下文中可以执行的操作。 If I turn on Basic Authentication, everything works fine. 如果我打开基本身份验证,一切正常。

I have also used setspn.exe to add an SPN for the URL. 我还使用setspn.exe为URL添加SPN。 If I type setspn.exe -L webadmin, I get: 如果我输入setspn.exe -L webadmin,我会得到:

HTTP/webadmin.companyname.com
TERMSRV/webadmin
TERMSRV/webadmin.companypub.local
HOST/webadmin
HOST/webadmin.companypub.local

So from what I understand the SPNs are set up correctly. 所以据我所知,SPN设置正确。

If I run processmonitor on webadmin while the save operation is executed, it says that the process is indeed impersonating my domain user - but getting "Access denied" (and as I said before, web05 logs an anonymous logon attempt). 如果我在执行保存操作时在webadmin上运行processmonitor,它表示该进程确实冒充我的域用户 - 但是获得“拒绝访问”(正如我之前所说,web05记录匿名登录尝试)。

Any idea what causes this? 知道是什么原因引起的吗?

Kind regards, Simon 亲切的问候,西蒙

It sounds to me like you're a little confused over impersonation. 听起来像你对模仿有点困惑。 The process isn't impersonating the domain user account its simply running as that user. 该过程不会模拟域用户帐户,只是作为该用户运行。 There is a difference. 它们是有区别的。

When a request arrives into ASP it will then impersonate a user and the thread handling the request will be running under the security token of the impersonated user. 当请求到达ASP时,它将模拟用户,处理请求的线程将在模拟用户的安全令牌下运行。 Its quite possible to have the same process impersonating multiple different users in multiple threads. 很有可能在多个线程中模拟多个不同用户的相同进程。 In most cases where the anonymous user access is enabled this user is the Guest level IUSR account. 在启用匿名用户访问的大多数情况下,此用户是访客级别IUSR帐户。 Its most likely that its under this user your code is attempting and failing to run. 最有可能的是,在此用户下,您的代码正在尝试并且无法运行。

However if anonymous is turned off for the resource being accessed or the IUSR account does not have access to the resource then the a 401 response is sent back, with some indication of what authentication protocols it will accept. 但是,如果为正在访问的资源关闭匿名或者IUSR帐户无权访问该资源,则会返回a 401响应,并指示它将接受哪些身份验证协议。 The browser may then attempt to authenticate the connection using either the current users credentials or request some credentials from the user. 然后,浏览器可以尝试使用当前用户凭证来认证连接,或者请求来自用户的一些凭证。

You don't specify exactly how you are attempting to save file. 您没有准确指定尝试保存文件的方式。 Its worth pointing out couple of things though. 值得指出的是几件事。

  1. ASP code exection which may subsequently result in an access denied will not use the above mechanism to try to resolve the user. ASP代码执行可能随后导致访问被拒绝将不会使用上述机制来尝试解析用户。
  2. Once a connection is authenticated it often continues to be re-used for subsequent requests (which is counter-intuative to the knowledge the HTTP is a "connection-less" protocol). 一旦连接被认证,它通常继续被重新用于后续请求(这对于HTTP是“无连接”协议的知识是反直觉的)。

I ran into this same issue and it turned out to be a simple change to the application pool. 我遇到了同样的问题,结果发现它是对应用程序池的一个简单改动。 If enable 32-bit applications is set to FALSE then I recieved a prompt to login to the machine. 如果启用32位应用程序设置为FALSE,则我收到登录计算机的提示。 Setting this value to true fixed the issue. 将此值设置为true可解决此问题。

I am trying to clean up my previous questions. 我正在努力清理以前的问题。 This answer is not sufficient to answer the question above, but I concluded that it is better to provide some insight than none. 这个答案不足以回答上面的问题,但我得出的结论是,提供一些洞察力比没有洞察力更好。 If op disagrees, please take necessary action. 如果op不同意,请采取必要的行动。

This is a way back - but I recall wanting to run kerberos authentication on this app. 这是回归 - 但我记得想在这个应用程序上运行kerberos身份验证。 The problem turned out to be that I tried to do kerberos outside the firewall. 问题原来是我试图在防火墙外做kerberos。 The app would work fine within the domain and firewall of the server's home domain but failed whenever requests came from outside. 该应用程序可以在服务器主域的域和防火墙内正常工作,但无论何时来自外部的请求都会失败。

I did a lot of chatting with an Irish technician in Microsoft, and he taught me a little about the limitations when using Kerberos. 我和微软的一位爱尔兰技术人员进行了很多聊天,他教我一些使用Kerberos时的局限性。 The reason I wanted to use Kerberos was that I didn't like the thought of Basic Windows authentication being unencrypted. 我想使用Kerberos的原因是我不喜欢基本Windows身份验证未加密的想法。

Good luck with your Kerberos quest :-) 祝你的Kerberos任务好运:-)

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM