Class: RubySMB::SMB1::Packet::SessionSetupRequest

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

Overview

A SMB1 SMB_COM_SESSION_SETUP_ANDX Request Packet as defined in 2.2.4.6.1

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, #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 sets it in the RubySMB::SMB1::Packet::SessionSetupRequest::DataBlock#security_blob field. It also automatically sets the length in RubySMB::SMB1::Packet::SessionSetupRequest::ParameterBlock#security_blob_length

Parameters:

  • buffer (String)

    the security buffer



49
50
51
52
# File 'lib/ruby_smb/smb1/packet/session_setup_request.rb', line 49

def set_security_buffer(buffer)
  parameter_block.security_blob_length = buffer.length
  data_block.security_blob = buffer
end

#set_type1_blob(type1_message) ⇒ void

This method returns an undefined value.

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

Parameters:

  • type1_message (String)

    the serialized Type 1 NTLM message



61
62
63
64
65
# File 'lib/ruby_smb/smb1/packet/session_setup_request.rb', line 61

def set_type1_blob(type1_message)
  gss_blob = RubySMB::Gss.gss_type1(type1_message)
  parameter_block.security_blob_length = gss_blob.length
  data_block.security_blob = gss_blob
end

#set_type3_blob(type3_message) ⇒ void

This method returns an undefined value.

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

Parameters:

  • type3_message (String)

    the serialized Type 3 NTLM message



74
75
76
77
78
# File 'lib/ruby_smb/smb1/packet/session_setup_request.rb', line 74

def set_type3_blob(type3_message)
  gss_blob = RubySMB::Gss.gss_type3(type3_message)
  parameter_block.security_blob_length = gss_blob.length
  data_block.security_blob = gss_blob
end