Class: Rex::Proto::MsDtyp::MsDtypGuid

Inherits:
RubySMB::Dcerpc::Uuid
  • Object
show all
Defined in:
lib/rex/proto/ms_dtyp.rb

Overview

Universal Unique Identifier The online documentation at 2.3.4.2 weirdly doesn't mention this needs to be 4 byte aligned for us to read it correctly, which the RubySMB::Dcerpc::Uuid definition takes care of.

Class Method Summary collapse

Class Method Details

.random_generate ⇒ Object



299
300
301
302
303
# File 'lib/rex/proto/ms_dtyp.rb', line 299

def self.random_generate
  # Taken from the "D" format as specified in
  # https://learn.microsoft.com/en-us/dotnet/api/system.guid.tostring?view=net-7.0
  "{#{Rex::Text.rand_text_hex(8)}-#{Rex::Text.rand_text_hex(4)}-#{Rex::Text.rand_text_hex(4)}-#{Rex::Text.rand_text_hex(4)}-#{Rex::Text.rand_text_hex(12)}}".downcase
end