rapid7 / ruby_smb

A native Ruby implementation of the SMB Protocol Family
Other
80 stars 80 forks source link

Add more MS-SAMR definitions and functions #231

Closed zeroSteiner closed 2 years ago

zeroSteiner commented 2 years ago

This adds the necessary SAMR definitions for:

It also adds the functions to wrap each, making them available to call more easily. SamrEnumeratDomainsInSamServer uses the common PsamprEnumerationBuffer type definition, so that one and some others that were already defined were moved into the higher-level samr.rb file. Also the application key is now calculated by the client for SMB v3 dialects. This is necessary for some DCERPC operations.

Basic unit tests were added for the new data definitions.

The easiest way to test this will be with the accompanying Metasploit module which will be posted shortly.

Also adds a new FautlError which inherits from InvalidPacket and allows the caller to get a better idea of why an exception occurred.

space-r7 commented 2 years ago

Looks good to me! Specs passed and confirmed requests / responses with network monitor. Tested the functionality with the auxiliary module.