Class: Rex::Proto::Kerberos::Model::PreAuthPwSalt

Inherits:
Element
  • Object
show all
Defined in:
lib/rex/proto/kerberos/model/pre_auth_pw_salt.rb

Overview

This class provides a representation of a PA-PW-SALT structure, which in practise appears to be a MS-specific implementation detail of Kerberos, which contains information about login status datatracker.ietf.org/doc/html/rfc4120#section-5.2.7.3

Constant Summary

Constants included from Rex::Proto::Kerberos::Model

AP_REP, AP_REQ, AS_REP, AS_REQ, AUTHENTICATOR, ENC_AP_REP_PART, ENC_KRB_CRED_PART, KRB_CRED, KRB_ERROR, TGS_REP, TGS_REQ, TICKET, VERSION

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods inherited from Element

attr_accessor, attributes, #attributes, decode, #initialize

Constructor Details

This class inherits a constructor from Rex::Proto::Kerberos::Model::Element

Instance Attribute Details

#flagsObject

Returns the value of attribute flags.



21
22
23
# File 'lib/rex/proto/kerberos/model/pre_auth_pw_salt.rb', line 21

def flags
  @flags
end

#nt_status::WindowsError::NTStatus

Returns The NT Status from a login attempt.

Returns:

  • (::WindowsError::NTStatus)

    The NT Status from a login attempt



15
16
17
# File 'lib/rex/proto/kerberos/model/pre_auth_pw_salt.rb', line 15

def nt_status
  @nt_status
end

#reservedObject

Returns the value of attribute reserved.



18
19
20
# File 'lib/rex/proto/kerberos/model/pre_auth_pw_salt.rb', line 18

def reserved
  @reserved
end

#ReservedInteger

Returns Reserved.

Returns:

  • (Integer)

    Reserved



18
# File 'lib/rex/proto/kerberos/model/pre_auth_pw_salt.rb', line 18

attr_accessor :reserved

#typeInteger

Returns Uncertain what this represents.

Returns:

  • (Integer)

    Uncertain what this represents



21
# File 'lib/rex/proto/kerberos/model/pre_auth_pw_salt.rb', line 21

attr_accessor :flags

Instance Method Details

#decode(input) ⇒ self

Decodes the Rex::Proto::Kerberos::Model::PreAuthPwSalt from an input

Parameters:

  • input (String)

    the input to decode from

Returns:

  • (self)

    if decoding succeeds

Raises:



28
29
30
31
32
33
34
35
36
37
# File 'lib/rex/proto/kerberos/model/pre_auth_pw_salt.rb', line 28

def decode(input)
  case input
  when String
    decode_string(input)
  else
    raise ::Rex::Proto::Kerberos::Model::Error::KerberosDecodingError, 'Failed to decode PA-PW-SALT, invalid input'
  end

  self
end

#encodeObject



39
40
41
# File 'lib/rex/proto/kerberos/model/pre_auth_pw_salt.rb', line 39

def encode
  [nt_status.value, reserved, flags].pack('VVV')
end