Class: Rex::Proto::Kerberos::Model::EncKdcResponse

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

Overview

Based on datatracker.ietf.org/doc/html/rfc6806.html#section-11

EncKDCRepPart   ::= SEQUENCE {
        key             [0] EncryptionKey,
        last-req        [1] LastReq,
        nonce           [2] UInt32,
        key-expiration  [3] KerberosTime OPTIONAL,
        flags           [4] TicketFlags,
        authtime        [5] KerberosTime,
        starttime       [6] KerberosTime OPTIONAL,
        endtime         [7] KerberosTime,
        renew-till      [8] KerberosTime OPTIONAL,
        srealm          [9] Realm,
        sname           [10] PrincipalName,
        caddr           [11] HostAddresses OPTIONAL
        encrypted-pa-data [12] SEQUENCE OF PA-DATA OPTIONAL
}

Constant Summary

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

AP_REP, AP_REQ, AS_REP, AS_REQ, AUTHENTICATOR, 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

#auth_timeTime

Returns the time of initial authentication for the named principal.

Returns:

  • (Time)

    the time of initial authentication for the named principal



44
45
46
# File 'lib/rex/proto/kerberos/model/enc_kdc_response.rb', line 44

def auth_time
  @auth_time
end

#caddrRex::Proto::Kerberos::Model::HostAddress

Returns These are the addresses from which the ticket can be used.

Returns:



65
66
67
# File 'lib/rex/proto/kerberos/model/enc_kdc_response.rb', line 65

def caddr
  @caddr
end

#end_timeTime

not be honored (its expiration time)

Returns:

  • (Time)

    This field contains the time after which the ticket will



51
52
53
# File 'lib/rex/proto/kerberos/model/enc_kdc_response.rb', line 51

def end_time
  @end_time
end

#flagsRex::Proto::Kerberos::Model::KdcOptionFlags

requested when the ticket was issued

Returns:



41
42
43
# File 'lib/rex/proto/kerberos/model/enc_kdc_response.rb', line 41

def flags
  @flags
end

#keyRex::Proto::Kerberos::Model::EncryptionKey

Returns The session key.

Returns:



26
27
28
# File 'lib/rex/proto/kerberos/model/enc_kdc_response.rb', line 26

def key
  @key
end

#key_expirationTime

KDC and specifies the time that the client’s secret key is due to expire

Returns:

  • (Time)

    The key-expiration field is part of the response from the



37
38
39
# File 'lib/rex/proto/kerberos/model/enc_kdc_response.rb', line 37

def key_expiration
  @key_expiration
end

#last_reqArray<Rex::Proto::Kerberos::Model::LastRequest>

of the last request by a principal

Returns:



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

def last_req
  @last_req
end

#nonceInteger

Returns random number.

Returns:

  • (Integer)

    random number



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

def nonce
  @nonce
end

#pa_dataArray<Rex::Proto::Kerberos::Model::PreAuthDataEntry>?

Returns An array of PreAuthDataEntry. nil if not present.

Returns:



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

def pa_data
  @pa_data
end

#renew_tillTime

RENEWABLE flag set in the flags field. It indicates the maximum endtime that may be included in a renewal

Returns:

  • (Time)

    This field is only present in tickets that have the



56
57
58
# File 'lib/rex/proto/kerberos/model/enc_kdc_response.rb', line 56

def renew_till
  @renew_till
end

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

Returns The name part of the server’s identity.

Returns:



62
63
64
# File 'lib/rex/proto/kerberos/model/enc_kdc_response.rb', line 62

def sname
  @sname
end

#srealmString

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

Returns:

  • (String)

    The realm part of the server's principal identifier



59
60
61
# File 'lib/rex/proto/kerberos/model/enc_kdc_response.rb', line 59

def srealm
  @srealm
end

#start_timeTime

Returns Specifies the time after which the ticket is valid.

Returns:

  • (Time)

    Specifies the time after which the ticket is valid



47
48
49
# File 'lib/rex/proto/kerberos/model/enc_kdc_response.rb', line 47

def start_time
  @start_time
end

Instance Method Details

#decode(input) ⇒ self

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

Parameters:

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

    the input to decode from

Returns:

  • (self)

    if decoding succeeds

Raises:



75
76
77
78
79
80
81
82
83
84
85
86
# File 'lib/rex/proto/kerberos/model/enc_kdc_response.rb', line 75

def decode(input)
  case input
  when String
    decode_string(input)
  when OpenSSL::ASN1::ASN1Data
    decode_asn1(input)
  else
    raise ::Rex::Proto::Kerberos::Model::Error::KerberosDecodingError, 'Failed to decode EncKdcResponse, invalid input'
  end

  self
end

#encodeObject

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

Raises:

  • (NotImplementedError)


91
92
93
# File 'lib/rex/proto/kerberos/model/enc_kdc_response.rb', line 91

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