Class: RubySMB::SMB1::Packet::SessionSetupResponse

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

Overview

A SMB1 SMB_COM_SESSION_SETUP_ANDX Response Packet as defined in 2.2.4.6.2

Defined Under Namespace

Classes: DataBlock, ParameterBlock

Constant Summary collapse

COMMAND =
RubySMB::SMB1::Commands::SMB_COM_SESSION_SETUP_ANDX

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



27
28
29
30
# File 'lib/ruby_smb/smb1/packet/session_setup_response.rb', line 27

def initialize_instance
  super
  smb_header.flags.reply = 1
end

#set_type2_blob(type2_message) ⇒ void

This method returns an undefined value.

Takes an NTLM Type 2 Message and creates the GSS Security Blob for it and sets it in the RubySMB::SMB1::Packet::SessionSetupRequest::DataBlock#security_blob field. It also automaticaly sets the length in RubySMB::SMB1::Packet::SessionSetupRequest::ParameterBlock#security_blob_length

Parameters:

  • type2_message (String)

    the serialized Type 2 NTLM message



39
40
41
42
43
# File 'lib/ruby_smb/smb1/packet/session_setup_response.rb', line 39

def set_type2_blob(type2_message)
  gss_blob = RubySMB::Gss.gss_type2(type2_message)
  data_block.security_blob = gss_blob
  parameter_block.security_blob_length = gss_blob.length
end