app/models/metasploit/credential/ntlm_hash.rb in metasploit-credential-5.0.7 vs app/models/metasploit/credential/ntlm_hash.rb in metasploit-credential-5.0.8
- old
+ new
@@ -1,6 +1,23 @@
require 'net/ntlm'
+# TODO: Revert once available in rubyntlm
+# https://github.com/WinRb/rubyntlm/pull/51
+module Net
+ module NTLM
+ class << self
+ def apply_des(plain, keys)
+ keys.map {|k|
+ dec = OpenSSL::Cipher.new("des-cbc").encrypt
+ dec.padding = 0
+ dec.key = k
+ dec.update(plain) + dec.final
+ }
+ end
+ end
+ end
+end
+
# A {Metasploit::Credential::PasswordHash password hash} that can be {Metasploit::Credential::ReplayableHash replayed}
# to authenticate to SMB. It is composed of two hash hex digests (where the hash bytes are printed as a
# hexadecimal string where 2 characters represent a byte of the original hash with the high nibble first): (1)
# {lan_manager_hex_digest_from_password_data the LAN Manager hash's hex digest} and (2)
# {nt_lan_manager_hex_digest_from_password_data the NTLM hash's hex digest}.