1
0
mirror of https://github.com/hashcat/hashcat.git synced 2024-11-22 16:18:09 +00:00

Fix test_modules

This commit is contained in:
jsteube 2018-12-27 19:43:51 +01:00
parent 2afb4e0f36
commit fcaa7d5336
5 changed files with 6 additions and 25 deletions

View File

@ -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);

View File

@ -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);

View File

@ -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;

View File

@ -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);
}

View File

@ -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);
}