Class: Rex::Proto::DRDA::Packet::SECCHK_DDM
- Inherits:
-
Struct
- Object
- Struct
- Rex::Proto::DRDA::Packet::SECCHK_DDM
- Defined in:
- lib/rex/proto/drda/packet.rb
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.
-
#password ⇒ Object
Returns the value of attribute password.
-
#rdbnam ⇒ Object
Returns the value of attribute rdbnam.
-
#secmec ⇒ Object
Returns the value of attribute secmec.
-
#userid ⇒ Object
Returns the value of attribute userid.
Instance Method Summary collapse
- #dbname=(str) ⇒ Object
-
#initialize(args = {}) ⇒ SECCHK_DDM
constructor
Takes :dbname, :dbpass, :dbuser.
- #to_s ⇒ Object
Constructor Details
#initialize(args = {}) ⇒ SECCHK_DDM
Takes :dbname, :dbpass, :dbuser
224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 |
# File 'lib/rex/proto/drda/packet.rb', line 224 def initialize(args={}) # Takes :dbname, :dbpass, :dbuser self[:magic] = 0xd0 self[:format] = 0x01 self[:correlid] = 2 self[:codepoint] = Rex::Proto::DRDA::Constants::SECCHK 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[:password] = PASSWORD_PARAM.new(:payload => args[:dbpass]).to_s self[:userid] = USERID_PARAM.new(:payload => args[:dbuser]).to_s self[:length] = ( 10 + self[:secmec].to_s.size + self[:rdbnam].to_s.size + self[:password].to_s.size + self[:userid].to_s.size ) self[:length2] = self[:length]-6 end |
Instance Attribute Details
#codepoint ⇒ Object
Returns the value of attribute codepoint
222 223 224 |
# File 'lib/rex/proto/drda/packet.rb', line 222 def codepoint @codepoint end |
#correlid ⇒ Object
Returns the value of attribute correlid
222 223 224 |
# File 'lib/rex/proto/drda/packet.rb', line 222 def correlid @correlid end |
#format ⇒ Object
Returns the value of attribute format
222 223 224 |
# File 'lib/rex/proto/drda/packet.rb', line 222 def format @format end |
#length ⇒ Object
Returns the value of attribute length
222 223 224 |
# File 'lib/rex/proto/drda/packet.rb', line 222 def length @length end |
#length2 ⇒ Object
Returns the value of attribute length2
222 223 224 |
# File 'lib/rex/proto/drda/packet.rb', line 222 def length2 @length2 end |
#magic ⇒ Object
Returns the value of attribute magic
222 223 224 |
# File 'lib/rex/proto/drda/packet.rb', line 222 def magic @magic end |
#password ⇒ Object
Returns the value of attribute password
222 223 224 |
# File 'lib/rex/proto/drda/packet.rb', line 222 def password @password end |
#rdbnam ⇒ Object
Returns the value of attribute rdbnam
222 223 224 |
# File 'lib/rex/proto/drda/packet.rb', line 222 def rdbnam @rdbnam end |
#secmec ⇒ Object
Returns the value of attribute secmec
222 223 224 |
# File 'lib/rex/proto/drda/packet.rb', line 222 def secmec @secmec end |
#userid ⇒ Object
Returns the value of attribute userid
222 223 224 |
# File 'lib/rex/proto/drda/packet.rb', line 222 def userid @userid end |
Instance Method Details
#dbname=(str) ⇒ Object
239 240 241 |
# File 'lib/rex/proto/drda/packet.rb', line 239 def dbname=(str) self[:rdbnam] = RDBNAM_PARAM.new(:payload => args[:dbname]).to_s end |
#to_s ⇒ Object
242 243 244 245 246 247 |
# File 'lib/rex/proto/drda/packet.rb', line 242 def to_s packstr = "nCCnnna6" packstr += "a22" if self[:rdbnam] packstr += "a*a*" # username and password self.to_a.pack(packstr) end |