Fix test_modules

pull/1842/head
jsteube 6 years ago
parent 2afb4e0f36
commit fcaa7d5336

@ -16,9 +16,9 @@ sub module_constraints { [[0, 256], [0, 256], [0, 55], [0, 55], [0, 55]] }
sub module_generate_hash
{
my $word = shift;
my $salt = shift);
my $salt = shift;
my $digest = hmac_hex ($salt, $word, \&md5, 64) . ":$salt";
my $digest = hmac_hex ($salt, $word, \&md5, 64);
my $hash = sprintf ("%s:%s", $digest, $salt);

@ -18,7 +18,7 @@ sub module_generate_hash
my $word = shift;
my $salt = shift;
my $digest = hmac_hex ($word, $salt, \&md5, 64) . ":$salt";
my $digest = hmac_hex ($word, $salt, \&md5, 64);
my $hash = sprintf ("%s:%s", $digest, $salt);

@ -68,30 +68,11 @@ sub module_verify_hash
my $word_packed = pack_if_HEX_notation ($word);
my $new_hash = module_generate_hash ($word_packed_packed, $user, $domain, $srv_ch, $cli_ch);
# resolve lowercase/uppercase ambiguity in the username
# this will also guarantee a match with the preprocessed hashlist
$hash = lc $hash;
$new_hash = lc $new_hash;
return unless $new_hash eq $hash;
my $new_hash = module_generate_hash ($word_packed, $user, $domain, $srv_ch, $cli_ch);
return ($new_hash, $word);
}
# algorithm is case-insensitive in regard to usernames
# hashcat output always is uppercase, while real world hashes are not
sub module_preprocess_hashlist
{
my $hashlist = shift;
for my $hash (@{$hashlist})
{
$hash = lc $hash;
}
}
sub random_client_challenge
{
my $ch;

@ -102,7 +102,7 @@ sub module_verify_hash
my $b_plain = $cbc->decrypt ($b_cipher, $key, $b_iv);
my $plain = unpack ('H*', $b_plain);
my $new_hash = module_generate_hash ($word_packed_packed, $salt, $iter, $iv, $plain);
my $new_hash = module_generate_hash ($word_packed, $salt, $iter, $iv, $plain);
return ($new_hash, $word);
}

@ -128,7 +128,7 @@ sub module_verify_hash
my $plain = unpack ('H*', $b_plain);
my $new_hash = module_generate_hash ($word_packed_packed, $salt, $iter, $iv, $plain);
my $new_hash = module_generate_hash ($word_packed, $salt, $iter, $iv, $plain);
return ($new_hash, $word);
}

Loading…
Cancel
Save