Closed cobbr closed 5 years ago
Nice work @cobbr. My only comment is that it's possible for GetDacl
to throw an unhandled exception when you specify a file that (presumably) you don't have permission to read (e.g. system files like C:\hiberfil.sys
).
Unhandled Exception: System.InvalidOperationException: Method failed with unexpected error code 32.
at System.Security.AccessControl.NativeObjectSecurity.CreateInternal(ResourceType resourceType, Boolean isContainer, String name, SafeHandle handle, AccessControlSections includeSections, Boolean createByName, ExceptionFromErrorCode exceptionFromErrorCode, Object exceptionContext)
at System.Security.AccessControl.FileSystemSecurity..ctor(Boolean isContainer, String name, AccessControlSections includeSections, Boolean isDirectory)
at System.Security.AccessControl.FileSecurity..ctor(String fileName, AccessControlSections includeSections)
at System.IO.FileInfo.GetAccessControl()
at SharpSploit.Enumeration.Host.GetDacl(String Path) in C:\Tools\SharpSploit\SharpSploit\Enumeration\Host.cs:line 347
Awesome stuff here @rasta-mouse! Renamed a couple things, made a couple of small cleanup edits, added a few tests.
Want to give a quick final review/test? I'll merge this over whenever you are good with it.