cobbr / SharpSploit

SharpSploit is a .NET post-exploitation library written in C#
https://sharpsploit.cobbr.io/api/
BSD 3-Clause "New" or "Revised" License
1.75k stars 307 forks source link

Merge dev to master #31

Closed cobbr closed 5 years ago

cobbr commented 5 years ago

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.

rasta-mouse commented 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