Module: Msf::Exploit::Remote::Kerberos::Client::AsResponse
- Included in:
- Msf::Exploit::Remote::Kerberos::Client
- Defined in:
- lib/msf/core/exploit/remote/kerberos/client/as_response.rb
Instance Method Summary collapse
-
#decrypt_kdc_as_rep_enc_part(res, key) ⇒ Rex::Proto::Kerberos::Model::EncKdcResponse
Extracts the session key from a Kerberos AS Response.
-
#extract_logon_time(res, key) ⇒ Time
Extracts the logon time from a Kerberos AS Response.
-
#extract_session_key(res, key) ⇒ Rex::Proto::Kerberos::Model::EncryptionKey
Extracts the session key from a Kerberos AS Response.
- #format_as_rep_to_john_hash(asrep) ⇒ String
Instance Method Details
#decrypt_kdc_as_rep_enc_part(res, key) ⇒ Rex::Proto::Kerberos::Model::EncKdcResponse
Extracts the session key from a Kerberos AS Response
20 21 22 23 24 |
# File 'lib/msf/core/exploit/remote/kerberos/client/as_response.rb', line 20 def decrypt_kdc_as_rep_enc_part(res, key) decrypt_res = res.enc_part.decrypt_asn1(key, Rex::Proto::Kerberos::Crypto::KeyUsage::AS_REP_ENCPART) enc_res = Rex::Proto::Kerberos::Model::EncKdcResponse.decode(decrypt_res) enc_res end |
#extract_logon_time(res, key) ⇒ Time
Extracts the logon time from a Kerberos AS Response
50 51 52 53 |
# File 'lib/msf/core/exploit/remote/kerberos/client/as_response.rb', line 50 def extract_logon_time(res, key) kdc_res = decrypt_kdc_as_rep_enc_part(res, key) kdc_res.auth_time end |
#extract_session_key(res, key) ⇒ Rex::Proto::Kerberos::Model::EncryptionKey
Extracts the session key from a Kerberos AS Response
36 37 38 39 |
# File 'lib/msf/core/exploit/remote/kerberos/client/as_response.rb', line 36 def extract_session_key(res, key) kdc_res = decrypt_kdc_as_rep_enc_part(res, key) kdc_res.key end |
#format_as_rep_to_john_hash(asrep) ⇒ String
Format from
https://github.com/hashcat/hashcat/blob/6fce6fb3ff120ed16b300af97cf2144b36edcbe8/src/modules/module_18200.c#L126-L132
59 60 61 |
# File 'lib/msf/core/exploit/remote/kerberos/client/as_response.rb', line 59 def format_as_rep_to_john_hash(asrep) "$krb5asrep$#{asrep.enc_part.etype}$#{asrep.cname.name_string.join('/')}@#{asrep.ticket.realm}:#{asrep.enc_part.cipher[0...16].unpack1('H*')}$#{asrep.enc_part.cipher[16..].unpack1('H*')}" end |