From 35d51020a52eff9d93815dbcb699958513c763f4 Mon Sep 17 00:00:00 2001 From: Chick3nman Date: Thu, 23 Mar 2023 19:01:24 -0500 Subject: [PATCH 1/3] Add user opt sanity check for brain port, clean up messages for other brain related checks. --- src/user_options.c | 15 +++++++++++---- 1 file changed, 11 insertions(+), 4 deletions(-) diff --git a/src/user_options.c b/src/user_options.c index 4dd2dce39..b9c5575ce 100644 --- a/src/user_options.c +++ b/src/user_options.c @@ -559,24 +559,31 @@ int user_options_sanity (hashcat_ctx_t *hashcat_ctx) return -1; } - #ifdef WITH_BRAIN +#ifdef WITH_BRAIN if ((user_options->brain_client == true) && (user_options->brain_server == true)) { - event_log_error (hashcat_ctx, "Can not have --brain-client and --brain-server at the same time"); + event_log_error (hashcat_ctx, "Can not have --brain-client and --brain-server at the same time."); return -1; } if ((user_options->brain_client_features < 1) || (user_options->brain_client_features > 3)) { - event_log_error (hashcat_ctx, "Invalid --brain-client-feature argument"); + event_log_error (hashcat_ctx, "Invalid --brain-client-feature argument."); return -1; } + + if (user_options->brain_port > 65535) + { + event_log_error (hashcat_ctx, "Invalid brain port specified (greater than 65535)."); + return -1; + } + if ((user_options->brain_client == true) && (user_options->brain_password_chgd == false)) { - event_log_error (hashcat_ctx, "Brain clients need to set --brain-password"); + event_log_error (hashcat_ctx, "Brain clients must specify --brain-password."); return -1; } From 43ef1da420748cb0f91e224a7cd39e25449255f9 Mon Sep 17 00:00:00 2001 From: Chick3nman Date: Thu, 23 Mar 2023 19:07:48 -0500 Subject: [PATCH 2/3] Add changes from previous PR #3598. --- docs/changes.txt | 1 + 1 file changed, 1 insertion(+) diff --git a/docs/changes.txt b/docs/changes.txt index bfe6b77cc..29a33a254 100644 --- a/docs/changes.txt +++ b/docs/changes.txt @@ -42,6 +42,7 @@ - Fixed debug mode 5 by adding the missing colon between original-word and finding-rule - Skip generated rule that was the result of chaining rule operation and caused this generated rule to exceed the maximum number of function calls - Fixed incorrect plaintext check for 25400 and 26610. Increased plaintext check to 32 bytes to prevent false positives. +- Fixed bug in --stdout that caused certain rules to malfunction ## ## Technical From e76486fe6fb65c28a5798774f92d7e361432bc71 Mon Sep 17 00:00:00 2001 From: Chick3nman Date: Thu, 23 Mar 2023 19:09:37 -0500 Subject: [PATCH 3/3] Add changes for brain port sanity check --- docs/changes.txt | 1 + 1 file changed, 1 insertion(+) diff --git a/docs/changes.txt b/docs/changes.txt index 29a33a254..6a6dabc0c 100644 --- a/docs/changes.txt +++ b/docs/changes.txt @@ -52,6 +52,7 @@ - Apple Driver: Automatically enable GPU support on Apple OpenCL instead of CPU support - Apple Driver: Updated requirements to use Apple OpenCL API to macOS 13.0 - use - Backend Checks: Described workaround in error message when detecting more than 64 backend devices +- Brain: Added sanity check and corresponding error message for invalid --brain-port values - Modules: Added support for non-zero IVs for -m 6800 (Lastpass). Also added `tools/lastpass2hashcat.py` - Status Code: Add specific return code for self-test fail (-11) - SCRYPT: Increase buffer sizes in module for hash mode 8900 to allow longer SCRYPT digests