Class: RubySMB::SMB2::Packet::SessionSetupRequest

Inherits:
GenericPacket
  • Object
show all
Defined in:
lib/ruby_smb/smb2/packet/session_setup_request.rb

Overview

An SMB2 SessionSetupRequest Packet as defined in 2.2.5 SMB2 SESSION_SETUP Request

Constant Summary collapse

COMMAND =
RubySMB::SMB2::Commands::SESSION_SETUP

Instance Method Summary collapse

Methods inherited from GenericPacket

describe, #display, fields_hashed, format_field, from_hex, #initialize_instance, #packet_smb_version, read, #status_code, #valid?, walk_fields

Instance Method Details

#set_security_buffer(buffer) ⇒ void

This method returns an undefined value.

Takes the specified security buffer string and inserts it into the #buffer as well as updating the #security_buffer_length This method DOES NOT wrap the security buffer in any way.

Parameters:

  • buffer (String)

    the security buffer



27
28
29
30
# File 'lib/ruby_smb/smb2/packet/session_setup_request.rb', line 27

def set_security_buffer(buffer)
  self.security_buffer_length = buffer.length
  self.buffer = buffer
end

#set_type1_blob(type1_message) ⇒ void

This method returns an undefined value.

Takes a serialized NTLM Type 1 message and wraps it in the GSS ASN1 encoding and inserts it into the #buffer as well as updating the #security_buffer_length

Parameters:

  • type1_message (String)

    the serialized NTLM Type 1 message



38
39
40
41
42
# File 'lib/ruby_smb/smb2/packet/session_setup_request.rb', line 38

def set_type1_blob(type1_message)
  gss_blob = RubySMB::Gss.gss_type1(type1_message)
  self.security_buffer_length = gss_blob.length
  self.buffer = gss_blob
end

#set_type3_blob(type3_message) ⇒ void

This method returns an undefined value.

Takes a serialized NTLM Type 3 message and wraps it in the GSS ASN1 encoding and inserts it into the #buffer as well as updating the #security_buffer_length

Parameters:

  • type3_message (String)

    the serialized NTLM Type 3 message



50
51
52
53
54
# File 'lib/ruby_smb/smb2/packet/session_setup_request.rb', line 50

def set_type3_blob(type3_message)
  gss_blob = RubySMB::Gss.gss_type3(type3_message)
  self.security_buffer_length = gss_blob.length
  self.buffer = gss_blob
end