1
0
mirror of https://github.com/hashcat/hashcat.git synced 2025-02-16 17:42:04 +00:00

New option --progress-only: Quickly provides ideal progress step size and time to process it per device based on the user hashes and selected options, then quit

This commit is contained in:
jsteube 2016-12-09 23:44:43 +01:00
parent f9ba94954b
commit ec5610271a
18 changed files with 293 additions and 62 deletions

View File

@ -4,7 +4,8 @@
## Features
##
- Use $HEX[...] in case the password includes the separater character, increases potfile reading performance
- New option --progress-only: Quickly provides ideal progress step size and time to process it per device based on the user hashes and selected options, then quit
- Files: Use $HEX[...] in case the password includes the separater character, increases potfile reading performance
##
## Bugs

View File

@ -188,7 +188,7 @@ _hashcat ()
local BUILD_IN_CHARSETS='?l ?u ?d ?a ?b ?s ?h ?H'
local SHORT_OPTS="-m -a -V -v -h -b -t -o -p -c -d -w -n -u -j -k -r -g -1 -2 -3 -4 -i -I -s -l"
local LONG_OPTS="--hash-type --attack-mode --version --help --quiet --benchmark --hex-salt --hex-wordlist --hex-charset --force --status --status-timer --machine-readable --loopback --weak-hash-threshold --markov-hcstat --markov-disable --markov-classic --markov-threshold --runtime --session --speed-only --restore --restore-file-path --restore-disable --outfile --outfile-format --outfile-autohex-disable --outfile-check-timer --outfile-check-dir --separator --show --left --username --remove --remove-timer --potfile-disable --potfile-path --debug-mode --debug-file --induction-dir --segment-size --bitmap-min --bitmap-max --cpu-affinity --opencl-info --opencl-devices --opencl-platforms --opencl-device-types --opencl-vector-width --workload-profile --kernel-accel --kernel-loops --nvidia-spin-damp --gpu-temp-disable --gpu-temp-abort --gpu-temp-retain --powertune-enable --skip --limit --keyspace --rule-left --rule-right --rules-file --generate-rules --generate-rules-func-min --generate-rules-func-max --generate-rules-seed --custom-charset1 --custom-charset2 --custom-charset3 --custom-charset4 --increment --increment-min --increment-max --logfile-disable --scrypt-tmto --truecrypt-keyfiles --stdout --keep-guessing"
local LONG_OPTS="--hash-type --attack-mode --version --help --quiet --benchmark --hex-salt --hex-wordlist --hex-charset --force --status --status-timer --machine-readable --loopback --weak-hash-threshold --markov-hcstat --markov-disable --markov-classic --markov-threshold --runtime --session --speed-only --progress-only --restore --restore-file-path --restore-disable --outfile --outfile-format --outfile-autohex-disable --outfile-check-timer --outfile-check-dir --separator --show --left --username --remove --remove-timer --potfile-disable --potfile-path --debug-mode --debug-file --induction-dir --segment-size --bitmap-min --bitmap-max --cpu-affinity --opencl-info --opencl-devices --opencl-platforms --opencl-device-types --opencl-vector-width --workload-profile --kernel-accel --kernel-loops --nvidia-spin-damp --gpu-temp-disable --gpu-temp-abort --gpu-temp-retain --powertune-enable --skip --limit --keyspace --rule-left --rule-right --rules-file --generate-rules --generate-rules-func-min --generate-rules-func-max --generate-rules-seed --custom-charset1 --custom-charset2 --custom-charset3 --custom-charset4 --increment --increment-min --increment-max --logfile-disable --scrypt-tmto --truecrypt-keyfiles --stdout --keep-guessing"
local OPTIONS="-m -a -t -o -p -c -d -w -n -u -j -k -r -g -1 -2 -3 -4 -s -l --hash-type --attack-mode --status-timer --weak-hash-threshold --markov-hcstat --markov-threshold --runtime --session --timer --outfile --outfile-format --outfile-check-timer --outfile-check-dir --separator --remove-timer --potfile-path --restore-file-path --debug-mode --debug-file --induction-dir --segment-size --bitmap-min --bitmap-max --cpu-affinity --opencl-devices --opencl-platforms --opencl-device-types --opencl-vector-width --workload-profile --kernel-accel --kernel-loops --nvidia-spin-damp --gpu-temp-abort --gpu-temp-retain -disable --skip --limit --rule-left --rule-right --rules-file --generate-rules --generate-rules-func-min --generate-rules-func-max --generate-rules-seed --custom-charset1 --custom-charset2 --custom-charset3 --custom-charset4 --increment-min --increment-max --scrypt-tmto --truecrypt-keyfiles"
COMPREPLY=()

