How to get user rights AND privileges of a Windows User account

旧街凉风 提交于 2019-12-06 06:58:14

问题


I need to be able to check for all of these user rights and privileges.

I have attempted using a token to access these, but this only accomplishes the list of privileges. I've checked this library and also this one but am unable to find a solution. Is the only way to accomplish this testing each specified right / privilege independently? Or I may just be clueless.

Any help in the right direction would be appreciated!


回答1:


I believe the only way to do this is to use either LsaEnumerateAccountsWithUserRight or LsaEnumerateAccountRights to query the LSA policy.

Since rights need not be assigned directly (i.e., they could be assigned to a group, or to a security primitive such as Everyone or INTERACTIVE USERS) you'll need to enumerate the SIDs in the user's token and cross-reference this with the LSA policy.



来源:https://stackoverflow.com/questions/21252677/how-to-get-user-rights-and-privileges-of-a-windows-user-account

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!