Class: Rex::Proto::Kerberos::Pac::Element

Inherits:
Object
  • Object
show all
Includes:
Crypto, Rex::Proto::Kerberos::Pac
Defined in:
lib/rex/proto/kerberos/pac/element.rb

Constant Summary

Constants included from Rex::Proto::Kerberos::Pac

AD_WIN2K_PAC, DEFAULT_USER_SID, DOMAIN_USERS, NETLOGON_FLAG, NEVER_EXPIRE, NT_AUTHORITY_SID, PAC_CLIENT_INFO, PAC_LOGON_INFO, PAC_PRIVSVR_CHECKSUM, PAC_SERVER_CHECKSUM, SEC_TO_UNIX_EPOCH, SE_GROUP_ALL, SE_GROUP_ENABLED, SE_GROUP_ENABLED_BY_DEFAULT, SE_GROUP_MANDATORY, USER_DONT_EXPIRE_PASSWORD, USER_NORMAL_ACCOUNT, VERSION, WINDOWS_TICK

Constants included from Crypto

Crypto::ENC_AS_RESPONSE, Crypto::ENC_KDC_REQUEST_BODY, Crypto::ENC_TGS_RESPONSE, Crypto::RC4_HMAC, Crypto::RSA_MD5

Class Method Summary collapse

Instance Method Summary collapse

Methods included from Crypto::RsaMd5

#checksum_rsa_md5

Methods included from Crypto::Rc4Hmac

#decrypt_rc4_hmac, #encrypt_rc4_hmac

Constructor Details

#initialize(options = {}) ⇒ Element

Returns a new instance of Element.



25
26
27
28
29
30
31
32
# File 'lib/rex/proto/kerberos/pac/element.rb', line 25

def initialize(options = {})
  self.class.attributes.each do |attr|
    if options.has_key?(attr)
      m = (attr.to_s + '=').to_sym
      self.send(m, options[attr])
    end
  end
end

Class Method Details

.attr_accessor(*vars) ⇒ Object



12
13
14
15
16
# File 'lib/rex/proto/kerberos/pac/element.rb', line 12

def self.attr_accessor(*vars)
  @attributes ||= []
  @attributes.concat vars
  super(*vars)
end

.attributesArray

Retrieves the element class fields

Returns:

  • (Array)


21
22
23
# File 'lib/rex/proto/kerberos/pac/element.rb', line 21

def self.attributes
  @attributes
end

Instance Method Details

#attributesArray

Retrieves the element instance fields

Returns:

  • (Array)


37
38
39
# File 'lib/rex/proto/kerberos/pac/element.rb', line 37

def attributes
  self.class.attributes
end

#encodeObject

Encodes the Rex::Proto::Kerberos::Pac::Element into an String. This method has been designed to be overridden by subclasses.

Raises:

  • (NoMethodError)


45
46
47
# File 'lib/rex/proto/kerberos/pac/element.rb', line 45

def encode
  raise ::NoMethodError, 'Method designed to be overridden'
end