View File

@ -81,6 +81,8 @@ char *status_get_cpt (const hashcat_ctx_t *hashcat_ctx)
char *status_get_hwmon_dev (const hashcat_ctx_t *hashcat_ctx, const int device_id);
int status_get_corespeed_dev (const hashcat_ctx_t *hashcat_ctx, const int device_id);
int status_get_memoryspeed_dev (const hashcat_ctx_t *hashcat_ctx, const int device_id);
int status_get_progress_dev (const hashcat_ctx_t *hashcat_ctx, const int device_id);
double status_get_runtime_msec_dev (const hashcat_ctx_t *hashcat_ctx, const int device_id);
int status_progress_init (hashcat_ctx_t *hashcat_ctx);
void status_progress_destroy (hashcat_ctx_t *hashcat_ctx);

View File

@ -41,12 +41,16 @@ int tty_break(void);
int tty_getchar(void);
int tty_fix(void);
void opencl_info (hashcat_ctx_t *hashcat_ctx);
void opencl_info_compact (hashcat_ctx_t *hashcat_ctx);
void opencl_info (hashcat_ctx_t *hashcat_ctx);
void opencl_info_compact (hashcat_ctx_t *hashcat_ctx);
void status_display_machine_readable (hashcat_ctx_t *hashcat_ctx);
void status_display (hashcat_ctx_t *hashcat_ctx);
void status_benchmark_automate (hashcat_ctx_t *hashcat_ctx);
void status_benchmark (hashcat_ctx_t *hashcat_ctx);
void status_progress_machine_readable (hashcat_ctx_t *hashcat_ctx);
void status_progress (hashcat_ctx_t *hashcat_ctx);
void status_speed_machine_readable (hashcat_ctx_t *hashcat_ctx);
void status_speed (hashcat_ctx_t *hashcat_ctx);
void status_display_machine_readable (hashcat_ctx_t *hashcat_ctx);
void status_display (hashcat_ctx_t *hashcat_ctx);
void status_benchmark_machine_readable (hashcat_ctx_t *hashcat_ctx);
void status_benchmark (hashcat_ctx_t *hashcat_ctx);
#endif // _TERMINAL_H

View File

@ -522,6 +522,7 @@ typedef enum user_options_defaults
STATUS_TIMER = 10,
STDOUT_FLAG = false,
SPEED_ONLY = false,
PROGRESS_ONLY = false,
USAGE = false,
USERNAME = false,
VERSION = false,
@ -607,13 +608,14 @@ typedef enum user_options_map
IDX_STATUS_TIMER = 0xff30,
IDX_STDOUT_FLAG = 0xff31,
IDX_SPEED_ONLY = 0xff32,
IDX_TRUECRYPT_KEYFILES = 0xff33,
IDX_USERNAME = 0xff34,
IDX_VERACRYPT_KEYFILES = 0xff35,
IDX_VERACRYPT_PIM = 0xff36,
IDX_PROGRESS_ONLY = 0xff33,
IDX_TRUECRYPT_KEYFILES = 0xff34,
IDX_USERNAME = 0xff35,
IDX_VERACRYPT_KEYFILES = 0xff36,
IDX_VERACRYPT_PIM = 0xff37,
IDX_VERSION_LOWER = 'v',
IDX_VERSION = 'V',
IDX_WEAK_HASH_THRESHOLD = 0xff37,
IDX_WEAK_HASH_THRESHOLD = 0xff38,
IDX_WORKLOAD_PROFILE = 'w'
} user_options_map_t;
@ -892,6 +894,7 @@ typedef struct hc_device_param
u32 outerloop_pos;
u32 outerloop_left;
double outerloop_msec;
u32 innerloop_pos;
u32 innerloop_left;
@ -1355,6 +1358,7 @@ typedef struct user_options
bool status;
bool stdout_flag;
bool speed_only;
bool progress_only;
bool usage;
bool username;
bool version;
@ -1567,6 +1571,8 @@ typedef struct
char *hwmon_dev;
int corespeed_dev;
int memoryspeed_dev;
double runtime_msec_dev;
int progress_dev;
} device_info_t;

