Reputation: 21
I need to get list of access rights to all Win-Kernel objects; What I do:
for (int i=0; i<9999; i++)
GetKernelObjectSecurity( i, ... ) //result in security_descriptor
GetSecurityDescriptorDacl( security_descriptor, ... ) // result in lpbDaclPresent
if (lpbDaclPresent)
//lpbDaclPresent - need to get
If DACL = Null -> "all can do all"
If DACL != Null -> parsing DACL-mask
I'm on the right track ? By the way, I have:
~300 handles without DACL
~100 handles with DACL (testing on Windows 7)
Upvotes: 2
Views: 976
Reputation: 2056
If you want to bruteforce through the HANDLES don't stop at 9999. Go through all 32bit values.
Alternatively you can enumerate all Usermode-Process-Handles: http://forum.sysinternals.com/howto-enumerate-handles_topic18892.html
The advantage of this method is, that you know the Handles original Process to use DuplicateHandle if needed.
Upvotes: 2