Move more constants to Crypto

bug/bundler_fix
jvazquez-r7 2014-12-22 15:27:16 -06:00
parent 75a2846377
commit ad97457a39
6 changed files with 7 additions and 11 deletions

View File

@ -17,7 +17,7 @@ module Msf
# @see Rex::Proto::Kerberos::Model::EncKdcResponse.decode
# @see Rex::Proto::Kerberos::Model::EncryptionKey
def extract_session_key(res, key)
decrypt_res = res.enc_part.decrypt(key, 8)
decrypt_res = res.enc_part.decrypt(key, Rex::Proto::Kerberos::Crypto::ENC_AS_RESPONSE)
enc_kdc_res = Rex::Proto::Kerberos::Model::EncKdcResponse.decode(decrypt_res)
enc_kdc_res.key
@ -33,7 +33,7 @@ module Msf
# @see Rex::Proto::Kerberos::Model::EncKdcResponse
# @see Rex::Proto::Kerberos::Model::EncKdcResponse.decode
def extract_logon_time(res, key)
decrypt_res = res.enc_part.decrypt(key, 8)
decrypt_res = res.enc_part.decrypt(key, Rex::Proto::Kerberos::Crypto::ENC_AS_RESPONSE)
enc_kdc_res = Rex::Proto::Kerberos::Model::EncKdcResponse.decode(decrypt_res)
auth_time = enc_kdc_res.auth_time

View File

@ -17,7 +17,7 @@ module Msf
# @see Msf::Kerberos::Client::CacheCredential
# @see Rex::Proto::Kerberos::CredentialCache::Cache
def extract_kerb_creds(res, key)
decrypt_res = res.enc_part.decrypt(key, 9)
decrypt_res = res.enc_part.decrypt(key, Rex::Proto::Kerberos::Crypto::ENC_TGS_RESPONSE)
enc_res = Rex::Proto::Kerberos::Model::EncKdcResponse.decode(decrypt_res)
client = create_cache_principal(

View File

@ -12,6 +12,9 @@ module Rex
RSA_MD5 = 7
RC4_HMAC = 23
ENC_KDC_REQUEST_BODY = 10
ENC_AS_RESPONSE = 8
ENC_TGS_RESPONSE = 9
end
end
end

View File

@ -17,12 +17,6 @@ module Rex
AUTHENTICATOR = 2
AP_REQ = 14
# Encrypted Message Id's
ENC_KDC_REQUEST_BODY = 10
ENC_AS_RESPONSE = 8
ENC_TGS_RESPONSE = 9
KDC_OPTION_RESERVED = 0
KDC_OPTION_FORWARDABLE = 1
KDC_OPTION_FORWARDED = 2

View File

@ -9,7 +9,7 @@ module Rex
class Type < Element
# @!attribute buffers
# @return [Array<Rex::Text::Proto::Kerberos::Pac::Element>] The array of PAC_INFO_BUFFER structures
# @return [Array<Rex::Proto::Kerberos::Pac::Element>] The array of PAC_INFO_BUFFER structures
attr_accessor :buffers
# @!attribute checksum
# @return [Fixnum] The type of checksum to use when encoding PAC-TYPE

View File

@ -129,7 +129,6 @@ describe Rex::Proto::Kerberos::Model::EncryptedData do
"\x9f\x5e\xb7\xb8\x9b\x57\xc5\xc9\xc5\xea\x90\x89\xc3\x63\x58"
end
let(:msg_type) { 1 }
#let(:known_password) { 'juan' }
let(:known_password) { OpenSSL::Digest.digest('MD4', Rex::Text.to_unicode('juan')) }
describe "#decode" do