为什么我可以附加 visual studio 到没有管理员权限的进程
Why can I attach visual studio to process with no admin rights
好吧,标题总结了我的问题,但我会详细说明。我一直认为任何没有管理员权限运行的进程都不应该能够访问任何其他进程的内存space,当然也不应该停止它的执行。
但是,在 non-privileged 帐户下使用 visual studio 运行,我可以附加到在同一帐户下运行的某些进程并调试它们。为什么这是可能的?操作系统不应该阻止这种情况吗?
提前致谢并干杯
为了访问内存 space 我们需要使用 PROCESS_VM_READ|PROCESS_VM_OPERATION|PROCESS_VM_WRITE
打开进程 .. 因为这不是强制性的需要 SE_DEBUG_PRIVILEGE
- 如果进程 运行 在与调试器相同的会话,具有相同的标记——通常是安全描述符 (DACL
) 允许为此调试器打开它。这绝对是预料之中的。所以在这里提问 - 我们是否可以打开具有完全调试权限的进程?如果此 "peer" 进程(运行 在同一用户下,具有相同的权限)- 为什么不呢?
The debugger must have appropriate access to the target process, and
it must be able to open the process for PROCESS_ALL_ACCESS.
DebugActiveProcess can fail if the target process is created with a security descriptor that grants the debugger anything less than full
access. If the debugging process has the SE_DEBUG_NAME privilege
granted and enabled, it can debug any process.
和你自己的评论 - 除了受保护的进程,如果只有你的调试器在调用 DebugActiveProcess 时也受保护的进程(保护级别不少)(是的,这是可能的调试受保护的进程还有)
好吧,标题总结了我的问题,但我会详细说明。我一直认为任何没有管理员权限运行的进程都不应该能够访问任何其他进程的内存space,当然也不应该停止它的执行。
但是,在 non-privileged 帐户下使用 visual studio 运行,我可以附加到在同一帐户下运行的某些进程并调试它们。为什么这是可能的?操作系统不应该阻止这种情况吗?
提前致谢并干杯
为了访问内存 space 我们需要使用 PROCESS_VM_READ|PROCESS_VM_OPERATION|PROCESS_VM_WRITE
打开进程 .. 因为这不是强制性的需要 SE_DEBUG_PRIVILEGE
- 如果进程 运行 在与调试器相同的会话,具有相同的标记——通常是安全描述符 (DACL
) 允许为此调试器打开它。这绝对是预料之中的。所以在这里提问 - 我们是否可以打开具有完全调试权限的进程?如果此 "peer" 进程(运行 在同一用户下,具有相同的权限)- 为什么不呢?
The debugger must have appropriate access to the target process, and it must be able to open the process for PROCESS_ALL_ACCESS. DebugActiveProcess can fail if the target process is created with a security descriptor that grants the debugger anything less than full access. If the debugging process has the SE_DEBUG_NAME privilege granted and enabled, it can debug any process.
和你自己的评论 - 除了受保护的进程,如果只有你的调试器在调用 DebugActiveProcess 时也受保护的进程(保护级别不少)(是的,这是可能的调试受保护的进程还有)