class Rex::Proto::DRDA::ACCSEC_DDM
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.
Public Class Methods
new(args={})
click to toggle source
# 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
Public Instance Methods
dbname=(str)
click to toggle source
# 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()
click to toggle source
# 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