1
0
mirror of https://github.com/hashcat/hashcat.git synced 2024-12-23 15:18:16 +00:00

Added new event EVENT_WEAK_HASH_ALL_CRACKED if all hashes have been cracked during weak hash check

This commit is contained in:
jsteube 2017-01-03 09:56:40 +01:00
parent e1b5de12d5
commit 1f266fb0f2
4 changed files with 31 additions and 6 deletions

View File

@ -36,6 +36,7 @@
- Building: Added hashcat32.dll and hashcat64.dll makefile targets for building hashcat windows libraries
- Building: Removed access to readlink() on FreeBSD
- Events: Added new event EVENT_WEAK_HASH_ALL_CRACKED if all hashes have been cracked during weak hash check
- Hardware management: Switched matching ADL device with OpenCL device by using PCI bus, device and function
- Hardware management: Switched matching NvAPI device with OpenCL device by using PCI bus, device and function
- Hardware management: Switched matching NVML device with OpenCL device by using PCI bus, device and function

View File

@ -126,6 +126,7 @@ typedef enum event_identifier
EVENT_SET_KERNEL_POWER_FINAL = 0x000000c0,
EVENT_WEAK_HASH_POST = 0x000000d0,
EVENT_WEAK_HASH_PRE = 0x000000d1,
EVENT_WEAK_HASH_ALL_CRACKED = 0x000000d2,
EVENT_WORDLIST_CACHE_GENERATE = 0x000000e0,
EVENT_WORDLIST_CACHE_HIT = 0x000000e1,

View File

@ -604,6 +604,13 @@ static int outer_loop (hashcat_ctx_t *hashcat_ctx)
EVENT (EVENT_OUTERLOOP_MAINSCREEN);
/**
* Tell user about cracked hashes by potfile
*/
EVENT (EVENT_POTFILE_NUM_CRACKED);
/**
* inform the user
*/
@ -653,6 +660,17 @@ static int outer_loop (hashcat_ctx_t *hashcat_ctx)
EVENT (EVENT_WEAK_HASH_POST);
}
/**
* maybe all hashes were cracked now (as after potfile checks), we can exit here
*/
if (status_ctx->devices_status == STATUS_CRACKED)
{
EVENT (EVENT_WEAK_HASH_ALL_CRACKED);
return 0;
}
/**
* status and monitor threads
*/
@ -681,12 +699,6 @@ static int outer_loop (hashcat_ctx_t *hashcat_ctx)
}
}
/**
* Tell user about cracked hashes by potfile
*/
EVENT (EVENT_POTFILE_NUM_CRACKED);
// main call
if (restore_ctx->rd)

View File

@ -515,6 +515,16 @@ static void main_weak_hash_post (MAYBE_UNUSED hashcat_ctx_t *hashcat_ctx, MAYBE_
event_log_info_nn (hashcat_ctx, "Checked for weak hashes...");
}
static void main_weak_hash_all_cracked (MAYBE_UNUSED hashcat_ctx_t *hashcat_ctx, MAYBE_UNUSED const void *buf, MAYBE_UNUSED const size_t len)
{
const user_options_t *user_options = hashcat_ctx->user_options;
if (user_options->quiet == true) return;
event_log_info (hashcat_ctx, "INFO: All hashes found during weak hashes check! You can use --show to display them.");
event_log_info (hashcat_ctx, "");
}
static void main_bitmap_init_pre (MAYBE_UNUSED hashcat_ctx_t *hashcat_ctx, MAYBE_UNUSED const void *buf, MAYBE_UNUSED const size_t len)
{
const user_options_t *user_options = hashcat_ctx->user_options;
@ -889,6 +899,7 @@ static void event (const u32 id, hashcat_ctx_t *hashcat_ctx, const void *buf, co
case EVENT_SET_KERNEL_POWER_FINAL: main_set_kernel_power_final (hashcat_ctx, buf, len); break;
case EVENT_WEAK_HASH_POST: main_weak_hash_post (hashcat_ctx, buf, len); break;
case EVENT_WEAK_HASH_PRE: main_weak_hash_pre (hashcat_ctx, buf, len); break;
case EVENT_WEAK_HASH_ALL_CRACKED: main_weak_hash_all_cracked (hashcat_ctx, buf, len); break;
case EVENT_WORDLIST_CACHE_GENERATE: main_wordlist_cache_generate (hashcat_ctx, buf, len); break;
case EVENT_WORDLIST_CACHE_HIT: main_wordlist_cache_hit (hashcat_ctx, buf, len); break;
}