1
0
mirror of https://github.com/hashcat/hashcat.git synced 2024-12-23 07:08:19 +00:00

Added test modules for mode 133, 140 and 141

This commit is contained in:
Sein Coray 2019-01-08 23:27:20 +01:00
parent 1013578364
commit 4d1c53b3e5
No known key found for this signature in database
GPG Key ID: 44C4180EA69758EC
3 changed files with 149 additions and 0 deletions

View File

@ -0,0 +1,46 @@
#!/usr/bin/env perl
##
## Author......: See docs/credits.txt
## License.....: MIT
##
use strict;
use warnings;
use Digest::SHA1 qw (sha1);
use MIME::Base64 qw (encode_base64);
use Encode;
sub module_constraints { [[0, 255], [-1, -1], [0, 27], [-1, -1], [-1, -1]] }
sub module_generate_hash
{
my $word = shift;
my $digest = sha1 (encode ("UTF-16LE", $word));
$digest = encode_base64 ($digest, "");
my $hash = sprintf ("%s", $digest);
return $hash;
}
sub module_verify_hash
{
my $line = shift;
my ($hash, $word) = split (':', $line);
return unless defined $hash;
return unless defined $word;
$word = pack_if_HEX_notation ($word);
my $new_hash = module_generate_hash ($word);
return ($new_hash, $word);
}
1;

View File

@ -0,0 +1,45 @@
#!/usr/bin/env perl
##
## Author......: See docs/credits.txt
## License.....: MIT
##
use strict;
use warnings;
use Digest::SHA1 qw (sha1_hex);
use Encode;
sub module_constraints { [[0, 255], [0, 255], [0, 27], [0, 55], [0, 27]] }
sub module_generate_hash
{
my $word = shift;
my $salt = shift;
my $digest = sha1_hex ($salt . encode ("UTF-16LE", $word));
my $hash = sprintf ("%s:%s", $digest, $salt);
return $hash;
}
sub module_verify_hash
{
my $line = shift;
my ($hash, $salt, $word) = split (':', $line);
return unless defined $hash;
return unless defined $salt;
return unless defined $word;
$word = pack_if_HEX_notation ($word);
my $new_hash = module_generate_hash ($word, $salt);
return ($new_hash, $word);
}
1;

View File

@ -0,0 +1,58 @@
#!/usr/bin/env perl
##
## Author......: See docs/credits.txt
## License.....: MIT
##
use strict;
use warnings;
use Digest::SHA1 qw (sha1);
use MIME::Base64 qw (encode_base64 decode_base64);
use Encode;
sub module_constraints { [[0, 255], [0, 255], [0, 27], [0, 55], [0, 27]] }
sub module_generate_hash
{
my $word = shift;
my $salt = shift;
my $digest = sha1 ($salt . encode ("UTF-16LE", $word));
my $base64_salt_buf = encode_base64 ($salt, "");
my $base64_hash_buf = encode_base64 ($digest, "");
$base64_hash_buf = substr ($base64_hash_buf, 0, 27);
my $hash = sprintf ("\$episerver\$*0*%s*%s", $base64_salt_buf, $base64_hash_buf);
return $hash;
}
sub module_verify_hash
{
my $line = shift;
my ($digest, $word) = split (':', $line);
$digest = substr($digest, 14);
my ($base64_salt, $base64_hash) = split('\*', $digest);
my $hash = decode_base64($base64_hash);
my $salt = decode_base64($base64_salt);
return unless defined $hash;
return unless defined $salt;
return unless defined $word;
$word = pack_if_HEX_notation ($word);
my $new_hash = module_generate_hash ($word, $salt);
return ($new_hash, $word);
}
1;