View File

@ -86,16 +86,17 @@ int debugfile_init (hashcat_ctx_t *hashcat_ctx)
debugfile_ctx->enabled = false;
if (user_options->benchmark == true) return 0;
if (user_options->keyspace == true) return 0;
if (user_options->left == true) return 0;
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;
if (user_options->benchmark == true) return 0;
if (user_options->keyspace == true) return 0;
if (user_options->left == true) return 0;
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->progress_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;
debugfile_ctx->enabled = true;

View File

@ -664,7 +664,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 && user_options->speed_only == false)
if (user_options->keyspace == false && user_options->stdout_flag == false && user_options->speed_only == false)
{
hc_thread_create (inner_threads[inner_threads_cnt], thread_monitor, hashcat_ctx);
@ -1252,6 +1252,8 @@ int hashcat_get_status (hashcat_ctx_t *hashcat_ctx, hashcat_status_t *hashcat_st
device_info->hwmon_dev = status_get_hwmon_dev (hashcat_ctx, device_id);
device_info->corespeed_dev = status_get_corespeed_dev (hashcat_ctx, device_id);
device_info->memoryspeed_dev = status_get_memoryspeed_dev (hashcat_ctx, device_id);
device_info->progress_dev = status_get_progress_dev (hashcat_ctx, device_id);
device_info->runtime_msec_dev = status_get_runtime_msec_dev (hashcat_ctx, device_id);
}
hashcat_status->hashes_msec_all = status_get_hashes_msec_all (hashcat_ctx);

View File

@ -30,15 +30,16 @@ int induct_ctx_init (hashcat_ctx_t *hashcat_ctx)
induct_ctx->enabled = false;
if (user_options->benchmark == true) return 0;
if (user_options->keyspace == true) return 0;
if (user_options->left == true) return 0;
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->benchmark == true) return 0;
if (user_options->keyspace == true) return 0;
if (user_options->left == true) return 0;
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->progress_only == true) return 0;
if (user_options->usage == true) return 0;
if (user_options->version == true) return 0;
if (user_options->attack_mode == ATTACK_MODE_BF) return 0;
if (user_options->attack_mode == ATTACK_MODE_COMBI) return 0;

View File

@ -60,15 +60,16 @@ int loopback_init (hashcat_ctx_t *hashcat_ctx)
loopback_ctx->enabled = false;
if (user_options->benchmark == true) return 0;
if (user_options->keyspace == true) return 0;
if (user_options->left == true) return 0;
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->benchmark == true) return 0;
if (user_options->keyspace == true) return 0;
if (user_options->left == true) return 0;
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->progress_only == true) return 0;
if (user_options->usage == true) return 0;
if (user_options->version == true) return 0;
loopback_ctx->enabled = true;
loopback_ctx->fp = NULL;

View File

