Class: RubySMB::SMB2::Packet::SessionSetupResponse

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

Overview

An SMB2 SessionSetupResponse Packet as defined in 2.2.6 SMB2 SESSION_SETUP Response

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, #packet_smb_version, read, #status_code, #valid?, walk_fields

Instance Method Details

#initialize_instanceObject



17
18
19
20
# File 'lib/ruby_smb/smb2/packet/session_setup_response.rb', line 17

def initialize_instance
  super
  smb2_header.flags.reply = 1
end

#set_type2_blob(type1_message) ⇒ void

This method returns an undefined value.

Takes a serialized NTLM Type 2 message and wraps it in the GSS ASN1 encoding and inserts it into the RubySMB::SMB2::Packet::SessionSetupRequest#buffer as well as updating the RubySMB::SMB2::Packet::SessionSetupRequest#security_buffer_length

Parameters:

  • type1_message (String)

    the serialized NTLM Type 1 message



28
29
30
31
32
# File 'lib/ruby_smb/smb2/packet/session_setup_response.rb', line 28

def set_type2_blob(type1_message)
  gss_blob = RubySMB::Gss.gss_type2(type1_message)
  self.security_buffer_length = gss_blob.length
  self.buffer = gss_blob
end