From 191269f4f0c19ee5109acb2f3bf2b5a460a22020 Mon Sep 17 00:00:00 2001 From: jsteube Date: Fri, 14 Oct 2016 21:38:52 +0200 Subject: [PATCH] Add --speed-only mode --- include/types.h | 171 +++++++++++++++---------------- include/user_options.h | 68 +++++++------ src/debugfile.c | 1 + src/dispatch.c | 13 +-- src/hashcat.c | 13 +-- src/induct.c | 1 + src/loopback.c | 1 + src/main.c | 6 +- src/monitor.c | 4 +- src/opencl.c | 14 +-- src/outfile_check.c | 1 + src/potfile.c | 1 + src/restore.c | 1 + src/status.c | 12 +-- src/terminal.c | 9 +- src/usage.c | 1 + src/user_options.c | 226 +++++++++++++++++++++-------------------- 17 files changed, 284 insertions(+), 259 deletions(-) diff --git a/include/types.h b/include/types.h index 739a88f27..24f4fdef4 100644 --- a/include/types.h +++ b/include/types.h @@ -1082,87 +1082,10 @@ typedef struct wl_data typedef struct user_options { - bool usage; - bool version; - bool quiet; - bool benchmark; - bool stdout_flag; - bool show; - bool left; - bool username; - bool remove; - u32 remove_timer; - u64 skip; - u64 limit; - bool force; - bool keyspace; - bool potfile_disable; - char *potfile_path; - u32 debug_mode; - char *debug_file; - char *induction_dir; - char *outfile_check_dir; - u32 runtime; - u32 hash_mode; - u32 attack_mode; - char *outfile; - u32 outfile_format; - bool outfile_autohex; - u32 outfile_check_timer; - bool restore; - u32 restore_timer; - bool restore_disable; - bool status; - u32 status_timer; - bool machine_readable; - bool loopback; - u32 weak_hash_threshold; - char *session; - bool hex_charset; - bool hex_salt; - bool hex_wordlist; - u32 rp_gen; - u32 rp_gen_func_min; - u32 rp_gen_func_max; - u32 rp_gen_seed; - char *rule_buf_l; - char *rule_buf_r; - bool increment; - u32 increment_min; - u32 increment_max; - char *cpu_affinity; - bool opencl_info; - char *opencl_devices; - char *opencl_platforms; - char *opencl_device_types; - u32 opencl_vector_width; - char *truecrypt_keyfiles; - char *veracrypt_keyfiles; - u32 veracrypt_pim; - u32 workload_profile; - u32 kernel_accel; - u32 kernel_loops; - u32 nvidia_spin_damp; - bool gpu_temp_disable; - u32 gpu_temp_abort; - u32 gpu_temp_retain; - bool powertune_enable; - bool logfile_disable; - u32 segment_size; - u32 scrypt_tmto; - char separator; - u32 bitmap_min; - u32 bitmap_max; - bool markov_disable; - bool markov_classic; - u32 markov_threshold; - char *markov_hcstat; - char *custom_charset_1; - char *custom_charset_2; - char *custom_charset_3; - char *custom_charset_4; - u32 rp_files_cnt; - char **rp_files; + char *hc_bin; + + int hc_argc; + char **hc_argv; bool attack_mode_chgd; bool hash_mode_chgd; @@ -1179,10 +1102,88 @@ typedef struct user_options bool workload_profile_chgd; bool segment_size_chgd; - char *hc_bin; - - int hc_argc; - char **hc_argv; + bool benchmark; + bool force; + bool gpu_temp_disable; + bool hex_charset; + bool hex_salt; + bool hex_wordlist; + bool increment; + bool keyspace; + bool left; + bool logfile_disable; + bool loopback; + bool machine_readable; + bool markov_classic; + bool markov_disable; + bool opencl_info; + bool outfile_autohex; + bool potfile_disable; + bool powertune_enable; + bool quiet; + bool remove; + bool restore; + bool restore_disable; + bool show; + bool status; + bool stdout_flag; + bool speed_only; + bool usage; + bool username; + bool version; + char *cpu_affinity; + char *custom_charset_1; + char *custom_charset_2; + char *custom_charset_3; + char *custom_charset_4; + char *debug_file; + char *induction_dir; + char *markov_hcstat; + char *opencl_devices; + char *opencl_device_types; + char *opencl_platforms; + char *outfile; + char *outfile_check_dir; + char *potfile_path; + char **rp_files; + char *rule_buf_l; + char *rule_buf_r; + char separator; + char *session; + char *truecrypt_keyfiles; + char *veracrypt_keyfiles; + u32 attack_mode; + u32 bitmap_max; + u32 bitmap_min; + u32 debug_mode; + u32 gpu_temp_abort; + u32 gpu_temp_retain; + u32 hash_mode; + u32 increment_max; + u32 increment_min; + u32 kernel_accel; + u32 kernel_loops; + u32 markov_threshold; + u32 nvidia_spin_damp; + u32 opencl_vector_width; + u32 outfile_check_timer; + u32 outfile_format; + u32 remove_timer; + u32 restore_timer; + u32 rp_files_cnt; + u32 rp_gen; + u32 rp_gen_func_max; + u32 rp_gen_func_min; + u32 rp_gen_seed; + u32 runtime; + u32 scrypt_tmto; + u32 segment_size; + u32 status_timer; + u32 veracrypt_pim; + u32 weak_hash_threshold; + u32 workload_profile; + u64 limit; + u64 skip; } user_options_t; diff --git a/include/user_options.h b/include/user_options.h index 81271cd48..ba5fd8719 100644 --- a/include/user_options.h +++ b/include/user_options.h @@ -10,45 +10,45 @@ typedef enum user_options_defaults { - ATTACK_MODE = 0, - BENCHMARK = 0, + ATTACK_MODE = ATTACK_MODE_STRAIGHT, + BENCHMARK = false, BITMAP_MAX = 24, BITMAP_MIN = 16, DEBUG_MODE = 0, - FORCE = 0, + FORCE = false, GPU_TEMP_ABORT = 90, - GPU_TEMP_DISABLE = 0, + GPU_TEMP_DISABLE = false, GPU_TEMP_RETAIN = 75, HASH_MODE = 0, - HEX_CHARSET = 0, - HEX_SALT = 0, - HEX_WORDLIST = 0, - INCREMENT = 0, + HEX_CHARSET = false, + HEX_SALT = false, + HEX_WORDLIST = false, + INCREMENT = false, INCREMENT_MAX = PW_MAX, INCREMENT_MIN = 1, KERNEL_ACCEL = 0, KERNEL_LOOPS = 0, - KEYSPACE = 0, - LEFT = 0, + KEYSPACE = false, + LEFT = false, LIMIT = 0, - LOGFILE_DISABLE = 0, - LOOPBACK = 0, - MACHINE_READABLE = 0, - MARKOV_CLASSIC = 0, - MARKOV_DISABLE = 0, + LOGFILE_DISABLE = false, + LOOPBACK = false, + MACHINE_READABLE = false, + MARKOV_CLASSIC = false, + MARKOV_DISABLE = false, MARKOV_THRESHOLD = 0, NVIDIA_SPIN_DAMP = 100, OPENCL_VECTOR_WIDTH = 0, - OUTFILE_AUTOHEX = 1, + OUTFILE_AUTOHEX = true, OUTFILE_CHECK_TIMER = 5, OUTFILE_FORMAT = 3, - POTFILE_DISABLE = 0, - POWERTUNE_ENABLE = 0, - QUIET = 0, - REMOVE = 0, + POTFILE_DISABLE = false, + POWERTUNE_ENABLE = false, + QUIET = false, + REMOVE = false, REMOVE_TIMER = 60, - RESTORE = 0, - RESTORE_DISABLE = 0, + RESTORE = false, + RESTORE_DISABLE = false, RESTORE_TIMER = 60, RP_GEN = 0, RP_GEN_FUNC_MAX = 4, @@ -58,14 +58,15 @@ typedef enum user_options_defaults SCRYPT_TMTO = 0, SEGMENT_SIZE = 33554432, SEPARATOR = ':', - SHOW = 0, + SHOW = false, SKIP = 0, - STATUS = 0, + STATUS = false, STATUS_TIMER = 10, - STDOUT_FLAG = 0, - USAGE = 0, - USERNAME = 0, - VERSION = 0, + STDOUT_FLAG = false, + SPEED_ONLY = false, + USAGE = false, + USERNAME = false, + VERSION = false, WEAK_HASH_THRESHOLD = 100, WORKLOAD_PROFILE = 2, @@ -145,13 +146,14 @@ typedef enum user_options_map IDX_STATUS = 0xff2d, IDX_STATUS_TIMER = 0xff2e, IDX_STDOUT_FLAG = 0xff2f, - IDX_TRUECRYPT_KEYFILES = 0xff30, - IDX_USERNAME = 0xff31, - IDX_VERACRYPT_KEYFILES = 0xff32, - IDX_VERACRYPT_PIM = 0xff33, + IDX_SPEED_ONLY = 0xff30, + IDX_TRUECRYPT_KEYFILES = 0xff31, + IDX_USERNAME = 0xff32, + IDX_VERACRYPT_KEYFILES = 0xff33, + IDX_VERACRYPT_PIM = 0xff34, IDX_VERSION_LOWER = 'v', IDX_VERSION = 'V', - IDX_WEAK_HASH_THRESHOLD = 0xff34, + IDX_WEAK_HASH_THRESHOLD = 0xff35, IDX_WORKLOAD_PROFILE = 'w' } user_options_map_t; diff --git a/src/debugfile.c b/src/debugfile.c index 70614da0a..9e8c0941a 100644 --- a/src/debugfile.c +++ b/src/debugfile.c @@ -91,6 +91,7 @@ int debugfile_init (hashcat_ctx_t *hashcat_ctx) if (user_options->opencl_info == true) return 0; if (user_options->show == true) return 0; if (user_options->stdout_flag == true) return 0; + if (user_options->speed_only == true) return 0; if (user_options->usage == true) return 0; if (user_options->version == true) return 0; if (user_options->debug_mode == 0) return 0; diff --git a/src/dispatch.c b/src/dispatch.c index bb39cd8d0..e50a4a675 100644 --- a/src/dispatch.c +++ b/src/dispatch.c @@ -218,6 +218,10 @@ static int calc_stdin (hashcat_ctx_t *hashcat_ctx, hc_device_param_t *device_par } */ } + + if (status_ctx->run_thread_level1 == false) break; + + if (user_options->speed_only == true) break; } device_param->kernel_accel = 0; @@ -282,16 +286,11 @@ static int calc (hashcat_ctx_t *hashcat_ctx, hc_device_param_t *device_param) run_cracker (hashcat_ctx, device_param, pws_cnt); device_param->pws_cnt = 0; - - /* - still required? - run_kernel_bzero (device_param, device_param->d_bfs_c, device_param->size_bfs); - */ } if (status_ctx->run_thread_level1 == false) break; - if (user_options->benchmark == true) break; + if (user_options->speed_only == true) break; device_param->words_done = words_fin; } @@ -524,6 +523,8 @@ static int calc (hashcat_ctx_t *hashcat_ctx, hc_device_param_t *device_param) */ } + if (user_options->speed_only == true) break; + if (status_ctx->run_thread_level1 == false) break; if (words_fin == 0) break; diff --git a/src/hashcat.c b/src/hashcat.c index 94777ff1b..630bc5014 100644 --- a/src/hashcat.c +++ b/src/hashcat.c @@ -716,7 +716,7 @@ static int outer_loop (hashcat_ctx_t *hashcat_ctx) * Outfile remove */ - if (user_options->keyspace == false && user_options->benchmark == false && user_options->stdout_flag == false) + if (user_options->keyspace == false && user_options->benchmark == false && user_options->stdout_flag == false && user_options->speed_only == false) { hc_thread_create (inner_threads[inner_threads_cnt], thread_monitor, hashcat_ctx); @@ -1030,21 +1030,22 @@ int hashcat (hashcat_ctx_t *hashcat_ctx, char *install_folder, char *shared_fold if (status_ctx->run_main_level1 == false) break; } } + + user_options->quiet = false; } else { + if (user_options->speed_only == true) user_options->quiet = true; + rc_final = outer_loop (hashcat_ctx); if (rc_final == -1) myabort (hashcat_ctx); + + if (user_options->speed_only == true) user_options->quiet = false; } EVENT (EVENT_OUTERLOOP_FINISHED); - if (user_options->benchmark == true) - { - user_options->quiet = false; - } - // if exhausted or cracked, unlink the restore file unlink_restore (hashcat_ctx); diff --git a/src/induct.c b/src/induct.c index 441a71bf5..757157419 100644 --- a/src/induct.c +++ b/src/induct.c @@ -36,6 +36,7 @@ int induct_ctx_init (hashcat_ctx_t *hashcat_ctx) if (user_options->opencl_info == true) return 0; if (user_options->show == true) return 0; if (user_options->stdout_flag == true) return 0; + if (user_options->speed_only == true) return 0; if (user_options->usage == true) return 0; if (user_options->version == true) return 0; diff --git a/src/loopback.c b/src/loopback.c index f26d7ddbf..973bcf8ca 100644 --- a/src/loopback.c +++ b/src/loopback.c @@ -65,6 +65,7 @@ int loopback_init (hashcat_ctx_t *hashcat_ctx) if (user_options->opencl_info == true) return 0; if (user_options->show == true) return 0; if (user_options->stdout_flag == true) return 0; + if (user_options->speed_only == true) return 0; if (user_options->usage == true) return 0; if (user_options->version == true) return 0; diff --git a/src/main.c b/src/main.c index 3488d3f51..71eb036db 100644 --- a/src/main.c +++ b/src/main.c @@ -135,7 +135,7 @@ static void main_outerloop_starting (MAYBE_UNUSED hashcat_ctx_t *hashcat_ctx, MA status_ctx->shutdown_outer = false; - if (user_options->keyspace == false && user_options->benchmark == false && user_options->stdout_flag == false && user_options->opencl_info == false) + if (user_options->keyspace == false && user_options->benchmark == false && user_options->stdout_flag == false && user_options->opencl_info == false && user_options->speed_only == false) { if ((user_options_extra->wordlist_mode == WL_MODE_FILE) || (user_options_extra->wordlist_mode == WL_MODE_MASK)) { @@ -178,7 +178,7 @@ static void main_cracker_starting (MAYBE_UNUSED hashcat_ctx_t *hashcat_ctx, MAYB if ((user_options_extra->wordlist_mode == WL_MODE_FILE) || (user_options_extra->wordlist_mode == WL_MODE_MASK)) { - if ((user_options->quiet == false) && (user_options->status == false) && (user_options->benchmark == false)) + if ((user_options->quiet == false) && (user_options->benchmark == false) && (user_options->speed_only == false)) { event_log_info_nn (hashcat_ctx, ""); @@ -199,7 +199,7 @@ static void main_cracker_finished (MAYBE_UNUSED hashcat_ctx_t *hashcat_ctx, MAYB // print final status - if (user_options->benchmark == true) + if ((user_options->benchmark == true) || (user_options->speed_only == true)) { status_benchmark (hashcat_ctx); diff --git a/src/monitor.c b/src/monitor.c index e7c7b8a5c..c8c8ab3f7 100644 --- a/src/monitor.c +++ b/src/monitor.c @@ -307,12 +307,14 @@ static int monitor (hashcat_ctx_t *hashcat_ctx) if (user_options->quiet == false) clear_prompt (); - if (user_options->quiet == false) event_log_info (hashcat_ctx, ""); + //if (user_options->quiet == false) event_log_info (hashcat_ctx, ""); status_display (hashcat_ctx); if (user_options->quiet == false) event_log_info (hashcat_ctx, ""); + if (user_options->quiet == false) send_prompt (); + hc_thread_mutex_unlock (status_ctx->mux_display); status_left = user_options->status_timer; diff --git a/src/opencl.c b/src/opencl.c index fca84fe5e..9eb68c400 100644 --- a/src/opencl.c +++ b/src/opencl.c @@ -1071,7 +1071,7 @@ int choose_kernel (hashcat_ctx_t *hashcat_ctx, hc_device_param_t *device_param, device_param->speed_ms[speed_pos] = speed_ms; - if (user_options->benchmark == true) + if (user_options->speed_only == true) { if (speed_ms > 4096) return -1; } @@ -1798,7 +1798,7 @@ int run_cracker (hashcat_ctx_t *hashcat_ctx, hc_device_param_t *device_param, co if (CL_err == -1) return -1; } - if (user_options->benchmark == true) + if (user_options->speed_only == true) { hc_timer_set (&device_param->timer_speed); } @@ -1811,7 +1811,7 @@ int run_cracker (hashcat_ctx_t *hashcat_ctx, hc_device_param_t *device_param, co * result */ - if (user_options->benchmark == false) + if (user_options->speed_only == false) { check_cracked (hashcat_ctx, device_param, salt_pos); } @@ -1857,7 +1857,7 @@ int run_cracker (hashcat_ctx_t *hashcat_ctx, hc_device_param_t *device_param, co * benchmark */ - if (user_options->benchmark == true) break; + if (user_options->speed_only == true) break; if (status_ctx->run_thread_level2 == false) break; } @@ -2177,7 +2177,7 @@ int opencl_ctx_devices_init (hashcat_ctx_t *hashcat_ctx, const int comptime) fprintf (stdout, "\nPlatform ID #%u\n Vendor : %s\n Name : %s\n Version : %s\n\n", platform_id + 1, platform_vendor, platform_name, platform_version); } - if ((user_options->benchmark == true || user_options->quiet == false)) + if ((user_options->benchmark == true || user_options->speed_only == true || user_options->quiet == false)) { if (user_options->machine_readable == false) { @@ -2648,7 +2648,7 @@ int opencl_ctx_devices_init (hashcat_ctx_t *hashcat_ctx, const int comptime) hcfree (device_opencl_version); - if ((user_options->benchmark == true || user_options->quiet == false)) + if ((user_options->benchmark == true || user_options->speed_only == true || user_options->quiet == false)) { if (user_options->machine_readable == false) { @@ -2763,7 +2763,7 @@ int opencl_ctx_devices_init (hashcat_ctx_t *hashcat_ctx, const int comptime) devices_cnt++; } - if ((user_options->benchmark == true || user_options->quiet == false)) + if ((user_options->benchmark == true || user_options->speed_only == true || user_options->quiet == false)) { if (user_options->machine_readable == false) { diff --git a/src/outfile_check.c b/src/outfile_check.c index f86241979..c5d90c381 100644 --- a/src/outfile_check.c +++ b/src/outfile_check.c @@ -332,6 +332,7 @@ int outcheck_ctx_init (hashcat_ctx_t *hashcat_ctx) if (user_options->keyspace == true) return 0; if (user_options->benchmark == true) return 0; + if (user_options->speed_only == true) return 0; if (user_options->opencl_info == true) return 0; if (user_options->outfile_check_timer == 0) return 0; diff --git a/src/potfile.c b/src/potfile.c index 9fd1b9923..9dd4a9352 100644 --- a/src/potfile.c +++ b/src/potfile.c @@ -156,6 +156,7 @@ int potfile_init (hashcat_ctx_t *hashcat_ctx) if (user_options->keyspace == true) return 0; if (user_options->opencl_info == true) return 0; if (user_options->stdout_flag == true) return 0; + if (user_options->speed_only == true) return 0; if (user_options->usage == true) return 0; if (user_options->version == true) return 0; if (user_options->potfile_disable == true) return 0; diff --git a/src/restore.c b/src/restore.c index f5513cbc6..1ee55ee8a 100644 --- a/src/restore.c +++ b/src/restore.c @@ -420,6 +420,7 @@ int restore_ctx_init (hashcat_ctx_t *hashcat_ctx, int argc, char **argv) if (user_options->opencl_info == true) return 0; if (user_options->show == true) return 0; if (user_options->stdout_flag == true) return 0; + if (user_options->speed_only == true) return 0; if (user_options->usage == true) return 0; if (user_options->version == true) return 0; if (user_options->restore_disable == true) return 0; diff --git a/src/status.c b/src/status.c index 1a63841e0..572c49a35 100644 --- a/src/status.c +++ b/src/status.c @@ -1175,9 +1175,9 @@ void status_display (hashcat_ctx_t *hashcat_ctx) void status_benchmark_automate (hashcat_ctx_t *hashcat_ctx) { - hashconfig_t *hashconfig = hashcat_ctx->hashconfig; - opencl_ctx_t *opencl_ctx = hashcat_ctx->opencl_ctx; - status_ctx_t *status_ctx = hashcat_ctx->status_ctx; + hashconfig_t *hashconfig = hashcat_ctx->hashconfig; + opencl_ctx_t *opencl_ctx = hashcat_ctx->opencl_ctx; + status_ctx_t *status_ctx = hashcat_ctx->status_ctx; if (status_ctx->devices_status == STATUS_INIT) { @@ -1234,9 +1234,9 @@ void status_benchmark_automate (hashcat_ctx_t *hashcat_ctx) void status_benchmark (hashcat_ctx_t *hashcat_ctx) { - opencl_ctx_t *opencl_ctx = hashcat_ctx->opencl_ctx; - status_ctx_t *status_ctx = hashcat_ctx->status_ctx; - user_options_t *user_options = hashcat_ctx->user_options; + opencl_ctx_t *opencl_ctx = hashcat_ctx->opencl_ctx; + status_ctx_t *status_ctx = hashcat_ctx->status_ctx; + user_options_t *user_options = hashcat_ctx->user_options; if (status_ctx->devices_status == STATUS_INIT) { diff --git a/src/terminal.c b/src/terminal.c index 09b084045..da1762842 100644 --- a/src/terminal.c +++ b/src/terminal.c @@ -29,7 +29,7 @@ void welcome_screen (hashcat_ctx_t *hashcat_ctx, const time_t proc_start, const { 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, "%s (%s) starting in benchmark mode...", PROGNAME, version_tag); event_log_info (hashcat_ctx, ""); } else @@ -39,7 +39,12 @@ void welcome_screen (hashcat_ctx_t *hashcat_ctx, const time_t proc_start, const } 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, "%s (%s) starting in restore mode...", PROGNAME, version_tag); + event_log_info (hashcat_ctx, ""); + } + 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, ""); } else diff --git a/src/usage.c b/src/usage.c index a7b1d5ca9..5df411326 100644 --- a/src/usage.c +++ b/src/usage.c @@ -68,6 +68,7 @@ static const char *USAGE_BIG[] = " --veracrypt-keyfiles | File | Keyfiles used, separate with comma | --veracrypt-key=x.txt", " --veracrypt-pim | Num | VeraCrypt personal iterations multiplier | --veracrypt-pim=1000", " -b, --benchmark | | Run benchmark |", + " --speed-only | | Just return expected speed of the attack and quit |", " -c, --segment-size | Num | Sets size in MB to cache from the wordfile to X | -c 32", " --bitmap-min | Num | Sets minimum bits allowed for bitmaps to X | --bitmap-min=24", " --bitmap-max | Num | Sets maximum bits allowed for bitmaps to X | --bitmap-max=24", diff --git a/src/user_options.c b/src/user_options.c index 2e0c92e2d..104d84b3b 100644 --- a/src/user_options.c +++ b/src/user_options.c @@ -18,86 +18,87 @@ static const char short_options[] = "hVvm:a:r:j:k:g:o:t:d:D:n:u:c:p:s:l:1:2:3:4: static const struct option long_options[] = { - {"help", no_argument, 0, IDX_HELP}, - {"version", no_argument, 0, IDX_VERSION}, - {"quiet", no_argument, 0, IDX_QUIET}, - {"show", no_argument, 0, IDX_SHOW}, - {"left", no_argument, 0, IDX_LEFT}, - {"username", no_argument, 0, IDX_USERNAME}, - {"remove", no_argument, 0, IDX_REMOVE}, - {"remove-timer", required_argument, 0, IDX_REMOVE_TIMER}, - {"skip", required_argument, 0, IDX_SKIP}, - {"limit", required_argument, 0, IDX_LIMIT}, - {"keyspace", no_argument, 0, IDX_KEYSPACE}, - {"potfile-disable", no_argument, 0, IDX_POTFILE_DISABLE}, - {"potfile-path", required_argument, 0, IDX_POTFILE_PATH}, - {"debug-mode", required_argument, 0, IDX_DEBUG_MODE}, + {"attack-mode", required_argument, 0, IDX_ATTACK_MODE}, + {"benchmark", no_argument, 0, IDX_BENCHMARK}, + {"bitmap-max", required_argument, 0, IDX_BITMAP_MAX}, + {"bitmap-min", required_argument, 0, IDX_BITMAP_MIN}, + {"cpu-affinity", required_argument, 0, IDX_CPU_AFFINITY}, + {"custom-charset1", required_argument, 0, IDX_CUSTOM_CHARSET_1}, + {"custom-charset2", required_argument, 0, IDX_CUSTOM_CHARSET_2}, + {"custom-charset3", required_argument, 0, IDX_CUSTOM_CHARSET_3}, + {"custom-charset4", required_argument, 0, IDX_CUSTOM_CHARSET_4}, {"debug-file", required_argument, 0, IDX_DEBUG_FILE}, - {"induction-dir", required_argument, 0, IDX_INDUCTION_DIR}, - {"outfile-check-dir", required_argument, 0, IDX_OUTFILE_CHECK_DIR}, + {"debug-mode", required_argument, 0, IDX_DEBUG_MODE}, {"force", no_argument, 0, IDX_FORCE}, - {"benchmark", no_argument, 0, IDX_BENCHMARK}, - {"stdout", no_argument, 0, IDX_STDOUT_FLAG}, - {"restore", no_argument, 0, IDX_RESTORE}, - {"restore-disable", no_argument, 0, IDX_RESTORE_DISABLE}, - {"status", no_argument, 0, IDX_STATUS}, - {"status-timer", required_argument, 0, IDX_STATUS_TIMER}, - {"machine-readable", no_argument, 0, IDX_MACHINE_READABLE}, - {"loopback", no_argument, 0, IDX_LOOPBACK}, - {"weak-hash-threshold", required_argument, 0, IDX_WEAK_HASH_THRESHOLD}, - {"session", required_argument, 0, IDX_SESSION}, - {"runtime", required_argument, 0, IDX_RUNTIME}, - {"generate-rules", required_argument, 0, IDX_RP_GEN}, - {"generate-rules-func-min", required_argument, 0, IDX_RP_GEN_FUNC_MIN}, {"generate-rules-func-max", required_argument, 0, IDX_RP_GEN_FUNC_MAX}, + {"generate-rules-func-min", required_argument, 0, IDX_RP_GEN_FUNC_MIN}, + {"generate-rules", required_argument, 0, IDX_RP_GEN}, {"generate-rules-seed", required_argument, 0, IDX_RP_GEN_SEED}, - {"rule-left", required_argument, 0, IDX_RULE_BUF_L}, - {"rule-right", required_argument, 0, IDX_RULE_BUF_R}, + {"gpu-temp-abort", required_argument, 0, IDX_GPU_TEMP_ABORT}, + {"gpu-temp-disable", no_argument, 0, IDX_GPU_TEMP_DISABLE}, + {"gpu-temp-retain", required_argument, 0, IDX_GPU_TEMP_RETAIN}, {"hash-type", required_argument, 0, IDX_HASH_MODE}, - {"attack-mode", required_argument, 0, IDX_ATTACK_MODE}, - {"rules-file", required_argument, 0, IDX_RP_FILE}, - {"outfile", required_argument, 0, IDX_OUTFILE}, - {"outfile-format", required_argument, 0, IDX_OUTFILE_FORMAT}, - {"outfile-autohex-disable", no_argument, 0, IDX_OUTFILE_AUTOHEX_DISABLE}, - {"outfile-check-timer", required_argument, 0, IDX_OUTFILE_CHECK_TIMER}, + {"help", no_argument, 0, IDX_HELP}, {"hex-charset", no_argument, 0, IDX_HEX_CHARSET}, {"hex-salt", no_argument, 0, IDX_HEX_SALT}, {"hex-wordlist", no_argument, 0, IDX_HEX_WORDLIST}, - {"markov-disable", no_argument, 0, IDX_MARKOV_DISABLE}, + {"increment-max", required_argument, 0, IDX_INCREMENT_MAX}, + {"increment-min", required_argument, 0, IDX_INCREMENT_MIN}, + {"increment", no_argument, 0, IDX_INCREMENT}, + {"induction-dir", required_argument, 0, IDX_INDUCTION_DIR}, + {"kernel-accel", required_argument, 0, IDX_KERNEL_ACCEL}, + {"kernel-loops", required_argument, 0, IDX_KERNEL_LOOPS}, + {"keyspace", no_argument, 0, IDX_KEYSPACE}, + {"left", no_argument, 0, IDX_LEFT}, + {"limit", required_argument, 0, IDX_LIMIT}, + {"logfile-disable", no_argument, 0, IDX_LOGFILE_DISABLE}, + {"loopback", no_argument, 0, IDX_LOOPBACK}, + {"machine-readable", no_argument, 0, IDX_MACHINE_READABLE}, {"markov-classic", no_argument, 0, IDX_MARKOV_CLASSIC}, - {"markov-threshold", required_argument, 0, IDX_MARKOV_THRESHOLD}, + {"markov-disable", no_argument, 0, IDX_MARKOV_DISABLE}, {"markov-hcstat", required_argument, 0, IDX_MARKOV_HCSTAT}, - {"cpu-affinity", required_argument, 0, IDX_CPU_AFFINITY}, - {"opencl-info", no_argument, 0, IDX_OPENCL_INFO}, + {"markov-threshold", required_argument, 0, IDX_MARKOV_THRESHOLD}, + {"nvidia-spin-damp", required_argument, 0, IDX_NVIDIA_SPIN_DAMP}, {"opencl-devices", required_argument, 0, IDX_OPENCL_DEVICES}, - {"opencl-platforms", required_argument, 0, IDX_OPENCL_PLATFORMS}, {"opencl-device-types", required_argument, 0, IDX_OPENCL_DEVICE_TYPES}, + {"opencl-info", no_argument, 0, IDX_OPENCL_INFO}, + {"opencl-platforms", required_argument, 0, IDX_OPENCL_PLATFORMS}, {"opencl-vector-width", required_argument, 0, IDX_OPENCL_VECTOR_WIDTH}, - {"workload-profile", required_argument, 0, IDX_WORKLOAD_PROFILE}, - {"kernel-accel", required_argument, 0, IDX_KERNEL_ACCEL}, - {"kernel-loops", required_argument, 0, IDX_KERNEL_LOOPS}, - {"nvidia-spin-damp", required_argument, 0, IDX_NVIDIA_SPIN_DAMP}, - {"gpu-temp-disable", no_argument, 0, IDX_GPU_TEMP_DISABLE}, - {"gpu-temp-abort", required_argument, 0, IDX_GPU_TEMP_ABORT}, - {"gpu-temp-retain", required_argument, 0, IDX_GPU_TEMP_RETAIN}, + {"outfile-autohex-disable", no_argument, 0, IDX_OUTFILE_AUTOHEX_DISABLE}, + {"outfile-check-dir", required_argument, 0, IDX_OUTFILE_CHECK_DIR}, + {"outfile-check-timer", required_argument, 0, IDX_OUTFILE_CHECK_TIMER}, + {"outfile-format", required_argument, 0, IDX_OUTFILE_FORMAT}, + {"outfile", required_argument, 0, IDX_OUTFILE}, + {"potfile-disable", no_argument, 0, IDX_POTFILE_DISABLE}, + {"potfile-path", required_argument, 0, IDX_POTFILE_PATH}, {"powertune-enable", no_argument, 0, IDX_POWERTUNE_ENABLE}, - {"logfile-disable", no_argument, 0, IDX_LOGFILE_DISABLE}, + {"quiet", no_argument, 0, IDX_QUIET}, + {"remove", no_argument, 0, IDX_REMOVE}, + {"remove-timer", required_argument, 0, IDX_REMOVE_TIMER}, + {"restore-disable", no_argument, 0, IDX_RESTORE_DISABLE}, + {"restore", no_argument, 0, IDX_RESTORE}, + {"rule-left", required_argument, 0, IDX_RULE_BUF_L}, + {"rule-right", required_argument, 0, IDX_RULE_BUF_R}, + {"rules-file", required_argument, 0, IDX_RP_FILE}, + {"runtime", required_argument, 0, IDX_RUNTIME}, + {"scrypt-tmto", required_argument, 0, IDX_SCRYPT_TMTO}, + {"segment-size", required_argument, 0, IDX_SEGMENT_SIZE}, + {"separator", required_argument, 0, IDX_SEPARATOR}, + {"seperator", required_argument, 0, IDX_SEPARATOR}, + {"session", required_argument, 0, IDX_SESSION}, + {"show", no_argument, 0, IDX_SHOW}, + {"skip", required_argument, 0, IDX_SKIP}, + {"status", no_argument, 0, IDX_STATUS}, + {"status-timer", required_argument, 0, IDX_STATUS_TIMER}, + {"stdout", no_argument, 0, IDX_STDOUT_FLAG}, + {"speed-only", no_argument, 0, IDX_SPEED_ONLY}, {"truecrypt-keyfiles", required_argument, 0, IDX_TRUECRYPT_KEYFILES}, + {"username", no_argument, 0, IDX_USERNAME}, {"veracrypt-keyfiles", required_argument, 0, IDX_VERACRYPT_KEYFILES}, {"veracrypt-pim", required_argument, 0, IDX_VERACRYPT_PIM}, - {"segment-size", required_argument, 0, IDX_SEGMENT_SIZE}, - {"scrypt-tmto", required_argument, 0, IDX_SCRYPT_TMTO}, - {"seperator", required_argument, 0, IDX_SEPARATOR}, - {"separator", required_argument, 0, IDX_SEPARATOR}, - {"bitmap-min", required_argument, 0, IDX_BITMAP_MIN}, - {"bitmap-max", required_argument, 0, IDX_BITMAP_MAX}, - {"increment", no_argument, 0, IDX_INCREMENT}, - {"increment-min", required_argument, 0, IDX_INCREMENT_MIN}, - {"increment-max", required_argument, 0, IDX_INCREMENT_MAX}, - {"custom-charset1", required_argument, 0, IDX_CUSTOM_CHARSET_1}, - {"custom-charset2", required_argument, 0, IDX_CUSTOM_CHARSET_2}, - {"custom-charset3", required_argument, 0, IDX_CUSTOM_CHARSET_3}, - {"custom-charset4", required_argument, 0, IDX_CUSTOM_CHARSET_4}, + {"version", no_argument, 0, IDX_VERSION}, + {"weak-hash-threshold", required_argument, 0, IDX_WEAK_HASH_THRESHOLD}, + {"workload-profile", required_argument, 0, IDX_WORKLOAD_PROFILE}, {0, 0, 0, 0} }; @@ -183,6 +184,7 @@ int user_options_init (hashcat_ctx_t *hashcat_ctx) user_options->status = STATUS; user_options->status_timer = STATUS_TIMER; user_options->stdout_flag = STDOUT_FLAG; + user_options->speed_only = SPEED_ONLY; user_options->truecrypt_keyfiles = NULL; user_options->usage = USAGE; user_options->username = USERNAME; @@ -247,6 +249,7 @@ int user_options_getopt (hashcat_ctx_t *hashcat_ctx, int argc, char **argv) case IDX_KEYSPACE: user_options->keyspace = true; break; case IDX_BENCHMARK: user_options->benchmark = true; break; case IDX_STDOUT_FLAG: user_options->stdout_flag = true; break; + case IDX_SPEED_ONLY: user_options->speed_only = true; break; case IDX_RESTORE_DISABLE: user_options->restore_disable = true; break; case IDX_STATUS: user_options->status = true; break; case IDX_STATUS_TIMER: user_options->status_timer = atoi (optarg); break; @@ -909,7 +912,8 @@ void user_options_preprocess (hashcat_ctx_t *hashcat_ctx) if (user_options->opencl_info == true || user_options->keyspace == true || user_options->benchmark == true - || user_options->stdout_flag == true) + || user_options->stdout_flag == true + || user_options->speed_only == true) { user_options->show = false; user_options->left = false; @@ -932,6 +936,7 @@ void user_options_preprocess (hashcat_ctx_t *hashcat_ctx) user_options->session = "benchmark"; user_options->attack_mode = ATTACK_MODE_BF; user_options->increment = false; + user_options->speed_only = true; if (user_options->workload_profile_chgd == false) { @@ -1198,13 +1203,47 @@ void user_options_logger (hashcat_ctx_t *hashcat_ctx) user_options_t *user_options = hashcat_ctx->user_options; logfile_ctx_t *logfile_ctx = hashcat_ctx->logfile_ctx; + logfile_top_char (user_options->separator); + logfile_top_string (user_options->cpu_affinity); + logfile_top_string (user_options->custom_charset_1); + logfile_top_string (user_options->custom_charset_2); + logfile_top_string (user_options->custom_charset_3); + logfile_top_string (user_options->custom_charset_4); + logfile_top_string (user_options->debug_file); + logfile_top_string (user_options->induction_dir); + logfile_top_string (user_options->markov_hcstat); + logfile_top_string (user_options->opencl_devices); + logfile_top_string (user_options->opencl_device_types); + logfile_top_string (user_options->opencl_platforms); + logfile_top_string (user_options->outfile); + logfile_top_string (user_options->outfile_check_dir); + logfile_top_string (user_options->potfile_path); + logfile_top_string (user_options->rp_files[0]); + logfile_top_string (user_options->rule_buf_l); + logfile_top_string (user_options->rule_buf_r); + logfile_top_string (user_options->session); + logfile_top_string (user_options->truecrypt_keyfiles); + logfile_top_string (user_options->veracrypt_keyfiles); + logfile_top_uint64 (user_options->limit); + logfile_top_uint64 (user_options->skip); + logfile_top_uint (user_options->attack_mode); logfile_top_uint (user_options->benchmark); + logfile_top_uint (user_options->bitmap_max); + logfile_top_uint (user_options->bitmap_min); + logfile_top_uint (user_options->debug_mode); logfile_top_uint (user_options->force); + logfile_top_uint (user_options->gpu_temp_abort); logfile_top_uint (user_options->gpu_temp_disable); + logfile_top_uint (user_options->gpu_temp_retain); + logfile_top_uint (user_options->hash_mode); logfile_top_uint (user_options->hex_charset); logfile_top_uint (user_options->hex_salt); logfile_top_uint (user_options->hex_wordlist); logfile_top_uint (user_options->increment); + logfile_top_uint (user_options->increment_max); + logfile_top_uint (user_options->increment_min); + logfile_top_uint (user_options->kernel_accel); + logfile_top_uint (user_options->kernel_loops); logfile_top_uint (user_options->keyspace); logfile_top_uint (user_options->left); logfile_top_uint (user_options->logfile_disable); @@ -1212,37 +1251,20 @@ void user_options_logger (hashcat_ctx_t *hashcat_ctx) logfile_top_uint (user_options->machine_readable); logfile_top_uint (user_options->markov_classic); logfile_top_uint (user_options->markov_disable); + logfile_top_uint (user_options->markov_threshold); + logfile_top_uint (user_options->nvidia_spin_damp); logfile_top_uint (user_options->opencl_info); + logfile_top_uint (user_options->opencl_vector_width); logfile_top_uint (user_options->outfile_autohex); + logfile_top_uint (user_options->outfile_check_timer); + logfile_top_uint (user_options->outfile_format); logfile_top_uint (user_options->potfile_disable); logfile_top_uint (user_options->powertune_enable); logfile_top_uint (user_options->quiet); logfile_top_uint (user_options->remove); + logfile_top_uint (user_options->remove_timer); logfile_top_uint (user_options->restore); logfile_top_uint (user_options->restore_disable); - logfile_top_uint (user_options->show); - logfile_top_uint (user_options->status); - logfile_top_uint (user_options->stdout_flag); - logfile_top_uint (user_options->usage); - logfile_top_uint (user_options->username); - logfile_top_uint (user_options->version); - logfile_top_uint (user_options->attack_mode); - logfile_top_uint (user_options->bitmap_max); - logfile_top_uint (user_options->bitmap_min); - logfile_top_uint (user_options->debug_mode); - logfile_top_uint (user_options->gpu_temp_abort); - logfile_top_uint (user_options->gpu_temp_retain); - logfile_top_uint (user_options->hash_mode); - logfile_top_uint (user_options->increment_max); - logfile_top_uint (user_options->increment_min); - logfile_top_uint (user_options->kernel_accel); - logfile_top_uint (user_options->kernel_loops); - logfile_top_uint (user_options->markov_threshold); - logfile_top_uint (user_options->nvidia_spin_damp); - logfile_top_uint (user_options->opencl_vector_width); - logfile_top_uint (user_options->outfile_check_timer); - logfile_top_uint (user_options->outfile_format); - logfile_top_uint (user_options->remove_timer); logfile_top_uint (user_options->restore_timer); logfile_top_uint (user_options->rp_files_cnt); logfile_top_uint (user_options->rp_gen); @@ -1252,31 +1274,15 @@ void user_options_logger (hashcat_ctx_t *hashcat_ctx) logfile_top_uint (user_options->runtime); logfile_top_uint (user_options->scrypt_tmto); logfile_top_uint (user_options->segment_size); + logfile_top_uint (user_options->show); + logfile_top_uint (user_options->status); logfile_top_uint (user_options->status_timer); + logfile_top_uint (user_options->stdout_flag); + logfile_top_uint (user_options->speed_only); + logfile_top_uint (user_options->usage); + logfile_top_uint (user_options->username); logfile_top_uint (user_options->veracrypt_pim); + logfile_top_uint (user_options->version); logfile_top_uint (user_options->weak_hash_threshold); logfile_top_uint (user_options->workload_profile); - logfile_top_uint64 (user_options->limit); - logfile_top_uint64 (user_options->skip); - logfile_top_string (user_options->cpu_affinity); - logfile_top_string (user_options->custom_charset_1); - logfile_top_string (user_options->custom_charset_2); - logfile_top_string (user_options->custom_charset_3); - logfile_top_string (user_options->custom_charset_4); - logfile_top_string (user_options->debug_file); - logfile_top_string (user_options->induction_dir); - logfile_top_string (user_options->markov_hcstat); - logfile_top_string (user_options->opencl_devices); - logfile_top_string (user_options->opencl_device_types); - logfile_top_string (user_options->opencl_platforms); - logfile_top_string (user_options->outfile); - logfile_top_string (user_options->outfile_check_dir); - logfile_top_string (user_options->potfile_path); - logfile_top_string (user_options->rp_files[0]); - logfile_top_string (user_options->rule_buf_l); - logfile_top_string (user_options->rule_buf_r); - logfile_top_char (user_options->separator); - logfile_top_string (user_options->session); - logfile_top_string (user_options->truecrypt_keyfiles); - logfile_top_string (user_options->veracrypt_keyfiles); }