Class: PacketGen::Plugin::SMB2::SessionSetup::Response
- Defined in:
- lib/packetgen/plugin/smb2/session_setup/response.rb
Overview
SMB2 SessionSetup request structure
0 1 2 3
0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
| StructureSize | Flags |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
| BufferOffset | BufferLength |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
| Buffer (variable) |
+ +
| ... |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
Instance Attribute Summary collapse
- #buffer ⇒ GSSAPI
-
#buffer_length ⇒ Integer
The length of the #buffer field.
-
#buffer_offset ⇒ Integer
The offset, from the beginning of the SMB2 header of the #buffer.
-
#flags ⇒ Integer
16-bit session flags.
- #flags_encrypt_data? ⇒ Boolean
- #flags_is_guest? ⇒ Boolean
- #flags_is_null? ⇒ Boolean
-
#flags_rsv ⇒ Integer
13-bit reserved field.
-
#structure_size ⇒ Integer
16-bit session setup request structure size.
Class Method Summary collapse
-
.protocol_name ⇒ String
Protocol name.
Instance Method Summary collapse
-
#calc_length ⇒ void
Calculate and set #buffer_length and #buffer_offset fields.
Methods inherited from Base
Instance Attribute Details
#buffer ⇒ GSSAPI
53 |
# File 'lib/packetgen/plugin/smb2/session_setup/response.rb', line 53 define_field :buffer, GSSAPI, token: :response, optional: ->(h) { h.buffer_offset.positive? } |
#buffer_length ⇒ Integer
The length of the #buffer field.
50 |
# File 'lib/packetgen/plugin/smb2/session_setup/response.rb', line 50 define_field :buffer_length, PacketGen::Types::Int16le |
#buffer_offset ⇒ Integer
The offset, from the beginning of the SMB2 header of the #buffer.
46 |
# File 'lib/packetgen/plugin/smb2/session_setup/response.rb', line 46 define_field :buffer_offset, PacketGen::Types::Int16le, default: SMB2::HEADER_SIZE + 8 |
#flags ⇒ Integer
16-bit session flags
32 |
# File 'lib/packetgen/plugin/smb2/session_setup/response.rb', line 32 define_field :flags, PacketGen::Types::Int16le |
#flags_encrypt_data? ⇒ Boolean
42 |
# File 'lib/packetgen/plugin/smb2/session_setup/response.rb', line 42 define_bit_fields_on :flags, :flags_rsv, 13, :flags_encrypt_data, :flags_is_null, :flags_is_guest |
#flags_is_guest? ⇒ Boolean
42 |
# File 'lib/packetgen/plugin/smb2/session_setup/response.rb', line 42 define_bit_fields_on :flags, :flags_rsv, 13, :flags_encrypt_data, :flags_is_null, :flags_is_guest |
#flags_is_null? ⇒ Boolean
42 |
# File 'lib/packetgen/plugin/smb2/session_setup/response.rb', line 42 define_bit_fields_on :flags, :flags_rsv, 13, :flags_encrypt_data, :flags_is_null, :flags_is_guest |
#flags_rsv ⇒ Integer
13-bit reserved field
42 |
# File 'lib/packetgen/plugin/smb2/session_setup/response.rb', line 42 define_bit_fields_on :flags, :flags_rsv, 13, :flags_encrypt_data, :flags_is_null, :flags_is_guest |
#structure_size ⇒ Integer
16-bit session setup request structure size. Should be 9.
28 |
# File 'lib/packetgen/plugin/smb2/session_setup/response.rb', line 28 define_field :structure_size, PacketGen::Types::Int16le, default: 9 |
Class Method Details
.protocol_name ⇒ String
Protocol name
68 69 70 |
# File 'lib/packetgen/plugin/smb2/session_setup/response.rb', line 68 def self.protocol_name 'SMB2::SessionSetup::Response' end |
Instance Method Details
#calc_length ⇒ void
This method returns an undefined value.
Calculate and set #buffer_length and #buffer_offset fields.
57 58 59 60 61 62 63 64 |
# File 'lib/packetgen/plugin/smb2/session_setup/response.rb', line 57 def calc_length self.buffer_length = self[:buffer].sz self.buffer_offset = if self.buffer_length.zero? 0 else SMB2.new.sz + offset_of(:buffer) end end |