Class: Rex::Proto::Kerberos::Model::KrbError

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

Overview

This class provides a representation of a Kerberos KRB-ERROR (response error) message definition.

Constant Summary

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

AD_IF_RELEVANT, AP_REQ, AS_REP, AS_REQ, AUTHENTICATOR, ERROR_CODES, KDC_OPTION_ALLOW_POST_DATE, KDC_OPTION_ENC_TKT_IN_SKEY, KDC_OPTION_FORWARDABLE, KDC_OPTION_FORWARDED, KDC_OPTION_POST_DATED, KDC_OPTION_PROXIABLE, KDC_OPTION_PROXY, KDC_OPTION_RENEW, KDC_OPTION_RENEWABLE, KDC_OPTION_RENEWABLE_OK, KDC_OPTION_RESERVED, KDC_OPTION_UNUSED_10, KDC_OPTION_UNUSED_11, KDC_OPTION_UNUSED_7, KDC_OPTION_UNUSED_9, KDC_OPTION_VALIDATE, KRB_ERROR, NT_PRINCIPAL, NT_SRV_HST, NT_SRV_INST, NT_SRV_XHST, NT_UID, NT_UNKNOWN, PA_ENC_TIMESTAMP, PA_PAC_REQUEST, PA_PW_SALT, PA_TGS_REQ, TGS_REP, TGS_REQ, TICKET, VERSION

Constants included from Crypto

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

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods inherited from Element

attr_accessor, attributes, #attributes, decode, #initialize

Methods included from Crypto::RsaMd5

#checksum_rsa_md5

Methods included from Crypto::Rc4Hmac

#decrypt_rc4_hmac, #encrypt_rc4_hmac

Constructor Details

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

Instance Attribute Details

#cnameRex::Proto::Kerberos::Model::PrincipalName

Returns The name part of the client’s principal identifier.

Returns:



36
37
38
# File 'lib/rex/proto/kerberos/model/krb_error.rb', line 36

def cname
  @cname
end

#crealmString

Returns The realm part of the client’s principal identifier.

Returns:

  • (String)

    The realm part of the client's principal identifier



33
34
35
# File 'lib/rex/proto/kerberos/model/krb_error.rb', line 33

def crealm
  @crealm
end

#ctimeTime

Returns The current time of the client’s host.

Returns:

  • (Time)

    The current time of the client's host



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

def ctime
  @ctime
end

#cusecFixnum

Returns The microseconds part of the client timestamp.

Returns:

  • (Fixnum)

    The microseconds part of the client timestamp



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

def cusec
  @cusec
end

#e_dataString

Returns additional data about the error (ASN.1 encoded data).

Returns:

  • (String)

    additional data about the error (ASN.1 encoded data)



45
46
47
# File 'lib/rex/proto/kerberos/model/krb_error.rb', line 45

def e_data
  @e_data
end

#error_codeFixnum

Returns The error request returned by kerberos or the server when a request fails.

Returns:

  • (Fixnum)

    The error request returned by kerberos or the server when a request fails



30
31
32
# File 'lib/rex/proto/kerberos/model/krb_error.rb', line 30

def error_code
  @error_code
end

#msg_typeFixnum

Returns The type of a protocol message.

Returns:

  • (Fixnum)

    The type of a protocol message



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

def msg_type
  @msg_type
end

#pvnoFixnum

Returns The protocol version number.

Returns:

  • (Fixnum)

    The protocol version number



12
13
14
# File 'lib/rex/proto/kerberos/model/krb_error.rb', line 12

def pvno
  @pvno
end

#realmString

Returns The realm part of the server’s principal identifier.

Returns:

  • (String)

    The realm part of the server's principal identifier



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

def realm
  @realm
end

#snameRex::Proto::Kerberos::Model::PrincipalName

Returns The name part of the server’s identity.

Returns:



42
43
44
# File 'lib/rex/proto/kerberos/model/krb_error.rb', line 42

def sname
  @sname
end

#stimeTime

Returns The current time of the server.

Returns:

  • (Time)

    The current time of the server



24
25
26
# File 'lib/rex/proto/kerberos/model/krb_error.rb', line 24

def stime
  @stime
end

#susecFixnum

Returns The microseconds part of the server timestamp.

Returns:

  • (Fixnum)

    The microseconds part of the server timestamp



27
28
29
# File 'lib/rex/proto/kerberos/model/krb_error.rb', line 27

def susec
  @susec
end

Instance Method Details

#decode(input) ⇒ self

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

Parameters:

  • input (String, OpenSSL::ASN1::ASN1Data)

    the input to decode from

Returns:

  • (self)

    if decoding succeeds

Raises:



52
53
54
55
56
57
58
59
60
61
62
63
# File 'lib/rex/proto/kerberos/model/krb_error.rb', line 52

def decode(input)
  case input
  when String
    decode_string(input)
  when OpenSSL::ASN1::ASN1Data
    decode_asn1(input)
  else
    raise ::RuntimeError, 'Failed to decode KrbError, invalid input'
  end

  self
end

#encodeObject

Rex::Proto::Kerberos::Model::KrbError encoding isn’t supported



68
69
70
# File 'lib/rex/proto/kerberos/model/krb_error.rb', line 68

def encode
  raise ::NotImplementedError, 'KrbError encoding not supported'
end