@ -168,7 +168,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 && user_options->speed_only == false)
if ((user_options->keyspace == 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))
{
@ -211,7 +211,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->benchmark == false) && (user_options->speed_only == false))
if ((user_options->quiet == false) && (user_options->speed_only == false))
{
event_log_info_nn (hashcat_ctx, "");
@ -239,7 +239,7 @@ static void main_cracker_finished (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->benchmark == false) && (user_options->speed_only == false))
if (user_options->speed_only == false)
{
clear_prompt ();
}
@ -247,7 +247,7 @@ static void main_cracker_finished (MAYBE_UNUSED hashcat_ctx_t *hashcat_ctx, MAYB
// print final status
if ((user_options->benchmark == true) || (user_options->speed_only == true))
if (user_options->benchmark == true)
{
status_benchmark (hashcat_ctx);
@ -256,6 +256,24 @@ static void main_cracker_finished (MAYBE_UNUSED hashcat_ctx_t *hashcat_ctx, MAYB
event_log_info (hashcat_ctx, "");
}
}
else if (user_options->progress_only == true)
{
status_progress (hashcat_ctx);
if (user_options->machine_readable == false)
{
event_log_info (hashcat_ctx, "");
}
}
else if (user_options->speed_only == true)
{
status_speed (hashcat_ctx);
if (user_options->machine_readable == false)
{
event_log_info (hashcat_ctx, "");
}
}
else
{
if (user_options->quiet == false)

View File

@ -2002,6 +2002,15 @@ int run_cracker (hashcat_ctx_t *hashcat_ctx, hc_device_param_t *device_param, co
if (status_ctx->run_thread_level2 == false) break;
}
if (user_options->progress_only == true)
{
const double m = (double) innerloop_cnt / innerloop_step;
device_param->outerloop_msec = device_param->speed_msec[0] * m;
}
if (user_options->speed_only == true) break;
//status screen makes use of this, can't reset here
//device_param->innerloop_pos = 0;
//device_param->innerloop_left = 0;

View File

@ -324,10 +324,11 @@ int outcheck_ctx_init (hashcat_ctx_t *hashcat_ctx)
outcheck_ctx->enabled = false;
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->keyspace == true) return 0;
if (user_options->benchmark == true) return 0;
if (user_options->speed_only == true) return 0;
if (user_options->progress_only == true) return 0;
if (user_options->opencl_info == true) return 0;
if (user_options->outfile_check_timer == 0) return 0;

View File

@ -88,6 +88,7 @@ int potfile_init (hashcat_ctx_t *hashcat_ctx)
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->progress_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;

View File

@ -346,6 +346,7 @@ int restore_ctx_init (hashcat_ctx_t *hashcat_ctx, int argc, char **argv)
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->progress_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;

View File

@ -1685,6 +1685,28 @@ int status_get_memoryspeed_dev (const hashcat_ctx_t *hashcat_ctx, const int devi
return num_memoryspeed;
}
int status_get_progress_dev (const hashcat_ctx_t *hashcat_ctx, const int device_id)
{
const opencl_ctx_t *opencl_ctx = hashcat_ctx->opencl_ctx;
hc_device_param_t *device_param = &opencl_ctx->devices_param[device_id];
if (device_param->skipped == true) return 0;
return device_param->outerloop_left;
}
double status_get_runtime_msec_dev (const hashcat_ctx_t *hashcat_ctx, const int device_id)
{
const opencl_ctx_t *opencl_ctx = hashcat_ctx->opencl_ctx;
hc_device_param_t *device_param = &opencl_ctx->devices_param[device_id];
if (device_param->skipped == true) return 0;
return device_param->outerloop_msec;
}
int status_progress_init (hashcat_ctx_t *hashcat_ctx)
{
status_ctx_t *status_ctx = hashcat_ctx->status_ctx;

View File

@ -53,6 +53,11 @@ void welcome_screen (hashcat_ctx_t *hashcat_ctx, const char *version_tag)
event_log_info (hashcat_ctx, "%s (%s) starting in speed-only mode...", PROGNAME, version_tag);
event_log_info (hashcat_ctx, "");
}
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, "");
}
else
{
event_log_info (hashcat_ctx, "%s (%s) starting...", PROGNAME, version_tag);
@ -1045,7 +1050,7 @@ void status_display (hashcat_ctx_t *hashcat_ctx)
hcfree (hashcat_status);
}
void status_benchmark_automate (hashcat_ctx_t *hashcat_ctx)
void status_benchmark_machine_readable (hashcat_ctx_t *hashcat_ctx)
{
hashconfig_t *hashconfig = hashcat_ctx->hashconfig;
@ -1080,7 +1085,7 @@ void status_benchmark (hashcat_ctx_t *hashcat_ctx)
if (user_options->machine_readable == true)
{
status_benchmark_automate (hashcat_ctx);
status_benchmark_machine_readable (hashcat_ctx);
return;
}
@ -1117,3 +1122,144 @@ void status_benchmark (hashcat_ctx_t *hashcat_ctx)
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));
}
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);
}
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:%d:%0.2f", device_id + 1, device_info->progress_dev, device_info->runtime_msec_dev);
}
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.Dev.#%d..: %d", 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.Dev.#%d...: %0.2fms", device_id + 1,
device_info->runtime_msec_dev);
}
hcfree (hashcat_status);
}

