From a03ddbcd22873b69054b07e0e39aec9934955d29 Mon Sep 17 00:00:00 2001 From: ajax Date: Sun, 16 Jun 2024 21:36:13 +0800 Subject: [PATCH] Restrict hash length --- src/modules/module_01712.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/modules/module_01712.c b/src/modules/module_01712.c index 181d10b03..2b7fc2ccc 100644 --- a/src/modules/module_01712.c +++ b/src/modules/module_01712.c @@ -31,6 +31,7 @@ static const u64 OPTS_TYPE = OPTS_TYPE_STOCK_MODULE | OPTS_TYPE_ST_ADD80 | OPTS_TYPE_ST_ADDBITS15; static const u32 SALT_TYPE = SALT_TYPE_GENERIC; +static const u32 PW_MAX_LEN = PW_MAX - 1; static const char *ST_PASS = "hashcat"; static const char *ST_HASH = "$h$6$1234567812345678$lOoc+PBmItFeqjI3gmldSvUBw14lVU99KcByK1KReazByCzChpmxELuXP+cC9Qxj+C73tuAYKTjfQRdr3IASbA=="; @@ -46,6 +47,7 @@ u64 module_kern_type (MAYBE_UNUSED const hashconfig_t *hashconfig, u32 module_opti_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) { return OPTI_TYPE; } u64 module_opts_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) { return OPTS_TYPE; } u32 module_salt_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) { return SALT_TYPE; } +u32 pw_max (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSED const user_options_t *user_options, MAYBE_UNUSED const user_options_extra_t *user_options_extra) { return PW_MAX_LEN; } const char *module_st_hash (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSED const user_options_t *user_options, MAYBE_UNUSED const user_options_extra_t *user_options_extra) { return ST_HASH; } const char *module_st_pass (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSED const user_options_t *user_options, MAYBE_UNUSED const user_options_extra_t *user_options_extra) { return ST_PASS; } @@ -258,7 +260,7 @@ void module_init (module_ctx_t *module_ctx) module_ctx->module_potfile_disable = MODULE_DEFAULT; module_ctx->module_potfile_keep_all_hashes = MODULE_DEFAULT; module_ctx->module_pwdump_column = MODULE_DEFAULT; - module_ctx->module_pw_max = MODULE_DEFAULT; + module_ctx->module_pw_max = pw_max; module_ctx->module_pw_min = MODULE_DEFAULT; module_ctx->module_salt_max = MODULE_DEFAULT; module_ctx->module_salt_min = MODULE_DEFAULT;