Class: PacketGen::Plugin::SMB::NtCreateAndX::Response
- Inherits:
-
Header::Base
- Object
- Header::Base
- PacketGen::Plugin::SMB::NtCreateAndX::Response
- Defined in:
- lib/packetgen/plugin/smb/ntcreateandx/response.rb
Overview
SMB Command NtCreateAndX response
Constant Summary collapse
- OP_LOCK_LEVELS =
OpLock levels
{ 'none' => 0, 'exclusive' => 1, 'batch' => 2, 'level II' => 3, }.freeze
Instance Attribute Summary collapse
-
#access_time ⇒ Integer
64-bit integer representing the time that the file was last accessed.
-
#alloc_size ⇒ Integer
64-bit integer representing the number of bytes allocated to the file.
-
#and_xcommand ⇒ Integer
8-bit command code for the next SMB command in the packet.
-
#and_xoffset ⇒ Integer
16-bit offset from the start of SMB header to the start of the #word_count field in the next SMB command in this packet.
-
#attributes ⇒ Integer
32-bit extended file attributes.
-
#byte_count ⇒ Integer
The size, in bytes, of the SMB data.
-
#change_time ⇒ Integer
64-bit integer representing the time that the file was last changed.
-
#create_time ⇒ Integer
64-bit integer representing the time that the file was created.
-
#directory ⇒ Integer
8-bit field indicating is the FID represents a directory.
-
#disposition ⇒ Integer
32-bit value that represents the action to take if the file already exists or if the file is a new file and does not already exist.
-
#end_of_file ⇒ Integer
64-bit integer representing the end of file offset.
-
#fid ⇒ Integer
16-bit FID.
-
#oplock_level ⇒ Integer
8-bit OpLock level.
-
#pipe_status ⇒ Integer
16-bit field that shows the status of the named pipe (if opened resource is a named pipe).
-
#res_type ⇒ Integer
16-bit file type.
-
#rsv1 ⇒ Integer
8-bit reserved field.
-
#word_count ⇒ Integer
The size, in 2-byte words, of the SMB parameters.
-
#write_time ⇒ Integer
64-bit integer representing the time that the file was last writen.
Class Method Summary collapse
-
.protocol_name ⇒ String
Give protocol name for this class.
Instance Method Summary collapse
-
#directory? ⇒ Boolean
Say if FID is a directory.
- #human_access_time ⇒ String
- #human_change_time ⇒ String
- #human_create_time ⇒ String
- #human_write_time ⇒ String
Instance Attribute Details
#access_time ⇒ Integer
64-bit integer representing the time that the file was last accessed.
63 |
# File 'lib/packetgen/plugin/smb/ntcreateandx/response.rb', line 63 define_field :access_time, SMB::Filetime |
#alloc_size ⇒ Integer
64-bit integer representing the number of bytes allocated to the file.
79 |
# File 'lib/packetgen/plugin/smb/ntcreateandx/response.rb', line 79 define_field :alloc_size, PacketGen::Types::Int64le |
#and_xcommand ⇒ Integer
8-bit command code for the next SMB command in the packet.
31 |
# File 'lib/packetgen/plugin/smb/ntcreateandx/response.rb', line 31 define_field :and_xcommand, PacketGen::Types::Int8Enum, enum: Request::COMMANDS |
#and_xoffset ⇒ Integer
16-bit offset from the start of SMB header to the start of the #word_count field in the next SMB command in this packet.
41 |
# File 'lib/packetgen/plugin/smb/ntcreateandx/response.rb', line 41 define_field :and_xoffset, PacketGen::Types::Int16le, default: 0 |
#attributes ⇒ Integer
32-bit extended file attributes.
75 |
# File 'lib/packetgen/plugin/smb/ntcreateandx/response.rb', line 75 define_field :attributes, PacketGen::Types::Int32le |
#byte_count ⇒ Integer
The size, in bytes, of the SMB data. Should be zero.
100 |
# File 'lib/packetgen/plugin/smb/ntcreateandx/response.rb', line 100 define_field :byte_count, PacketGen::Types::Int16le, default: 0 |
#change_time ⇒ Integer
64-bit integer representing the time that the file was last changed.
71 |
# File 'lib/packetgen/plugin/smb/ntcreateandx/response.rb', line 71 define_field :change_time, SMB::Filetime |
#create_time ⇒ Integer
64-bit integer representing the time that the file was created.
59 |
# File 'lib/packetgen/plugin/smb/ntcreateandx/response.rb', line 59 define_field :create_time, SMB::Filetime |
#directory ⇒ Integer
8-bit field indicating is the FID represents a directory.
96 |
# File 'lib/packetgen/plugin/smb/ntcreateandx/response.rb', line 96 define_field :directory, PacketGen::Types::Int8 |
#disposition ⇒ Integer
32-bit value that represents the action to take if the file already exists or if the file is a new file and does not already exist.
55 |
# File 'lib/packetgen/plugin/smb/ntcreateandx/response.rb', line 55 define_field :disposition, PacketGen::Types::Int32le |
#end_of_file ⇒ Integer
64-bit integer representing the end of file offset.
83 |
# File 'lib/packetgen/plugin/smb/ntcreateandx/response.rb', line 83 define_field :end_of_file, PacketGen::Types::Int64le |
#fid ⇒ Integer
16-bit FID.
49 |
# File 'lib/packetgen/plugin/smb/ntcreateandx/response.rb', line 49 define_field :fid, PacketGen::Types::Int16le |
#oplock_level ⇒ Integer
8-bit OpLock level.
45 |
# File 'lib/packetgen/plugin/smb/ntcreateandx/response.rb', line 45 define_field :oplock_level, PacketGen::Types::Int8Enum, enum: OP_LOCK_LEVELS |
#pipe_status ⇒ Integer
16-bit field that shows the status of the named pipe (if opened resource is a named pipe).
92 |
# File 'lib/packetgen/plugin/smb/ntcreateandx/response.rb', line 92 define_field :pipe_status, PacketGen::Types::Int16le |
#res_type ⇒ Integer
16-bit file type.
87 |
# File 'lib/packetgen/plugin/smb/ntcreateandx/response.rb', line 87 define_field :res_type, PacketGen::Types::Int16le |
#rsv1 ⇒ Integer
8-bit reserved field.
35 |
# File 'lib/packetgen/plugin/smb/ntcreateandx/response.rb', line 35 define_field :rsv1, PacketGen::Types::Int8, default: 0 |
#word_count ⇒ Integer
The size, in 2-byte words, of the SMB parameters.
26 |
# File 'lib/packetgen/plugin/smb/ntcreateandx/response.rb', line 26 define_field :word_count, PacketGen::Types::Int8, default: 34 |
Class Method Details
.protocol_name ⇒ String
Give protocol name for this class
104 105 106 |
# File 'lib/packetgen/plugin/smb/ntcreateandx/response.rb', line 104 def self.protocol_name 'SMB::NtCreateAndX::Response' end |
Instance Method Details
#directory? ⇒ Boolean
Say if FID is a directory
110 111 112 |
# File 'lib/packetgen/plugin/smb/ntcreateandx/response.rb', line 110 def directory? self.directory > 0 end |
#human_access_time ⇒ String
122 123 124 |
# File 'lib/packetgen/plugin/smb/ntcreateandx/response.rb', line 122 %i[create access write change].each do |type| class_eval "def human_#{type}_time; self[:#{type}_time].to_human; end" end |
#human_change_time ⇒ String
122 123 124 |
# File 'lib/packetgen/plugin/smb/ntcreateandx/response.rb', line 122 %i[create access write change].each do |type| class_eval "def human_#{type}_time; self[:#{type}_time].to_human; end" end |
#human_create_time ⇒ String
122 123 124 |
# File 'lib/packetgen/plugin/smb/ntcreateandx/response.rb', line 122 %i[create access write change].each do |type| class_eval "def human_#{type}_time; self[:#{type}_time].to_human; end" end |
#human_write_time ⇒ String
122 123 124 |
# File 'lib/packetgen/plugin/smb/ntcreateandx/response.rb', line 122 %i[create access write change].each do |type| class_eval "def human_#{type}_time; self[:#{type}_time].to_human; end" end |