Class: Rex::Proto::Kerberos::Model::KdcResponse

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

Overview

This class provides a representation of a Kerberos KDC-REP (response) data definition

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

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

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

Returns:



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

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



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

def crealm
  @crealm
end

#enc_partRex::Proto::Kerberos::Model::EncryptedData

Returns The encrypted part of the response.

Returns:



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

def enc_part
  @enc_part
end

#msg_typeInteger

Returns The type of a protocol message.

Returns:

  • (Integer)

    The type of a protocol message



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

def msg_type
  @msg_type
end

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

Returns An array of PreAuthDataEntry. nil if not present.

Returns:



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

def pa_data
  @pa_data
end

#pvnoInteger

Returns The protocol version number.

Returns:

  • (Integer)

    The protocol version number



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

def pvno
  @pvno
end

#ticketRex::Proto::Kerberos::Model::Ticket

Returns The issued ticket.

Returns:



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

def ticket
  @ticket
end

Instance Method Details

#decode(input) ⇒ self

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

Parameters:

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

    the input to decode from

Returns:

  • (self)

    if decoding succeeds

Raises:



37
38
39
40
41
42
43
44
45
46
47
48
# File 'lib/rex/proto/kerberos/model/kdc_response.rb', line 37

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 KdcResponse, invalid input'
  end

  self
end

#encodeObject

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

Raises:

  • (NotImplementedError)


53
54
55
# File 'lib/rex/proto/kerberos/model/kdc_response.rb', line 53

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