Class: PacketGen::Plugin::NetBIOS::Session
- Inherits:
-
Header::Base
- Object
- Header::Base
- PacketGen::Plugin::NetBIOS::Session
- Defined in:
- lib/packetgen/plugin/netbios/session.rb
Overview
NetBIOS Session Service messages.
Constant Summary collapse
- TCP_PORT =
Port number for NetBIOS Session Service over TCP
139
- TCP_PORT2 =
Port number for NetBIOS Session Service over TCP (mainly used yb SMB2)
445
- TYPES =
Session packet types
{ 'message' => 0, 'request' => 0x81, 'positive_response' => 0x82, 'negative_response' => 0x83, 'retarget_response' => 0x84, 'keep_alive' => 0x85, }.freeze
Instance Attribute Summary collapse
- #body ⇒ String
-
#length ⇒ Integer
17-bit session packet length.
-
#type ⇒ Integer
8-bit session packet type.
Class Method Summary collapse
-
.protocol_name ⇒ String
Give protocol name.
Instance Method Summary collapse
- #added_to_packet(packet) ⇒ Object private
-
#calc_length ⇒ Integer
Compute and set #length field.
Instance Attribute Details
#body ⇒ String
46 |
# File 'lib/packetgen/plugin/netbios/session.rb', line 46 define_field :body, PacketGen::Types::String |
#length ⇒ Integer
17-bit session packet length
43 |
# File 'lib/packetgen/plugin/netbios/session.rb', line 43 define_field :length, PacketGen::Types::Int24 |
Class Method Details
.protocol_name ⇒ String
Give protocol name
17 18 19 |
# File 'lib/packetgen/plugin/netbios/session.rb', line 17 def self.protocol_name 'NetBIOS::Session' end |
Instance Method Details
#added_to_packet(packet) ⇒ Object
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
Note:
This method is used internally by PacketGen and should not be directly called
59 60 61 62 63 64 |
# File 'lib/packetgen/plugin/netbios/session.rb', line 59 def added_to_packet(packet) return unless packet.is? 'TCP' return unless packet.tcp.sport.zero? packet.tcp.sport = TCP_PORT end |