1
0
mirror of https://github.com/hashcat/hashcat.git synced 2024-12-22 22:58:30 +00:00

Prevent unit test of -m 3000 to generate zero hash. This confuses test.sh validator

This commit is contained in:
Jens Steube 2021-04-26 09:32:19 +02:00
parent 9c8509e101
commit db57497e8f
2 changed files with 39 additions and 1 deletions

View File

@ -2099,6 +2099,44 @@ int hashes_init_zerohash (hashcat_ctx_t *hashcat_ctx)
found->pw_len = 0;
found->cracked = 1;
// should we show the cracked zero hash to the user?
if (false)
{
// digest pos
const u32 digest_pos = found - hashes_buf;
// show the crack
u8 *out_buf = (u8 *) hcmalloc (HCBUFSIZ_LARGE);
int out_len = hash_encode (hashcat_ctx->hashconfig, hashcat_ctx->hashes, hashcat_ctx->module_ctx, (char *) out_buf, HCBUFSIZ_LARGE, 0, digest_pos);
out_buf[out_len] = 0;
// outfile, can be either to file or stdout
// if an error occurs opening the file, send to stdout as fallback
// the fp gets opened for each cracked hash so that the user can modify (move) the outfile while hashcat runs
outfile_write_open (hashcat_ctx);
const u8 *plain = (const u8 *) "";
u8 *tmp_buf = (u8 *) hcmalloc (HCBUFSIZ_LARGE);
tmp_buf[0] = 0;
const int tmp_len = outfile_write (hashcat_ctx, (char *) out_buf, out_len, plain, 0, 0, NULL, 0, true, (char *) tmp_buf);
EVENT_DATA (EVENT_CRACKER_HASH_CRACKED, tmp_buf, tmp_len);
outfile_write_close (hashcat_ctx);
hcfree (tmp_buf);
hcfree (out_buf);
}
}
if (hashconfig->esalt_size > 0)

View File

@ -10,7 +10,7 @@ use warnings;
use Authen::Passphrase::LANManager;
sub module_constraints { [[0, 7], [-1, -1], [-1, -1], [-1, -1], [-1, -1]] }
sub module_constraints { [[1, 7], [-1, -1], [-1, -1], [-1, -1], [-1, -1]] }
sub module_generate_hash
{