Changeset 4891
- Timestamp:
- 05/09/07 07:39:37 (1 year ago)
- Files:
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
framework3/tags/framework-3.0/lib/rex/proto/smb/client.rb
r4315 r4891 569 569 raise XCEPT::NTLM1MissingChallenge if not self.challenge_key 570 570 571 hash_lm = pass.length > 0 ? CRYPT.lanman_des(pass, self.challenge_key) : '' 572 hash_nt = pass.length > 0 ? CRYPT.ntlm_md4(pass, self.challenge_key) : '' 571 if (pass.length == 65) 572 hash_lm = CRYPT.e_p24( [ pass.upcase()[0,32] ].pack('H42'), self.challenge_key) 573 hash_nt = CRPYT.e_p24( [ pass.upcase()[33,65] ].pack('H42'), self.challenge_key) 574 else 575 hash_lm = pass.length > 0 ? CRYPT.lanman_des(pass, self.challenge_key) : '' 576 hash_nt = pass.length > 0 ? CRYPT.ntlm_md4(pass, self.challenge_key) : '' 577 end 573 578 574 579 data = '' … … 691 696 692 697 # Generate the NTLM hash 693 resp_ntlm = CRYPT.ntlm_md4(pass, nonce[0, 8]) 698 if (pass.length == 65) 699 resp_ntlm = CRYPT.e_p24( [ pass.upcase()[33,65] ].pack('H42'), nonce[0, 8]) 700 else 701 resp_ntlm = CRYPT.ntlm_md4(pass, nonce[0, 8]) 702 end 694 703 695 704 # Generate the fake LANMAN hash