View File

@ -70,7 +70,8 @@ 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 |",
" --speed-only | | Return expected speed of the attack and quit |",
" --progress-only | | Return ideal progress step size and time to process |",
" -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",

View File

@ -94,6 +94,7 @@ static const struct option long_options[] =
{"status-timer", required_argument, 0, IDX_STATUS_TIMER},
{"stdout", no_argument, 0, IDX_STDOUT_FLAG},
{"speed-only", no_argument, 0, IDX_SPEED_ONLY},
{"progress-only", no_argument, 0, IDX_PROGRESS_ONLY},
{"truecrypt-keyfiles", required_argument, 0, IDX_TRUECRYPT_KEYFILES},
{"username", no_argument, 0, IDX_USERNAME},
{"veracrypt-keyfiles", required_argument, 0, IDX_VERACRYPT_KEYFILES},
@ -189,6 +190,7 @@ int user_options_init (hashcat_ctx_t *hashcat_ctx)
user_options->status_timer = STATUS_TIMER;
user_options->stdout_flag = STDOUT_FLAG;
user_options->speed_only = SPEED_ONLY;
user_options->progress_only = PROGRESS_ONLY;
user_options->truecrypt_keyfiles = NULL;
user_options->usage = USAGE;
user_options->username = USERNAME;
@ -255,6 +257,7 @@ int user_options_getopt (hashcat_ctx_t *hashcat_ctx, int argc, char **argv)
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_PROGRESS_ONLY: user_options->progress_only = true; break;
case IDX_RESTORE_DISABLE: user_options->restore_disable = true; break;
case IDX_RESTORE_FILE_PATH: user_options->restore_file_path = optarg; break;
case IDX_STATUS: user_options->status = true; break;
@ -465,6 +468,13 @@ int user_options_sanity (hashcat_ctx_t *hashcat_ctx)
return -1;
}
if ((user_options->increment == true) && (user_options->progress_only == true))
{
event_log_error (hashcat_ctx, "Increment is not allowed in combination with --progress-only");
return -1;
}
if ((user_options->increment == true) && (user_options->speed_only == true))
{
event_log_error (hashcat_ctx, "Increment is not allowed in combination with --speed-only");
@ -927,10 +937,11 @@ void user_options_preprocess (hashcat_ctx_t *hashcat_ctx)
// some options can influence or overwrite other options
if (user_options->opencl_info == true
|| user_options->keyspace == true
|| user_options->stdout_flag == true
|| user_options->speed_only == true)
if (user_options->opencl_info == true
|| user_options->keyspace == true
|| user_options->stdout_flag == true
|| user_options->speed_only == true
|| user_options->progress_only == true)
{
user_options->gpu_temp_disable = true;
user_options->left = false;
@ -967,6 +978,7 @@ void user_options_preprocess (hashcat_ctx_t *hashcat_ctx)
user_options->status = false;
user_options->status_timer = 0;
user_options->speed_only = true;
user_options->progress_only = false;
user_options->weak_hash_threshold = 0;
if (user_options->workload_profile_chgd == false)
@ -975,6 +987,11 @@ void user_options_preprocess (hashcat_ctx_t *hashcat_ctx)
}
}
if (user_options->progress_only == true)
{
user_options->speed_only = true;
}
if (user_options->keyspace == true)
{
user_options->session = "keyspace";
@ -1069,11 +1086,7 @@ void user_options_preprocess (hashcat_ctx_t *hashcat_ctx)
if (user_options->attack_mode == ATTACK_MODE_BF)
{
if (user_options->benchmark == true)
{
}
else if (user_options->opencl_info == true)
if (user_options->opencl_info == true)
{
}
@ -1311,6 +1324,7 @@ void user_options_logger (hashcat_ctx_t *hashcat_ctx)
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->progress_only);
logfile_top_uint (user_options->usage);
logfile_top_uint (user_options->username);
logfile_top_uint (user_options->veracrypt_pim);