Sha256: 4a6f92b933a70903179ad9afc5ae180549ae6f503f351920b479ef73aac56acf

Contents?: true

Size: 1.92 KB

Versions: 11

Compression:

Stored size: 1.92 KB

Contents

module RubySMB
  module SMB1
    module Packet
      # A SMB1 SMB_COM_NEGOTIATE Non-Extended Security Response Packet as defined in
      # [2.2.4.5.2.2 Non-Extended Security Response](https://msdn.microsoft.com/en-us/library/cc246327.aspx)
      class NegotiateResponse < RubySMB::GenericPacket
        # An SMB_Parameters Block as defined by the {NegotiateResponse}.
        class ParameterBlock < RubySMB::SMB1::ParameterBlock
          uint16          :dialect_index, label: 'Dialect Index'
          security_mode   :security_mode
          uint16          :max_mpx_count,     label: 'Max Multiplex Count'
          uint16          :max_number_vcs,    label: 'Max Virtual Circuits'
          uint32          :max_buffer_size,   label: 'Max Buffer Size'
          uint32          :max_raw_size,      label: 'Max Raw Size'
          uint32          :session_key,       label: 'Session Key'
          capabilities    :capabilities
          file_time       :system_time,       label: 'Server System Time'
          int16           :server_time_zone,  label: 'Server TimeZone'
          uint8           :challenge_length,  label: 'Challenge Length', initial_value: 0x08
        end

        # An SMB_Data Block as defined by the {NegotiateResponse}
        class DataBlock < RubySMB::SMB1::DataBlock
          string        :challenge,     label: 'Auth Challenge', length: 8
          stringz16     :domain_name,   label: 'Primary Domain'
          stringz16     :server_name,   label: 'Server Name'
        end

        smb_header        :smb_header
        parameter_block   :parameter_block
        data_block        :data_block

        def initialize_instance
          super
          header = smb_header
          header.command = RubySMB::SMB1::Commands::SMB_COM_NEGOTIATE
          header.flags.reply = 1
        end

        def valid?
          smb_header.command == RubySMB::SMB1::Commands::SMB_COM_NEGOTIATE
        end
      end
    end
  end
end

Version data entries

11 entries across 11 versions & 1 rubygems

Version Path
ruby_smb-0.0.18 lib/ruby_smb/smb1/packet/negotiate_response.rb
ruby_smb-0.0.17 lib/ruby_smb/smb1/packet/negotiate_response.rb
ruby_smb-0.0.16 lib/ruby_smb/smb1/packet/negotiate_response.rb
ruby_smb-0.0.15 lib/ruby_smb/smb1/packet/negotiate_response.rb
ruby_smb-0.0.14 lib/ruby_smb/smb1/packet/negotiate_response.rb
ruby_smb-0.0.13 lib/ruby_smb/smb1/packet/negotiate_response.rb
ruby_smb-0.0.12 lib/ruby_smb/smb1/packet/negotiate_response.rb
ruby_smb-0.0.11 lib/ruby_smb/smb1/packet/negotiate_response.rb
ruby_smb-0.0.10 lib/ruby_smb/smb1/packet/negotiate_response.rb
ruby_smb-0.0.9 lib/ruby_smb/smb1/packet/negotiate_response.rb
ruby_smb-0.0.8 lib/ruby_smb/smb1/packet/negotiate_response.rb