Switch to using Rex's Crypto module

This commit is contained in:
Spencer McIntyre
2025-02-27 10:52:09 -05:00
parent e159ea5300
commit 11818c2812
@@ -122,17 +122,21 @@ module Msf::Exploit::Remote::SMB::Client::KerberosAuthentication
# see: https://docs.microsoft.com/en-us/openspecs/windows_protocols/ms-smb2/7fd079ca-17e6-4f02-8449-46b606ea289c
if @dialect == '0x0300' || @dialect == '0x0302'
@application_key = RubySMB::Crypto::KDF.counter_mode(
@application_key = Rex::Crypto::KeyDerivation::NIST_SP_800_108.counter_hmac(
@session_key,
"SMB2APP\x00",
"SmbRpc\x00"
)
16,
'SHA256',
label: "SMB2APP\x00",
context: "SmbRpc\x00"
).first
else
@application_key = RubySMB::Crypto::KDF.counter_mode(
@application_key = Rex::Crypto::KeyDerivation::NIST_SP_800_108.counter_hmac(
@session_key,
"SMBAppKey\x00",
@preauth_integrity_hash_value
)
16,
'SHA256',
label: "SMBAppKey\x00",
context: @preauth_integrity_hash_value
).first
end
# otherwise, leave encryption to the default value that it was initialized to
end