1
0
mirror of https://github.com/hashcat/hashcat.git synced 2024-11-05 23:10:00 +00:00

Fix missing check for -j and -k before writing hashcat.dictstat2 which can lead to false negatives

This commit is contained in:
jsteube 2023-08-08 21:11:44 +00:00
parent 7ee59e1a96
commit 734b435028
2 changed files with 9 additions and 1 deletions

View File

@ -18,7 +18,7 @@
#define MAX_DICTSTAT 100000
#define DICTSTAT_FILENAME "hashcat.dictstat2"
#define DICTSTAT_VERSION (0x6863646963743200 | 0x02)
#define DICTSTAT_VERSION (0x6863646963743200 | 0x03)
int sort_by_dictstat (const void *s1, const void *s2);

View File

@ -94,11 +94,15 @@ void dictstat_read (hashcat_ctx_t *hashcat_ctx)
{
hashconfig_t *hashconfig = hashcat_ctx->hashconfig;
dictstat_ctx_t *dictstat_ctx = hashcat_ctx->dictstat_ctx;
user_options_t *user_options = hashcat_ctx->user_options;
if (dictstat_ctx->enabled == false) return;
if (hashconfig->dictstat_disable == true) return;
if (user_options->rule_buf_l != NULL) return;
if (user_options->rule_buf_r != NULL) return;
HCFILE fp;
if (hc_fopen (&fp, dictstat_ctx->filename, "rb") == false)
@ -182,11 +186,15 @@ int dictstat_write (hashcat_ctx_t *hashcat_ctx)
{
hashconfig_t *hashconfig = hashcat_ctx->hashconfig;
dictstat_ctx_t *dictstat_ctx = hashcat_ctx->dictstat_ctx;
user_options_t *user_options = hashcat_ctx->user_options;
if (dictstat_ctx->enabled == false) return 0;
if (hashconfig->dictstat_disable == true) return 0;
if (user_options->rule_buf_l != NULL) return 0;
if (user_options->rule_buf_r != NULL) return 0;
HCFILE fp;
if (hc_fopen (&fp, dictstat_ctx->filename, "wb") == false)