asp.net下的Process.Start()?

Roy*_*mir 12 c# asp.net iis iis-7.5 w3wp.exe

根据msdn:

ASP.NET网页和服务器控制代码在Web服务器上的ASP.NET辅助进程的上下文中执行.如果在ASP.NET网页或服务器控件中使用Start方法,则新进程将在具有受限权限的Web服务器上执行.该过程不会在与客户端浏览器相同的上下文中启动,也无法访问用户桌面.

哪个 帐号正是"限制权限"

示例:

  • 我已经登录win7了 RoyiN
  • Windows身份验证已启用
  • 模拟被启用BobK web.config文件(在整个网站)
  • W3WP用户UserA(不是网络也不ApplicationPoolIdentity).

在C#我做Process.start("....cmd.exe...")( Startinfo证书为: " Martin", " Password"" Domain")

  • account最终运行的效率是谁cmd.exe

  • "受限制的权限"实际上与谁有关?

Jer*_*all 5

模仿不会在这里发挥作用,因为在引擎盖下,Process.Start依赖于两个本机Win32调用之一:

如果提供了ProcessStartInfo.UserName:

CreateProcessWithLogonW(startInfo.UserName, startInfo.Domain, ...)
Run Code Online (Sandbox Code Playgroud)

CreateProcessWithLogonW

如果不:

CreateProcess(null, cmdLine, null, null, true, ...)
Run Code Online (Sandbox Code Playgroud)

CreateProcess的

null传入CreateProcess 的s是可能会咬你的; 来自MSDN:

结构的lpSecurityDescriptor成员指定主线程的安全描述符.如果lpThreadAttributes为NULL或lpSecurityDescriptor为NULL,则该线程将获取默认安全描述符.线程的默认安全描述符中的ACL来自进程令牌.

注意它从进程令牌说,而不是调用线程 - 模拟身份没有机会加入聚会,因为它绑定到线程.