Class: Rex::Proto::Kerberos::CredentialCache::Krb5Ccache

Inherits:
BinData::Record
  • Object
show all
Defined in:
lib/rex/proto/kerberos/credential_cache/krb5_ccache.rb

Overview

Class Method Summary collapse

Class Method Details

.from_responses(res, enc_res) ⇒ Rex::Proto::Kerberos::CredentialCache::Krb5Ccache

Parameters:

Returns:



47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
# File 'lib/rex/proto/kerberos/credential_cache/krb5_ccache.rb', line 47

def self.from_responses(res, enc_res)
  self.new(
    default_principal: {
      name_type: res.cname.name_type, # NT_PRINCIPAL
      realm: res.crealm,
      components: res.cname.name_string
    },
    credentials: [
      {
        client: {
          name_type: res.cname.name_type,
          realm: res.crealm,
          components: res.cname.name_string
        },
        server: {
          name_type: enc_res.sname.name_type,
          realm: enc_res.srealm,
          components: enc_res.sname.name_string
        },
        keyblock: {
          enctype: enc_res.key.type,
          data: enc_res.key.value
        },
        authtime: enc_res.auth_time,
        starttime: enc_res.start_time,
        endtime: enc_res.end_time,
        renew_till: enc_res.renew_till,
        ticket_flags: enc_res.flags.to_i,
        ticket: res.ticket.encode
      }
    ]
  )
end