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.
89 90 91 92 93 94 95 96 97 98 99 100 |
# File 'lib/rex/proto/drda/packet.rb', line 89 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
87 88 89 |
# File 'lib/rex/proto/drda/packet.rb', line 87 def codepoint @codepoint end |
#correlid ⇒ Object
Returns the value of attribute correlid
87 88 89 |
# File 'lib/rex/proto/drda/packet.rb', line 87 def correlid @correlid end |
#format ⇒ Object
Returns the value of attribute format
87 88 89 |
# File 'lib/rex/proto/drda/packet.rb', line 87 def format @format end |
#length ⇒ Object
Returns the value of attribute length
87 88 89 |
# File 'lib/rex/proto/drda/packet.rb', line 87 def length @length end |
#length2 ⇒ Object
Returns the value of attribute length2
87 88 89 |
# File 'lib/rex/proto/drda/packet.rb', line 87 def length2 @length2 end |
#magic ⇒ Object
Returns the value of attribute magic
87 88 89 |
# File 'lib/rex/proto/drda/packet.rb', line 87 def magic @magic end |
#rdbnam ⇒ Object
Returns the value of attribute rdbnam
87 88 89 |
# File 'lib/rex/proto/drda/packet.rb', line 87 def rdbnam @rdbnam end |
#secmec ⇒ Object
Returns the value of attribute secmec
87 88 89 |
# File 'lib/rex/proto/drda/packet.rb', line 87 def secmec @secmec end |
Instance Method Details
#dbname=(str) ⇒ Object
101 102 103 |
# File 'lib/rex/proto/drda/packet.rb', line 101 def dbname=(str) self[:rdbnam] = RDBNAM_PARAM.new(:payload => args[:dbname]).to_s end |
#to_s ⇒ Object
104 105 106 107 108 |
# File 'lib/rex/proto/drda/packet.rb', line 104 def to_s packstr = "nCCnnna6" packstr += "a22" if self[:rdbnam] self.to_a.pack(packstr) end |