diff --git a/include/interface.h b/include/interface.h index 5ad2ed896..f9b612d21 100644 --- a/include/interface.h +++ b/include/interface.h @@ -370,6 +370,8 @@ u32 default_forced_kernel_loops (MAYBE_UNUSED const hashconfig_t *hash const char *default_hash_name (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSED const user_options_t *user_options, MAYBE_UNUSED const user_options_extra_t *user_options_extra); u32 default_hash_mode (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSED const user_options_t *user_options, MAYBE_UNUSED const user_options_extra_t *user_options_extra); u32 default_hash_type (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSED const user_options_t *user_options, MAYBE_UNUSED const user_options_extra_t *user_options_extra); +bool default_hlfmt_disable (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSED const user_options_t *user_options, MAYBE_UNUSED const user_options_extra_t *user_options_extra); +u32 default_hlfmt_pwdump_column (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSED const user_options_t *user_options, MAYBE_UNUSED const user_options_extra_t *user_options_extra); u64 default_hook_salt_size (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSED const user_options_t *user_options, MAYBE_UNUSED const user_options_extra_t *user_options_extra); u64 default_hook_size (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSED const user_options_t *user_options, MAYBE_UNUSED const user_options_extra_t *user_options_extra); u64 default_kern_type (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSED const user_options_t *user_options, MAYBE_UNUSED const user_options_extra_t *user_options_extra); diff --git a/include/modules.h b/include/modules.h index e24fee5ea..05be0c4e5 100644 --- a/include/modules.h +++ b/include/modules.h @@ -19,6 +19,8 @@ u32 module_forced_kernel_loops (MAYBE_UNUSED const hashconfig_t *hash const char *module_hash_name (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSED const user_options_t *user_options, MAYBE_UNUSED const user_options_extra_t *user_options_extra); u32 module_hash_mode (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSED const user_options_t *user_options, MAYBE_UNUSED const user_options_extra_t *user_options_extra); u32 module_hash_type (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSED const user_options_t *user_options, MAYBE_UNUSED const user_options_extra_t *user_options_extra); +bool module_hlfmt_disable (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSED const user_options_t *user_options, MAYBE_UNUSED const user_options_extra_t *user_options_extra); +u32 module_hlfmt_pwdump_column (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSED const user_options_t *user_options, MAYBE_UNUSED const user_options_extra_t *user_options_extra); u64 module_hook_salt_size (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSED const user_options_t *user_options, MAYBE_UNUSED const user_options_extra_t *user_options_extra); u64 module_hook_size (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSED const user_options_t *user_options, MAYBE_UNUSED const user_options_extra_t *user_options_extra); u64 module_kern_type (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSED const user_options_t *user_options, MAYBE_UNUSED const user_options_extra_t *user_options_extra); diff --git a/include/types.h b/include/types.h index 3fb804024..8473d28d3 100644 --- a/include/types.h +++ b/include/types.h @@ -454,6 +454,14 @@ typedef enum hlfmt_name } hlfmt_name_t; +typedef enum hlfmt_pwdump_column +{ + HLFMT_PWDUMP_COLUMN_NONE = 0, + HLFMT_PWDUMP_COLUMN_LM = 1, + HLFMT_PWDUMP_COLUMN_NTLM = 2, + +} hlfmt_pwdump_column_t; + typedef enum outfile_fmt { OUTFILE_FMT_HASH = (1 << 0), @@ -942,7 +950,10 @@ struct hashconfig u32 forced_kernel_loops; bool dictstat_disable; + bool hlfmt_disable; bool warmup_disable; + + u32 hlfmt_pwdump_column; }; typedef struct hashconfig hashconfig_t; @@ -2231,6 +2242,8 @@ typedef struct module_ctx const char *(*module_hash_name) (const hashconfig_t *, const user_options_t *, const user_options_extra_t *); u32 (*module_hash_mode) (const hashconfig_t *, const user_options_t *, const user_options_extra_t *); u32 (*module_hash_type) (const hashconfig_t *, const user_options_t *, const user_options_extra_t *); + bool (*module_hlfmt_disable) (const hashconfig_t *, const user_options_t *, const user_options_extra_t *); + u32 (*module_hlfmt_pwdump_column) (const hashconfig_t *, const user_options_t *, const user_options_extra_t *); u64 (*module_hook_salt_size) (const hashconfig_t *, const user_options_t *, const user_options_extra_t *); u64 (*module_hook_size) (const hashconfig_t *, const user_options_t *, const user_options_extra_t *); u64 (*module_kern_type) (const hashconfig_t *, const user_options_t *, const user_options_extra_t *); diff --git a/modules/m01000.c b/modules/m01000.c index 57e51751b..7c74d9f68 100644 --- a/modules/m01000.c +++ b/modules/m01000.c @@ -131,6 +131,8 @@ void module_register (module_ctx_t *module_ctx) module_ctx->module_hash_mode = NULL; module_ctx->module_hash_name = module_hash_name; module_ctx->module_hash_type = module_hash_type; + module_ctx->module_hlfmt_disable = NULL; + module_ctx->module_hlfmt_pwdump_column = NULL; module_ctx->module_hook_salt_size = NULL; module_ctx->module_hook_size = NULL; module_ctx->module_kern_type = module_kern_type; diff --git a/src/hlfmt.c b/src/hlfmt.c index 6452fa43f..db3dd876a 100644 --- a/src/hlfmt.c +++ b/src/hlfmt.c @@ -129,18 +129,18 @@ static void hlfmt_hash_pwdump (MAYBE_UNUSED hashcat_ctx_t *hashcat_ctx, char *li continue; } - if (hashconfig->hash_mode == 1000) + if (hashconfig->hlfmt_pwdump_column == HLFMT_PWDUMP_COLUMN_LM) { - if (sep_cnt == 3) + if (sep_cnt == 2) { if (pos == NULL) pos = line_buf + i; len++; } } - else if (hashconfig->hash_mode == 3000) + else if (hashconfig->hlfmt_pwdump_column == HLFMT_PWDUMP_COLUMN_NTLM) { - if (sep_cnt == 2) + if (sep_cnt == 3) { if (pos == NULL) pos = line_buf + i; @@ -339,8 +339,7 @@ u32 hlfmt_detect (hashcat_ctx_t *hashcat_ctx, FILE *fp, u32 max_check) // Exception: those formats are wrongly detected as HLFMT_SHADOW, prevent it - if (hashconfig->hash_mode == 5300) return HLFMT_HASHCAT; - if (hashconfig->hash_mode == 5400) return HLFMT_HASHCAT; + if (hashconfig->hlfmt_disable == true) return HLFMT_HASHCAT; u32 *formats_cnt = (u32 *) hccalloc (HLFMTS_CNT, sizeof (u32)); diff --git a/src/interface.c b/src/interface.c index 44d3c099c..4c2bd80f0 100644 --- a/src/interface.c +++ b/src/interface.c @@ -871,6 +871,8 @@ int hashconfig_init (hashcat_ctx_t *hashcat_ctx) hashconfig->hash_name = default_hash_name (hashconfig, user_options, user_options_extra); hashconfig->hash_mode = default_hash_mode (hashconfig, user_options, user_options_extra); hashconfig->hash_type = default_hash_type (hashconfig, user_options, user_options_extra); + hashconfig->hlfmt_disable = default_hlfmt_disable (hashconfig, user_options, user_options_extra); + hashconfig->hlfmt_pwdump_column = default_hlfmt_pwdump_column (hashconfig, user_options, user_options_extra); hashconfig->hook_salt_size = default_hook_salt_size (hashconfig, user_options, user_options_extra); hashconfig->hook_size = default_hook_size (hashconfig, user_options, user_options_extra); hashconfig->kern_type = default_kern_type (hashconfig, user_options, user_options_extra); @@ -900,6 +902,8 @@ int hashconfig_init (hashcat_ctx_t *hashcat_ctx) if (module_ctx->module_hash_name) hashconfig->hash_name = module_ctx->module_hash_name (hashconfig, user_options, user_options_extra); if (module_ctx->module_hash_mode) hashconfig->hash_mode = module_ctx->module_hash_mode (hashconfig, user_options, user_options_extra); if (module_ctx->module_hash_type) hashconfig->hash_type = module_ctx->module_hash_type (hashconfig, user_options, user_options_extra); + if (module_ctx->module_hlfmt_disable) hashconfig->hlfmt_disable = module_ctx->module_hlfmt_disable (hashconfig, user_options, user_options_extra); + if (module_ctx->module_hlfmt_pwdump_column) hashconfig->hlfmt_pwdump_column = module_ctx->module_hlfmt_pwdump_column (hashconfig, user_options, user_options_extra); if (module_ctx->module_hook_salt_size) hashconfig->hook_salt_size = module_ctx->module_hook_salt_size (hashconfig, user_options, user_options_extra); if (module_ctx->module_hook_size) hashconfig->hook_size = module_ctx->module_hook_size (hashconfig, user_options, user_options_extra); if (module_ctx->module_kern_type) hashconfig->kern_type = module_ctx->module_kern_type (hashconfig, user_options, user_options_extra); @@ -1908,6 +1912,20 @@ bool default_warmup_disable (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_ return warmup_disable; } +bool default_hlfmt_disable (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSED const user_options_t *user_options, MAYBE_UNUSED const user_options_extra_t *user_options_extra) +{ + const bool hlfmt_disable = false; + + return hlfmt_disable; +} + +u32 default_hlfmt_pwdump_column (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSED const user_options_t *user_options, MAYBE_UNUSED const user_options_extra_t *user_options_extra) +{ + const u32 hlfmt_pwdump_column = HLFMT_PWDUMP_COLUMN_NONE; + + return hlfmt_pwdump_column; +} + // migrate void seven_zip_hook_func (hc_device_param_t *device_param, void *hook_salts_buf, const u32 salt_pos, const u64 pws_cnt) diff --git a/src/interface_migrate.c b/src/interface_migrate.c index 25f55aecb..182828e59 100644 --- a/src/interface_migrate.c +++ b/src/interface_migrate.c @@ -28154,3 +28154,15 @@ bool default_dictstat_disable (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYB } } + +bool default_hlfmt_disable (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSED const user_options_t *user_options, MAYBE_UNUSED const user_options_extra_t *user_options_extra) +{ + + switch (hashconfig->hash_mode) + { + case 5300: return true; + case 5400: return true; + } + + +}