Class: Rex::Proto::DRDA::ACCSEC_DDM
- Inherits:
-
Struct
- Object
- Struct
- Rex::Proto::DRDA::ACCSEC_DDM
- Defined in:
- lib/rex/proto/drda/packet.rb
Overview
The ACCSEC DDM is responsible for picking the security mechanism (SECMEC) which, in our case, will always be plain text username and password. It also sets the relational database name (RDBNAM), if specified. You need one to login, but not to probe.
Instance Attribute Summary collapse
-
#codepoint ⇒ Object
Returns the value of attribute codepoint.
-
#correlid ⇒ Object
Returns the value of attribute correlid.
-
#format ⇒ Object
Returns the value of attribute format.
-
#length ⇒ Object
Returns the value of attribute length.
-
#length2 ⇒ Object
Returns the value of attribute length2.
-
#magic ⇒ Object
Returns the value of attribute magic.
-
#rdbnam ⇒ Object
Returns the value of attribute rdbnam.
-
#secmec ⇒ Object
Returns the value of attribute secmec.
Instance Method Summary collapse
- #dbname=(str) ⇒ Object
-
#initialize(args = {}) ⇒ ACCSEC_DDM
constructor
A new instance of ACCSEC_DDM.
- #to_s ⇒ Object
Constructor Details
#initialize(args = {}) ⇒ ACCSEC_DDM
Returns a new instance of ACCSEC_DDM.
88 89 90 91 92 93 94 95 96 97 98 99 |
# File 'lib/rex/proto/drda/packet.rb', line 88 def initialize(args={}) self[:magic] = 0xd0 self[:format] = args[:format] || 0x01 self[:correlid] = 2 self[:codepoint] = Constants::ACCSEC self[:secmec] = SECMEC_PARAM.new.to_s if args[:dbname] # Include a database name if we're given one. self[:rdbnam] = RDBNAM_PARAM.new(:payload => args[:dbname]).to_s end self[:length] = 10 + self[:secmec].to_s.size + self[:rdbnam].to_s.size self[:length2] = self[:length]-6 end |
Instance Attribute Details
#codepoint ⇒ Object
Returns the value of attribute codepoint
86 87 88 |
# File 'lib/rex/proto/drda/packet.rb', line 86 def codepoint @codepoint end |
#correlid ⇒ Object
Returns the value of attribute correlid
86 87 88 |
# File 'lib/rex/proto/drda/packet.rb', line 86 def correlid @correlid end |
#format ⇒ Object
Returns the value of attribute format
86 87 88 |
# File 'lib/rex/proto/drda/packet.rb', line 86 def format @format end |
#length ⇒ Object
Returns the value of attribute length
86 87 88 |
# File 'lib/rex/proto/drda/packet.rb', line 86 def length @length end |
#length2 ⇒ Object
Returns the value of attribute length2
86 87 88 |
# File 'lib/rex/proto/drda/packet.rb', line 86 def length2 @length2 end |
#magic ⇒ Object
Returns the value of attribute magic
86 87 88 |
# File 'lib/rex/proto/drda/packet.rb', line 86 def magic @magic end |
#rdbnam ⇒ Object
Returns the value of attribute rdbnam
86 87 88 |
# File 'lib/rex/proto/drda/packet.rb', line 86 def rdbnam @rdbnam end |
#secmec ⇒ Object
Returns the value of attribute secmec
86 87 88 |
# File 'lib/rex/proto/drda/packet.rb', line 86 def secmec @secmec end |
Instance Method Details
#dbname=(str) ⇒ Object
100 101 102 |
# File 'lib/rex/proto/drda/packet.rb', line 100 def dbname=(str) self[:rdbnam] = RDBNAM_PARAM.new(:payload => args[:dbname]).to_s end |
#to_s ⇒ Object
103 104 105 106 107 |
# File 'lib/rex/proto/drda/packet.rb', line 103 def to_s packstr = "nCCnnna6" packstr += "a22" if self[:rdbnam] self.to_a.pack(packstr) end |