2005-12-17 06:46:23 +00:00
|
|
|
#!/usr/bin/env ruby
|
2005-09-16 09:27:41 +00:00
|
|
|
|
|
|
|
$:.unshift(File.join(File.dirname(__FILE__), '..', '..', '..'))
|
|
|
|
|
2005-12-13 06:08:40 +00:00
|
|
|
require 'rex/test'
|
2005-09-16 09:27:41 +00:00
|
|
|
require 'rex/proto/smb/crypt'
|
|
|
|
|
|
|
|
class Rex::Proto::SMB::Crypt::UnitTest < Test::Unit::TestCase
|
|
|
|
|
|
|
|
Klass = Rex::Proto::SMB::Crypt
|
|
|
|
|
|
|
|
def test_parse
|
|
|
|
|
2006-03-07 20:19:30 +00:00
|
|
|
pass = "XXXXXXX"
|
|
|
|
chal = "Z" * 8
|
2005-09-16 09:27:41 +00:00
|
|
|
|
2006-03-07 20:19:30 +00:00
|
|
|
assert_equal("\xc2\x48\xcf\x61\x65\xfe\x55\xef\xac\xa0\x30\x09\x66\xdc\x37\x96\x04\x6b\x9c\x0b\xb4\xa5\x2e\x27", Klass.lanman_des(pass, chal), 'lanman_des')
|
|
|
|
assert_equal("\x8d\x04\x18\x58\xf0\x78\xcc\xfa\x15\x60\xa4\x61\x76\x90\xe5\x51\x84\xfd\x70\xec\x7f\x23\xb7\xf9", Klass.ntlm_md4(pass, chal), 'ntlm_md4')
|
2005-09-16 09:27:41 +00:00
|
|
|
end
|
2008-10-19 21:03:39 +00:00
|
|
|
end
|