static void main_monitor_status_refresh (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; const user_options_extra_t *user_options_extra = hashcat_ctx->user_options_extra; if ((user_options_extra->wordlist_mode == WL_MODE_FILE) || (user_options_extra->wordlist_mode == WL_MODE_MASK)) { if (user_options->quiet == false) { //clear_prompt (); event_log_info (hashcat_ctx, ""); event_log_info (hashcat_ctx, ""); } } status_display (hashcat_ctx); if ((user_options_extra->wordlist_mode == WL_MODE_FILE) || (user_options_extra->wordlist_mode == WL_MODE_MASK)) { if (user_options->quiet == false) { event_log_info (hashcat_ctx, ""); send_prompt (); } } }
static void main_potfile_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 in potfile! You can use --show to display them."); event_log_info (hashcat_ctx, ""); }
static void main_wordlist_cache_hit (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; cache_hit_t *cache_hit = (cache_hit_t *) buf; event_log_info (hashcat_ctx, "Cache-hit dictionary stats %s: %" PRId64 " bytes, %" PRIu64 " words, %" PRIu64 " keyspace", cache_hit->dictfile, cache_hit->stat.st_size, cache_hit->cached_cnt, cache_hit->keyspace); event_log_info (hashcat_ctx, ""); }
static void main_set_kernel_power_final (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; clear_prompt (); event_log_info (hashcat_ctx, "INFO: approaching final keyspace, workload adjusted"); event_log_info (hashcat_ctx, ""); send_prompt (); }
void status_benchmark (hashcat_ctx_t *hashcat_ctx) { const user_options_t *user_options = hashcat_ctx->user_options; if (user_options->machine_readable == true) { status_benchmark_machine_readable (hashcat_ctx); return; } hashcat_status_t *hashcat_status = (hashcat_status_t *) hcmalloc (sizeof (hashcat_status_t)); const int rc_status = hashcat_get_status (hashcat_ctx, hashcat_status); if (rc_status == -1) { hcfree (hashcat_status); return; } for (int device_id = 0; device_id < hashcat_status->device_info_cnt; device_id++) { const device_info_t *device_info = hashcat_status->device_info_buf + device_id; if (device_info->skipped_dev == true) continue; event_log_info (hashcat_ctx, "Speed.#%d.........: %9sH/s (%0.2fms) @ Accel:%d Loops:%d Thr:%d Vec:%d", device_id + 1, device_info->speed_sec_dev, device_info->exec_msec_dev, device_info->kernel_accel_dev, device_info->kernel_loops_dev, device_info->kernel_threads_dev, device_info->vector_width_dev); } if (hashcat_status->device_info_active > 1) { event_log_info (hashcat_ctx, "Speed.#*.........: %9sH/s", hashcat_status->speed_sec_all); } status_status_destroy (hashcat_ctx, hashcat_status); hcfree (hashcat_status); }
void status_progress (hashcat_ctx_t *hashcat_ctx) { const user_options_t *user_options = hashcat_ctx->user_options; if (user_options->machine_readable == true) { status_progress_machine_readable (hashcat_ctx); return; } hashcat_status_t *hashcat_status = (hashcat_status_t *) hcmalloc (sizeof (hashcat_status_t)); const int rc_status = hashcat_get_status (hashcat_ctx, hashcat_status); if (rc_status == -1) { hcfree (hashcat_status); return; } for (int device_id = 0; device_id < hashcat_status->device_info_cnt; device_id++) { const device_info_t *device_info = hashcat_status->device_info_buf + device_id; if (device_info->skipped_dev == true) continue; event_log_info (hashcat_ctx, "Progress.#%d......: %" PRIu64, device_id + 1, device_info->progress_dev); } for (int device_id = 0; device_id < hashcat_status->device_info_cnt; device_id++) { const device_info_t *device_info = hashcat_status->device_info_buf + device_id; if (device_info->skipped_dev == true) continue; event_log_info (hashcat_ctx, "Runtime.#%d.......: %0.2fms", device_id + 1, device_info->runtime_msec_dev); } status_status_destroy (hashcat_ctx, hashcat_status); hcfree (hashcat_status); }
void status_progress_machine_readable (hashcat_ctx_t *hashcat_ctx) { hashcat_status_t *hashcat_status = (hashcat_status_t *) hcmalloc (sizeof (hashcat_status_t)); const int rc_status = hashcat_get_status (hashcat_ctx, hashcat_status); if (rc_status == -1) { hcfree (hashcat_status); return; } for (int device_id = 0; device_id < hashcat_status->device_info_cnt; device_id++) { const device_info_t *device_info = hashcat_status->device_info_buf + device_id; if (device_info->skipped_dev == true) continue; event_log_info (hashcat_ctx, "%d:%" PRIu64 ":%0.2f", device_id + 1, device_info->progress_dev, device_info->runtime_msec_dev); } status_status_destroy (hashcat_ctx, hashcat_status); hcfree (hashcat_status); }
void status_speed_machine_readable (hashcat_ctx_t *hashcat_ctx) { hashcat_status_t *hashcat_status = (hashcat_status_t *) hcmalloc (sizeof (hashcat_status_t)); const int rc_status = hashcat_get_status (hashcat_ctx, hashcat_status); if (rc_status == -1) { hcfree (hashcat_status); return; } for (int device_id = 0; device_id < hashcat_status->device_info_cnt; device_id++) { const device_info_t *device_info = hashcat_status->device_info_buf + device_id; if (device_info->skipped_dev == true) continue; event_log_info (hashcat_ctx, "%d:%" PRIu64, device_id + 1, (u64) (device_info->hashes_msec_dev_benchmark * 1000)); } status_status_destroy (hashcat_ctx, hashcat_status); hcfree (hashcat_status); }
void status_speed (hashcat_ctx_t *hashcat_ctx) { const user_options_t *user_options = hashcat_ctx->user_options; if (user_options->machine_readable == true) { status_speed_machine_readable (hashcat_ctx); return; } hashcat_status_t *hashcat_status = (hashcat_status_t *) hcmalloc (sizeof (hashcat_status_t)); const int rc_status = hashcat_get_status (hashcat_ctx, hashcat_status); if (rc_status == -1) { hcfree (hashcat_status); return; } for (int device_id = 0; device_id < hashcat_status->device_info_cnt; device_id++) { const device_info_t *device_info = hashcat_status->device_info_buf + device_id; if (device_info->skipped_dev == true) continue; event_log_info (hashcat_ctx, "Speed.Dev.#%d.....: %9sH/s (%0.2fms)", device_id + 1, device_info->speed_sec_dev, device_info->exec_msec_dev); } if (hashcat_status->device_info_active > 1) { event_log_info (hashcat_ctx, "Speed.Dev.#*.....: %9sH/s", hashcat_status->speed_sec_all); } status_status_destroy (hashcat_ctx, hashcat_status); hcfree (hashcat_status); }
static void main_wordlist_cache_generate (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; cache_generate_t *cache_generate = (cache_generate_t *) buf; if (cache_generate->percent < 100) { event_log_info_nn (hashcat_ctx, "Generating dictionary stats for %s: %" PRIu64 " bytes (%.2f%%), %" PRIu64 " words, %" PRIu64 " keyspace", cache_generate->dictfile, cache_generate->comp, cache_generate->percent, cache_generate->cnt2, cache_generate->cnt); } else { event_log_info (hashcat_ctx, "Generated dictionary stats for %s: %" PRIu64 " bytes, %" PRIu64 " words, %" PRIu64 " keyspace", cache_generate->dictfile, cache_generate->comp, cache_generate->cnt2, cache_generate->cnt); event_log_info (hashcat_ctx, ""); } }
static void main_calculated_words_base (MAYBE_UNUSED hashcat_ctx_t *hashcat_ctx, MAYBE_UNUSED const void *buf, MAYBE_UNUSED const size_t len) { const status_ctx_t *status_ctx = hashcat_ctx->status_ctx; const user_options_t *user_options = hashcat_ctx->user_options; if (user_options->keyspace == false) return; event_log_info (hashcat_ctx, "%" PRIu64 "", status_ctx->words_base); }
static void main_cracker_finished (MAYBE_UNUSED hashcat_ctx_t *hashcat_ctx, MAYBE_UNUSED const void *buf, MAYBE_UNUSED const size_t len) { const hashes_t *hashes = hashcat_ctx->hashes; const user_options_t *user_options = hashcat_ctx->user_options; const user_options_extra_t *user_options_extra = hashcat_ctx->user_options_extra; if (user_options->keyspace == true) return; if (user_options->opencl_info == true) return; if (user_options->stdout_flag == true) return; // if we had a prompt, clear it if ((user_options_extra->wordlist_mode == WL_MODE_FILE) || (user_options_extra->wordlist_mode == WL_MODE_MASK)) { if ((user_options->benchmark == false) && (user_options->speed_only == false)) { clear_prompt (); } } // print final status if ((user_options->benchmark == true) || (user_options->speed_only == true)) { status_benchmark (hashcat_ctx); if (user_options->machine_readable == false) { event_log_info (hashcat_ctx, ""); } } else { if (user_options->quiet == false) { if (hashes->digests_saved != hashes->digests_done) event_log_info (hashcat_ctx, ""); status_display (hashcat_ctx); event_log_info (hashcat_ctx, ""); } } }
static void main_potfile_num_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; const hashes_t *hashes = hashcat_ctx->hashes; if (user_options->quiet == true) return; const int potfile_remove_cracks = hashes->digests_done; if (potfile_remove_cracks > 0) { if (potfile_remove_cracks == 1) { event_log_info (hashcat_ctx, "INFO: Removed 1 hash found in potfile"); event_log_info (hashcat_ctx, ""); } else { event_log_info (hashcat_ctx, "INFO: Removed %d hashes found in potfile", potfile_remove_cracks); event_log_info (hashcat_ctx, ""); } } }
static void main_cracker_starting (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; const user_options_extra_t *user_options_extra = hashcat_ctx->user_options_extra; if (user_options->quiet == true) return; // Tell the user we're about to start if ((user_options_extra->wordlist_mode == WL_MODE_FILE) || (user_options_extra->wordlist_mode == WL_MODE_MASK)) { if ((user_options->quiet == false) && (user_options->benchmark == false) && (user_options->speed_only == false)) { event_log_info_nn (hashcat_ctx, ""); send_prompt (); } } else if (user_options_extra->wordlist_mode == WL_MODE_STDIN) { event_log_info (hashcat_ctx, "Starting attack in stdin mode..."); event_log_info (hashcat_ctx, ""); } }
void status_display (hashcat_ctx_t *hashcat_ctx) { const hashconfig_t *hashconfig = hashcat_ctx->hashconfig; const hwmon_ctx_t *hwmon_ctx = hashcat_ctx->hwmon_ctx; const user_options_t *user_options = hashcat_ctx->user_options; if (user_options->machine_readable == true) { status_display_machine_readable (hashcat_ctx); return; } hashcat_status_t *hashcat_status = (hashcat_status_t *) hcmalloc (sizeof (hashcat_status_t)); const int rc_status = hashcat_get_status (hashcat_ctx, hashcat_status); if (rc_status == -1) { hcfree (hashcat_status); return; } /** * show something */ event_log_info (hashcat_ctx, "Session..........: %s", hashcat_status->session); event_log_info (hashcat_ctx, "Status...........: %s", hashcat_status->status_string); event_log_info (hashcat_ctx, "Hash.Type........: %s", hashcat_status->hash_type); event_log_info (hashcat_ctx, "Hash.Target......: %s", hashcat_status->hash_target); event_log_info (hashcat_ctx, "Time.Started.....: %s (%s)", hashcat_status->time_started_absolute, hashcat_status->time_started_relative); event_log_info (hashcat_ctx, "Time.Estimated...: %s (%s)", hashcat_status->time_estimated_absolute, hashcat_status->time_estimated_relative); switch (hashcat_status->guess_mode) { case GUESS_MODE_STRAIGHT_FILE: event_log_info (hashcat_ctx, "Guess.Base.......: File (%s)", hashcat_status->guess_base); break; case GUESS_MODE_STRAIGHT_FILE_RULES_FILE: event_log_info (hashcat_ctx, "Guess.Base.......: File (%s)", hashcat_status->guess_base); event_log_info (hashcat_ctx, "Guess.Mod........: Rules (%s)", hashcat_status->guess_mod); break; case GUESS_MODE_STRAIGHT_FILE_RULES_GEN: event_log_info (hashcat_ctx, "Guess.Base.......: File (%s)", hashcat_status->guess_base); event_log_info (hashcat_ctx, "Guess.Mod........: Rules (Generated)"); break; case GUESS_MODE_STRAIGHT_STDIN: event_log_info (hashcat_ctx, "Guess.Base.......: Pipe"); break; case GUESS_MODE_STRAIGHT_STDIN_RULES_FILE: event_log_info (hashcat_ctx, "Guess.Base.......: Pipe"); event_log_info (hashcat_ctx, "Guess.Mod........: Rules (%s)", hashcat_status->guess_mod); break; case GUESS_MODE_STRAIGHT_STDIN_RULES_GEN: event_log_info (hashcat_ctx, "Guess.Base.......: Pipe"); event_log_info (hashcat_ctx, "Guess.Mod........: Rules (Generated)"); break; case GUESS_MODE_COMBINATOR_BASE_LEFT: event_log_info (hashcat_ctx, "Guess.Base.......: File (%s), Left Side", hashcat_status->guess_base); event_log_info (hashcat_ctx, "Guess.Mod........: File (%s), Right Side", hashcat_status->guess_mod); break; case GUESS_MODE_COMBINATOR_BASE_RIGHT: event_log_info (hashcat_ctx, "Guess.Base.......: File (%s), Right Side", hashcat_status->guess_base); event_log_info (hashcat_ctx, "Guess.Mod........: File (%s), Left Side", hashcat_status->guess_mod); break; case GUESS_MODE_MASK: event_log_info (hashcat_ctx, "Guess.Mask.......: %s [%d]", hashcat_status->guess_base, hashcat_status->guess_mask_length); break; case GUESS_MODE_MASK_CS: event_log_info (hashcat_ctx, "Guess.Mask.......: %s [%d]", hashcat_status->guess_base, hashcat_status->guess_mask_length); event_log_info (hashcat_ctx, "Guess.Charset....: %s ", hashcat_status->guess_charset); break; case GUESS_MODE_HYBRID1: event_log_info (hashcat_ctx, "Guess.Base.......: File (%s), Left Side", hashcat_status->guess_base); event_log_info (hashcat_ctx, "Guess.Mod........: Mask (%s) [%d], Right Side", hashcat_status->guess_mod, hashcat_status->guess_mask_length); break; case GUESS_MODE_HYBRID1_CS: event_log_info (hashcat_ctx, "Guess.Base.......: File (%s), Left Side", hashcat_status->guess_base); event_log_info (hashcat_ctx, "Guess.Mod........: Mask (%s) [%d], Right Side", hashcat_status->guess_mod, hashcat_status->guess_mask_length); event_log_info (hashcat_ctx, "Guess.Charset....: %s", hashcat_status->guess_charset); break; case GUESS_MODE_HYBRID2: if (hashconfig->opti_type & OPTI_TYPE_OPTIMIZED_KERNEL) { event_log_info (hashcat_ctx, "Guess.Base.......: Mask (%s) [%d], Left Side", hashcat_status->guess_base, hashcat_status->guess_mask_length); event_log_info (hashcat_ctx, "Guess.Mod........: File (%s), Right Side", hashcat_status->guess_mod); } else { event_log_info (hashcat_ctx, "Guess.Base.......: File (%s), Right Side", hashcat_status->guess_base); event_log_info (hashcat_ctx, "Guess.Mod........: Mask (%s) [%d], Left Side", hashcat_status->guess_mod, hashcat_status->guess_mask_length); } break; case GUESS_MODE_HYBRID2_CS: if (hashconfig->opti_type & OPTI_TYPE_OPTIMIZED_KERNEL) { event_log_info (hashcat_ctx, "Guess.Base.......: Mask (%s) [%d], Left Side", hashcat_status->guess_base, hashcat_status->guess_mask_length); event_log_info (hashcat_ctx, "Guess.Mod........: File (%s), Right Side", hashcat_status->guess_mod); event_log_info (hashcat_ctx, "Guess.Charset....: %s", hashcat_status->guess_charset); } else { event_log_info (hashcat_ctx, "Guess.Base.......: File (%s), Right Side", hashcat_status->guess_base); event_log_info (hashcat_ctx, "Guess.Mod........: Mask (%s) [%d], Left Side", hashcat_status->guess_mod, hashcat_status->guess_mask_length); event_log_info (hashcat_ctx, "Guess.Charset....: %s", hashcat_status->guess_charset); } break; } switch (hashcat_status->guess_mode) { case GUESS_MODE_STRAIGHT_FILE: event_log_info (hashcat_ctx, "Guess.Queue......: %d/%d (%.02f%%)", hashcat_status->guess_base_offset, hashcat_status->guess_base_count, hashcat_status->guess_base_percent); break; case GUESS_MODE_STRAIGHT_FILE_RULES_FILE: event_log_info (hashcat_ctx, "Guess.Queue......: %d/%d (%.02f%%)", hashcat_status->guess_base_offset, hashcat_status->guess_base_count, hashcat_status->guess_base_percent); break; case GUESS_MODE_STRAIGHT_FILE_RULES_GEN: event_log_info (hashcat_ctx, "Guess.Queue......: %d/%d (%.02f%%)", hashcat_status->guess_base_offset, hashcat_status->guess_base_count, hashcat_status->guess_base_percent); break; case GUESS_MODE_MASK: event_log_info (hashcat_ctx, "Guess.Queue......: %d/%d (%.02f%%)", hashcat_status->guess_base_offset, hashcat_status->guess_base_count, hashcat_status->guess_base_percent); break; case GUESS_MODE_MASK_CS: event_log_info (hashcat_ctx, "Guess.Queue......: %d/%d (%.02f%%)", hashcat_status->guess_base_offset, hashcat_status->guess_base_count, hashcat_status->guess_base_percent); break; case GUESS_MODE_HYBRID1: event_log_info (hashcat_ctx, "Guess.Queue.Base.: %d/%d (%.02f%%)", hashcat_status->guess_base_offset, hashcat_status->guess_base_count, hashcat_status->guess_base_percent); event_log_info (hashcat_ctx, "Guess.Queue.Mod..: %d/%d (%.02f%%)", hashcat_status->guess_mod_offset, hashcat_status->guess_mod_count, hashcat_status->guess_mod_percent); break; case GUESS_MODE_HYBRID2: event_log_info (hashcat_ctx, "Guess.Queue.Base.: %d/%d (%.02f%%)", hashcat_status->guess_base_offset, hashcat_status->guess_base_count, hashcat_status->guess_base_percent); event_log_info (hashcat_ctx, "Guess.Queue.Mod..: %d/%d (%.02f%%)", hashcat_status->guess_mod_offset, hashcat_status->guess_mod_count, hashcat_status->guess_mod_percent); break; } for (int device_id = 0; device_id < hashcat_status->device_info_cnt; device_id++) { const device_info_t *device_info = hashcat_status->device_info_buf + device_id; if (device_info->skipped_dev == true) continue; event_log_info (hashcat_ctx, "Speed.#%d.........: %9sH/s (%0.2fms) @ Accel:%d Loops:%d Thr:%d Vec:%d", device_id + 1, device_info->speed_sec_dev, device_info->exec_msec_dev, device_info->kernel_accel_dev, device_info->kernel_loops_dev, device_info->kernel_threads_dev, device_info->vector_width_dev); } if (hashcat_status->device_info_active > 1) { event_log_info (hashcat_ctx, "Speed.#*.........: %9sH/s", hashcat_status->speed_sec_all); } event_log_info (hashcat_ctx, "Recovered........: %d/%d (%.2f%%) Digests, %d/%d (%.2f%%) Salts", hashcat_status->digests_done, hashcat_status->digests_cnt, hashcat_status->digests_percent, hashcat_status->salts_done, hashcat_status->salts_cnt, hashcat_status->salts_percent); if (hashcat_status->digests_cnt > 1000) { event_log_info (hashcat_ctx, "Recovered/Time...: %s", hashcat_status->cpt); } switch (hashcat_status->progress_mode) { case PROGRESS_MODE_KEYSPACE_KNOWN: event_log_info (hashcat_ctx, "Progress.........: %" PRIu64 "/%" PRIu64 " (%.02f%%)", hashcat_status->progress_cur_relative_skip, hashcat_status->progress_end_relative_skip, hashcat_status->progress_finished_percent); event_log_info (hashcat_ctx, "Rejected.........: %" PRIu64 "/%" PRIu64 " (%.02f%%)", hashcat_status->progress_rejected, hashcat_status->progress_cur_relative_skip, hashcat_status->progress_rejected_percent); break; case PROGRESS_MODE_KEYSPACE_UNKNOWN: event_log_info (hashcat_ctx, "Progress.........: %" PRIu64, hashcat_status->progress_cur_relative_skip); event_log_info (hashcat_ctx, "Rejected.........: %" PRIu64, hashcat_status->progress_rejected); break; } switch (hashcat_status->progress_mode) { case PROGRESS_MODE_KEYSPACE_KNOWN: event_log_info (hashcat_ctx, "Restore.Point....: %" PRIu64 "/%" PRIu64 " (%.02f%%)", hashcat_status->restore_point, hashcat_status->restore_total, hashcat_status->restore_percent); break; case PROGRESS_MODE_KEYSPACE_UNKNOWN: event_log_info (hashcat_ctx, "Restore.Point....: %" PRIu64, hashcat_status->restore_point); break; } for (int device_id = 0; device_id < hashcat_status->device_info_cnt; device_id++) { const device_info_t *device_info = hashcat_status->device_info_buf + device_id; if (device_info->skipped_dev == true) continue; event_log_info (hashcat_ctx, "Restore.Sub.#%d...: Salt:%d Amplifier:%d-%d Iteration:%d-%d", device_id + 1, device_info->salt_pos_dev, device_info->innerloop_pos_dev, device_info->innerloop_pos_dev + device_info->innerloop_left_dev, device_info->iteration_pos_dev, device_info->iteration_pos_dev + device_info->iteration_left_dev); } for (int device_id = 0; device_id < hashcat_status->device_info_cnt; device_id++) { const device_info_t *device_info = hashcat_status->device_info_buf + device_id; if (device_info->skipped_dev == true) continue; if (device_info->guess_candidates_dev == NULL) continue; event_log_info (hashcat_ctx, "Candidates.#%d....: %s", device_id + 1, device_info->guess_candidates_dev); } if (hwmon_ctx->enabled == true) { for (int device_id = 0; device_id < hashcat_status->device_info_cnt; device_id++) { const device_info_t *device_info = hashcat_status->device_info_buf + device_id; if (device_info->skipped_dev == true) continue; if (device_info->hwmon_dev == NULL) continue; event_log_info (hashcat_ctx, "Hardware.Mon.#%d..: %s", device_id + 1, device_info->hwmon_dev); } } status_status_destroy (hashcat_ctx, hashcat_status); hcfree (hashcat_status); }
static void keypress (hashcat_ctx_t *hashcat_ctx) { status_ctx_t *status_ctx = hashcat_ctx->status_ctx; user_options_t *user_options = hashcat_ctx->user_options; // this is required, because some of the variables down there are not initialized at that point while (status_ctx->devices_status == STATUS_INIT) usleep (100000); const bool quiet = user_options->quiet; tty_break (); while (status_ctx->shutdown_outer == false) { int ch = tty_getchar (); if (ch == -1) break; if (ch == 0) continue; //https://github.com/hashcat/hashcat/issues/302 //#if defined (_POSIX) //if (ch != '\n') //#endif hc_thread_mutex_lock (status_ctx->mux_display); event_log_info (hashcat_ctx, NULL); switch (ch) { case 's': case '\r': case '\n': event_log_info (hashcat_ctx, NULL); status_display (hashcat_ctx); event_log_info (hashcat_ctx, NULL); if (quiet == false) send_prompt (hashcat_ctx); break; case 'b': event_log_info (hashcat_ctx, NULL); bypass (hashcat_ctx); event_log_info (hashcat_ctx, "Next dictionary / mask in queue selected. Bypassing current one."); event_log_info (hashcat_ctx, NULL); if (quiet == false) send_prompt (hashcat_ctx); break; case 'p': if (status_ctx->devices_status != STATUS_PAUSED) { event_log_info (hashcat_ctx, NULL); SuspendThreads (hashcat_ctx); if (status_ctx->devices_status == STATUS_PAUSED) { event_log_info (hashcat_ctx, "Paused"); } event_log_info (hashcat_ctx, NULL); } if (quiet == false) send_prompt (hashcat_ctx); break; case 'r': if (status_ctx->devices_status == STATUS_PAUSED) { event_log_info (hashcat_ctx, NULL); ResumeThreads (hashcat_ctx); if (status_ctx->devices_status != STATUS_PAUSED) { event_log_info (hashcat_ctx, "Resumed"); } event_log_info (hashcat_ctx, NULL); } if (quiet == false) send_prompt (hashcat_ctx); break; case 'c': event_log_info (hashcat_ctx, NULL); stop_at_checkpoint (hashcat_ctx); if (status_ctx->checkpoint_shutdown == true) { event_log_info (hashcat_ctx, "Checkpoint enabled. Will quit at next restore-point update."); } else { event_log_info (hashcat_ctx, "Checkpoint disabled. Restore-point updates will no longer be monitored."); } event_log_info (hashcat_ctx, NULL); if (quiet == false) send_prompt (hashcat_ctx); break; case 'q': event_log_info (hashcat_ctx, NULL); myquit (hashcat_ctx); break; default: if (quiet == false) send_prompt (hashcat_ctx); break; } //https://github.com/hashcat/hashcat/issues/302 //#if defined (_POSIX) //if (ch != '\n') //#endif hc_thread_mutex_unlock (status_ctx->mux_display); } tty_fix (); }
void welcome_screen (hashcat_ctx_t *hashcat_ctx, const char *version_tag) { const user_options_t *user_options = hashcat_ctx->user_options; if (user_options->quiet == true) return; if (user_options->keyspace == true) return; if (user_options->stdout_flag == true) return; if (user_options->show == true) return; if (user_options->left == true) return; if (user_options->benchmark == true) { if (user_options->machine_readable == false) { event_log_info (hashcat_ctx, "%s (%s) starting in benchmark mode...", PROGNAME, version_tag); event_log_info (hashcat_ctx, NULL); if (user_options->workload_profile_chgd == false) { event_log_advice (hashcat_ctx, "Benchmarking uses hand-optimized kernel code by default."); event_log_advice (hashcat_ctx, "You can use it in your cracking session by setting the -O option."); event_log_advice (hashcat_ctx, "Note: Using optimized kernel code limits the maximum supported password length."); event_log_advice (hashcat_ctx, "To disable the optimized kernel code in benchmark mode, use the -w option."); event_log_advice (hashcat_ctx, NULL); } } else { event_log_info (hashcat_ctx, "# version: %s", version_tag); } } else if (user_options->restore == true) { event_log_info (hashcat_ctx, "%s (%s) starting in restore mode...", PROGNAME, version_tag); event_log_info (hashcat_ctx, NULL); } else if (user_options->speed_only == true) { event_log_info (hashcat_ctx, "%s (%s) starting in speed-only mode...", PROGNAME, version_tag); event_log_info (hashcat_ctx, NULL); } else if (user_options->progress_only == true) { event_log_info (hashcat_ctx, "%s (%s) starting in progress-only mode...", PROGNAME, version_tag); event_log_info (hashcat_ctx, NULL); } else { event_log_info (hashcat_ctx, "%s (%s) starting...", PROGNAME, version_tag); event_log_info (hashcat_ctx, NULL); } }
void example_hashes (hashcat_ctx_t *hashcat_ctx) { user_options_t *user_options = hashcat_ctx->user_options; if (user_options->hash_mode_chgd == true) { const int rc = hashconfig_init (hashcat_ctx); if (rc == 0) { hashconfig_t *hashconfig = hashcat_ctx->hashconfig; event_log_info (hashcat_ctx, "MODE: %u", hashconfig->hash_mode); event_log_info (hashcat_ctx, "TYPE: %s", strhashtype (hashconfig->hash_mode)); if ((hashconfig->st_hash != NULL) && (hashconfig->st_pass != NULL)) { event_log_info (hashcat_ctx, "HASH: %s", hashconfig->st_hash); if (need_hexify ((const u8 *) hashconfig->st_pass, strlen (hashconfig->st_pass), user_options->separator, 0)) { char tmp_buf[HCBUFSIZ_LARGE]; int tmp_len = 0; tmp_buf[tmp_len++] = '$'; tmp_buf[tmp_len++] = 'H'; tmp_buf[tmp_len++] = 'E'; tmp_buf[tmp_len++] = 'X'; tmp_buf[tmp_len++] = '['; exec_hexify ((const u8 *) hashconfig->st_pass, strlen (hashconfig->st_pass), (u8 *) tmp_buf + tmp_len); tmp_len += strlen (hashconfig->st_pass) * 2; tmp_buf[tmp_len++] = ']'; tmp_buf[tmp_len++] = 0; event_log_info (hashcat_ctx, "PASS: %s", tmp_buf); } else { event_log_info (hashcat_ctx, "PASS: %s", hashconfig->st_pass); } } else { event_log_info (hashcat_ctx, "HASH: not stored"); event_log_info (hashcat_ctx, "PASS: not stored"); } event_log_info (hashcat_ctx, NULL); } hashconfig_destroy (hashcat_ctx); } else { for (int i = 0; i < 100000; i++) { user_options->hash_mode = i; const int rc = hashconfig_init (hashcat_ctx); if (rc == 0) { hashconfig_t *hashconfig = hashcat_ctx->hashconfig; event_log_info (hashcat_ctx, "MODE: %u", hashconfig->hash_mode); event_log_info (hashcat_ctx, "TYPE: %s", strhashtype (hashconfig->hash_mode)); if ((hashconfig->st_hash != NULL) && (hashconfig->st_pass != NULL)) { event_log_info (hashcat_ctx, "HASH: %s", hashconfig->st_hash); if (need_hexify ((const u8 *) hashconfig->st_pass, strlen (hashconfig->st_pass), user_options->separator, 0)) { char tmp_buf[HCBUFSIZ_LARGE]; int tmp_len = 0; tmp_buf[tmp_len++] = '$'; tmp_buf[tmp_len++] = 'H'; tmp_buf[tmp_len++] = 'E'; tmp_buf[tmp_len++] = 'X'; tmp_buf[tmp_len++] = '['; exec_hexify ((const u8 *) hashconfig->st_pass, strlen (hashconfig->st_pass), (u8 *) tmp_buf + tmp_len); tmp_len += strlen (hashconfig->st_pass) * 2; tmp_buf[tmp_len++] = ']'; tmp_buf[tmp_len++] = 0; event_log_info (hashcat_ctx, "PASS: %s", tmp_buf); } else { event_log_info (hashcat_ctx, "PASS: %s", hashconfig->st_pass); } } else { event_log_info (hashcat_ctx, "HASH: not stored"); event_log_info (hashcat_ctx, "PASS: not stored"); } event_log_info (hashcat_ctx, NULL); } hashconfig_destroy (hashcat_ctx); } } }
static void main_outerloop_mainscreen (MAYBE_UNUSED hashcat_ctx_t *hashcat_ctx, MAYBE_UNUSED const void *buf, MAYBE_UNUSED const size_t len) { const bitmap_ctx_t *bitmap_ctx = hashcat_ctx->bitmap_ctx; const hashconfig_t *hashconfig = hashcat_ctx->hashconfig; const hashes_t *hashes = hashcat_ctx->hashes; const hwmon_ctx_t *hwmon_ctx = hashcat_ctx->hwmon_ctx; const straight_ctx_t *straight_ctx = hashcat_ctx->straight_ctx; const user_options_t *user_options = hashcat_ctx->user_options; /** * In benchmark-mode, inform user which algorithm is checked */ if (user_options->benchmark == true) { if (user_options->machine_readable == false) { char *hash_type = strhashtype (hashconfig->hash_mode); // not a bug event_log_info (hashcat_ctx, "Hashtype: %s", hash_type); event_log_info (hashcat_ctx, ""); } } if (user_options->quiet == true) return; event_log_info (hashcat_ctx, "Hashes: %u digests; %u unique digests, %u unique salts", hashes->hashes_cnt_orig, hashes->digests_cnt, hashes->salts_cnt); event_log_info (hashcat_ctx, "Bitmaps: %u bits, %u entries, 0x%08x mask, %u bytes, %u/%u rotates", bitmap_ctx->bitmap_bits, bitmap_ctx->bitmap_nums, bitmap_ctx->bitmap_mask, bitmap_ctx->bitmap_size, bitmap_ctx->bitmap_shift1, bitmap_ctx->bitmap_shift2); if (user_options->attack_mode == ATTACK_MODE_STRAIGHT) { event_log_info (hashcat_ctx, "Rules: %u", straight_ctx->kernel_rules_cnt); } if (user_options->quiet == false) event_log_info (hashcat_ctx, ""); if (hashconfig->opti_type) { event_log_info (hashcat_ctx, "Applicable Optimizers:"); for (u32 i = 0; i < 32; i++) { const u32 opti_bit = 1u << i; if (hashconfig->opti_type & opti_bit) event_log_info (hashcat_ctx, "* %s", stroptitype (opti_bit)); } } event_log_info (hashcat_ctx, ""); /** * Watchdog and Temperature balance */ if (hwmon_ctx->enabled == false && user_options->gpu_temp_disable == false) { event_log_info (hashcat_ctx, "Watchdog: Hardware Monitoring Interface not found on your system"); } if (hwmon_ctx->enabled == true && user_options->gpu_temp_abort > 0) { event_log_info (hashcat_ctx, "Watchdog: Temperature abort trigger set to %uc", user_options->gpu_temp_abort); } else { event_log_info (hashcat_ctx, "Watchdog: Temperature abort trigger disabled"); } if (hwmon_ctx->enabled == true && user_options->gpu_temp_retain > 0) { event_log_info (hashcat_ctx, "Watchdog: Temperature retain trigger set to %uc", user_options->gpu_temp_retain); } else { event_log_info (hashcat_ctx, "Watchdog: Temperature retain trigger disabled"); } event_log_info (hashcat_ctx, ""); #if defined (DEBUG) if (user_options->benchmark == true) event_log_info (hashcat_ctx, "Hashmode: %d", hashconfig->hash_mode); #endif }
void opencl_info (hashcat_ctx_t *hashcat_ctx) { const opencl_ctx_t *opencl_ctx = hashcat_ctx->opencl_ctx; event_log_info (hashcat_ctx, "OpenCL Info:"); event_log_info (hashcat_ctx, NULL); cl_uint platforms_cnt = opencl_ctx->platforms_cnt; cl_platform_id *platforms = opencl_ctx->platforms; char **platforms_vendor = opencl_ctx->platforms_vendor; char **platforms_name = opencl_ctx->platforms_name; char **platforms_version = opencl_ctx->platforms_version; cl_uint devices_cnt = opencl_ctx->devices_cnt; for (cl_uint platforms_idx = 0; platforms_idx < platforms_cnt; platforms_idx++) { cl_platform_id platform_id = platforms[platforms_idx]; char *platform_vendor = platforms_vendor[platforms_idx]; char *platform_name = platforms_name[platforms_idx]; char *platform_version = platforms_version[platforms_idx]; event_log_info (hashcat_ctx, "Platform ID #%u", platforms_idx + 1); event_log_info (hashcat_ctx, " Vendor : %s", platform_vendor); event_log_info (hashcat_ctx, " Name : %s", platform_name); event_log_info (hashcat_ctx, " Version : %s", platform_version); event_log_info (hashcat_ctx, NULL); for (cl_uint devices_idx = 0; devices_idx < devices_cnt; devices_idx++) { const hc_device_param_t *device_param = opencl_ctx->devices_param + devices_idx; if (device_param->platform != platform_id) continue; cl_device_type device_type = device_param->device_type; cl_uint device_vendor_id = device_param->device_vendor_id; char *device_vendor = device_param->device_vendor; char *device_name = device_param->device_name; u32 device_processors = device_param->device_processors; u32 device_maxclock_frequency = device_param->device_maxclock_frequency; u64 device_maxmem_alloc = device_param->device_maxmem_alloc; u64 device_global_mem = device_param->device_global_mem; char *device_opencl_version = device_param->device_opencl_version; char *device_version = device_param->device_version; char *driver_version = device_param->driver_version; event_log_info (hashcat_ctx, " Device ID #%u", devices_idx + 1); event_log_info (hashcat_ctx, " Type : %s", ((device_type & CL_DEVICE_TYPE_CPU) ? "CPU" : ((device_type & CL_DEVICE_TYPE_GPU) ? "GPU" : "Accelerator"))); event_log_info (hashcat_ctx, " Vendor ID : %u", device_vendor_id); event_log_info (hashcat_ctx, " Vendor : %s", device_vendor); event_log_info (hashcat_ctx, " Name : %s", device_name); event_log_info (hashcat_ctx, " Version : %s", device_version); event_log_info (hashcat_ctx, " Processor(s) : %u", device_processors); event_log_info (hashcat_ctx, " Clock : %u", device_maxclock_frequency); event_log_info (hashcat_ctx, " Memory : %" PRIu64 "/%" PRIu64 " MB allocatable", device_maxmem_alloc / 1024 / 1024, device_global_mem / 1024 / 1024); event_log_info (hashcat_ctx, " OpenCL Version : %s", device_opencl_version); event_log_info (hashcat_ctx, " Driver Version : %s", driver_version); event_log_info (hashcat_ctx, NULL); } } }
void opencl_info_compact (hashcat_ctx_t *hashcat_ctx) { const opencl_ctx_t *opencl_ctx = hashcat_ctx->opencl_ctx; const user_options_t *user_options = hashcat_ctx->user_options; if (user_options->quiet == true) return; if (user_options->machine_readable == true) return; cl_uint platforms_cnt = opencl_ctx->platforms_cnt; cl_platform_id *platforms = opencl_ctx->platforms; char **platforms_vendor = opencl_ctx->platforms_vendor; bool *platforms_skipped = opencl_ctx->platforms_skipped; cl_uint devices_cnt = opencl_ctx->devices_cnt; for (cl_uint platforms_idx = 0; platforms_idx < platforms_cnt; platforms_idx++) { cl_platform_id platform_id = platforms[platforms_idx]; char *platform_vendor = platforms_vendor[platforms_idx]; bool platform_skipped = platforms_skipped[platforms_idx]; if (platform_skipped == false) { const size_t len = event_log_info (hashcat_ctx, "OpenCL Platform #%u: %s", platforms_idx + 1, platform_vendor); char line[HCBUFSIZ_TINY]; memset (line, '=', len); line[len] = 0; event_log_info (hashcat_ctx, "%s", line); } else { event_log_info (hashcat_ctx, "OpenCL Platform #%u: %s, skipped or no OpenCL compatible devices found.", platforms_idx + 1, platform_vendor); } for (cl_uint devices_idx = 0; devices_idx < devices_cnt; devices_idx++) { const hc_device_param_t *device_param = opencl_ctx->devices_param + devices_idx; if (device_param->platform != platform_id) continue; char *device_name = device_param->device_name; u32 device_processors = device_param->device_processors; u64 device_maxmem_alloc = device_param->device_maxmem_alloc; u64 device_global_mem = device_param->device_global_mem; if (device_param->skipped == false) { event_log_info (hashcat_ctx, "* Device #%u: %s, %" PRIu64 "/%" PRIu64 " MB allocatable, %uMCU", devices_idx + 1, device_name, device_maxmem_alloc / 1024 / 1024, device_global_mem / 1024 / 1024, device_processors); } else { event_log_info (hashcat_ctx, "* Device #%u: %s, skipped.", devices_idx + 1, device_name); } } event_log_info (hashcat_ctx, NULL); } }