mirror of
https://github.com/hashcat/hashcat.git
synced 2025-02-04 11:52:32 +00:00
Merge pull request #2498 from philsmd/tests_fix_16400
tests: fixed -m 16400 = CRAM-MD5 Dovecot tests
This commit is contained in:
commit
6a019b9621
@ -33,6 +33,7 @@
|
|||||||
- Backend: Changed the maximum number of compute devices from 64 to 128
|
- Backend: Changed the maximum number of compute devices from 64 to 128
|
||||||
- Tests: Improved tests for hash-mode 11300 (Bitcoin/Litecoin wallet.dat)
|
- Tests: Improved tests for hash-mode 11300 (Bitcoin/Litecoin wallet.dat)
|
||||||
- Tests: Improved tests for hash-mode 13600 (WinZip)
|
- Tests: Improved tests for hash-mode 13600 (WinZip)
|
||||||
|
- Tests: Improved tests for hash-mode 16400 (CRAM-MD5 Dovecot)
|
||||||
- Tests: Improved tests for hash-mode 16800 (WPA-PMKID-PBKDF2)
|
- Tests: Improved tests for hash-mode 16800 (WPA-PMKID-PBKDF2)
|
||||||
|
|
||||||
* changes v5.1.0 -> v6.0.0
|
* changes v5.1.0 -> v6.0.0
|
||||||
|
@ -15,6 +15,8 @@ sub module_constraints { [[0, 64], [-1, -1], [0, 55], [-1, -1], [-1, -1]] }
|
|||||||
sub module_generate_hash
|
sub module_generate_hash
|
||||||
{
|
{
|
||||||
my $word = shift;
|
my $word = shift;
|
||||||
|
my $salt = shift;
|
||||||
|
my $end = shift // "0" x 32;
|
||||||
|
|
||||||
my $md5 = Digest::Perl::MD5->new;
|
my $md5 = Digest::Perl::MD5->new;
|
||||||
my $length = length ($word);
|
my $length = length ($word);
|
||||||
@ -25,7 +27,7 @@ sub module_generate_hash
|
|||||||
|
|
||||||
my $digest = unpack ("H*", pack ('V4', @{$md5->{_state}}));
|
my $digest = unpack ("H*", pack ('V4', @{$md5->{_state}}));
|
||||||
|
|
||||||
my $hash = sprintf ("{CRAM-MD5}%s00000000000000000000000000000000", $digest);
|
my $hash = sprintf ("{CRAM-MD5}%s%s", $digest, $end);
|
||||||
|
|
||||||
return $hash;
|
return $hash;
|
||||||
}
|
}
|
||||||
@ -43,11 +45,11 @@ sub module_verify_hash
|
|||||||
|
|
||||||
return unless ($signature eq "{CRAM-MD5}");
|
return unless ($signature eq "{CRAM-MD5}");
|
||||||
|
|
||||||
my $hash = substr ($digest, 10);
|
my $end = substr ($digest, 42);
|
||||||
|
|
||||||
my $word_packed = pack_if_HEX_notation ($word);
|
my $word_packed = pack_if_HEX_notation ($word);
|
||||||
|
|
||||||
my $new_hash = module_generate_hash ($word_packed);
|
my $new_hash = module_generate_hash ($word_packed, "", $end);
|
||||||
|
|
||||||
return ($new_hash, $word);
|
return ($new_hash, $word);
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user