From 963a9772ba532f8c6895a342ea443efd27f5b1a2 Mon Sep 17 00:00:00 2001 From: Jens Steube Date: Sun, 12 Mar 2017 11:05:37 +0100 Subject: [PATCH] Fixed --remove was not applied in case all hashes have been cracked by help of potfile or weak-hash check --- docs/changes.txt | 1 + src/hashcat.c | 14 ++++++++++++++ src/hashes.c | 2 +- 3 files changed, 16 insertions(+), 1 deletion(-) diff --git a/docs/changes.txt b/docs/changes.txt index f5f46ca37..05d84dd5f 100644 --- a/docs/changes.txt +++ b/docs/changes.txt @@ -22,6 +22,7 @@ - Fixed a problem where --stdout combined with custom charsets incorrectly displayed an error message - Fixed a typo that resulted in the minimum password length not being correctly initialized - Fixed a problem with parsing and displaying -m 7000 = Fortigate (FortiOS) hashes +- Fixed --remove was not applied in case all hashes have been cracked by help of potfile or weak-hash check ## ## Technical diff --git a/src/hashcat.c b/src/hashcat.c index 0aa601956..551a15df1 100644 --- a/src/hashcat.c +++ b/src/hashcat.c @@ -504,6 +504,13 @@ static int outer_loop (hashcat_ctx_t *hashcat_ctx) if (status_ctx->devices_status == STATUS_CRACKED) { + if (hashes->digests_saved != hashes->digests_done) + { + const int rc = save_hash (hashcat_ctx); + + if (rc == -1) return -1; + } + EVENT (EVENT_POTFILE_ALL_CRACKED); return 0; @@ -683,6 +690,13 @@ static int outer_loop (hashcat_ctx_t *hashcat_ctx) if (status_ctx->devices_status == STATUS_CRACKED) { + if (hashes->digests_saved != hashes->digests_done) + { + const int rc = save_hash (hashcat_ctx); + + if (rc == -1) return -1; + } + EVENT (EVENT_WEAK_HASH_ALL_CRACKED); return 0; diff --git a/src/hashes.c b/src/hashes.c index ed52268bc..ba50cb014 100644 --- a/src/hashes.c +++ b/src/hashes.c @@ -545,7 +545,7 @@ int hashes_init_stage1 (hashcat_ctx_t *hashcat_ctx) hashlist_format = hlfmt_detect (hashcat_ctx, fp, 100); // 100 = max numbers to "scan". could be hashes_avail, too - if ((user_options->remove == 1) && (hashlist_format != HLFMT_HASHCAT)) + if ((user_options->remove == true) && (hashlist_format != HLFMT_HASHCAT)) { event_log_error (hashcat_ctx, "remove not supported in native hashfile-format mode");