Added option --example-hashes to show an example hash for each hash-mode
This commit is contained in:
+7
-6
@@ -78,12 +78,13 @@ int bitmap_ctx_init (hashcat_ctx_t *hashcat_ctx)
|
||||
|
||||
bitmap_ctx->enabled = false;
|
||||
|
||||
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->usage == true) return 0;
|
||||
if (user_options->version == true) return 0;
|
||||
if (user_options->example_hashes == 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->usage == true) return 0;
|
||||
if (user_options->version == true) return 0;
|
||||
|
||||
bitmap_ctx->enabled = true;
|
||||
|
||||
|
||||
+6
-5
@@ -20,11 +20,12 @@ int combinator_ctx_init (hashcat_ctx_t *hashcat_ctx)
|
||||
|
||||
combinator_ctx->enabled = false;
|
||||
|
||||
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->usage == true) return 0;
|
||||
if (user_options->version == true) return 0;
|
||||
if (user_options->example_hashes == 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->usage == true) return 0;
|
||||
if (user_options->version == true) return 0;
|
||||
|
||||
if ((user_options->attack_mode != ATTACK_MODE_COMBI)
|
||||
&& (user_options->attack_mode != ATTACK_MODE_HYBRID1)
|
||||
|
||||
@@ -16,12 +16,13 @@ int cpt_ctx_init (hashcat_ctx_t *hashcat_ctx)
|
||||
|
||||
cpt_ctx->enabled = false;
|
||||
|
||||
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->usage == true) return 0;
|
||||
if (user_options->version == true) return 0;
|
||||
if (user_options->example_hashes == 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->usage == true) return 0;
|
||||
if (user_options->version == true) return 0;
|
||||
|
||||
cpt_ctx->enabled = true;
|
||||
|
||||
|
||||
+12
-11
@@ -87,17 +87,18 @@ 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->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;
|
||||
if (user_options->benchmark == true) return 0;
|
||||
if (user_options->example_hashes == 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;
|
||||
|
||||
|
||||
+8
-7
@@ -37,13 +37,14 @@ int dictstat_init (hashcat_ctx_t *hashcat_ctx)
|
||||
|
||||
dictstat_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->usage == true) return 0;
|
||||
if (user_options->version == true) return 0;
|
||||
if (user_options->benchmark == true) return 0;
|
||||
if (user_options->example_hashes == 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->usage == true) return 0;
|
||||
if (user_options->version == true) return 0;
|
||||
|
||||
if (user_options->attack_mode == ATTACK_MODE_BF) return 0;
|
||||
|
||||
|
||||
+6
-1
@@ -415,7 +415,12 @@ static int outer_loop (hashcat_ctx_t *hashcat_ctx)
|
||||
|
||||
const int rc_hashconfig = hashconfig_init (hashcat_ctx);
|
||||
|
||||
if (rc_hashconfig == -1) return -1;
|
||||
if (rc_hashconfig == -1)
|
||||
{
|
||||
event_log_error (hashcat_ctx, "Unknown hash-type '%u' selected.", user_options->hash_mode);
|
||||
|
||||
return -1;
|
||||
}
|
||||
|
||||
/**
|
||||
* load hashes, stage 1
|
||||
|
||||
@@ -672,6 +672,9 @@ int hashes_init_stage1 (hashcat_ctx_t *hashcat_ctx)
|
||||
|
||||
hashes_cnt = 1;
|
||||
}
|
||||
else if (user_options->example_hashes == true)
|
||||
{
|
||||
}
|
||||
else if (user_options->keyspace == true)
|
||||
{
|
||||
}
|
||||
|
||||
@@ -3328,6 +3328,7 @@ int hwmon_ctx_init (hashcat_ctx_t *hashcat_ctx)
|
||||
|
||||
hwmon_ctx->enabled = false;
|
||||
|
||||
if (user_options->example_hashes == 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;
|
||||
|
||||
+11
-10
@@ -36,16 +36,17 @@ 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->progress_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->example_hashes == 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;
|
||||
|
||||
+26
-25
@@ -34,7 +34,6 @@ static char ST_PASS_BIN_09710[] = "\x91\xb2\xe0\x62\xb9";
|
||||
static char ST_PASS_BIN_09810[] = "\xb8\xf6\x36\x19\xca";
|
||||
static char ST_PASS_BIN_10410[] = "\x6a\x8a\xed\xcc\xb7";
|
||||
|
||||
|
||||
/**
|
||||
* Missing self-test hashes:
|
||||
*
|
||||
@@ -24312,8 +24311,7 @@ int hashconfig_init (hashcat_ctx_t *hashcat_ctx)
|
||||
hashconfig->st_pass = ST_PASS_HASHCAT_PLAIN;
|
||||
break;
|
||||
|
||||
default: event_log_error (hashcat_ctx, "Unknown hash-type '%u' selected.", hashconfig->hash_mode);
|
||||
return -1;
|
||||
default: return -1;
|
||||
}
|
||||
|
||||
if (user_options->hex_salt)
|
||||
@@ -24338,36 +24336,39 @@ int hashconfig_init (hashcat_ctx_t *hashcat_ctx)
|
||||
// some kernels do not have an optimized kernel, simply because they do not need them
|
||||
// or because they are not yet converted, for them we should switch off optimized mode
|
||||
|
||||
if (user_options->optimized_kernel_enable == true)
|
||||
if (user_options->example_hashes == false)
|
||||
{
|
||||
char source_file[256] = { 0 };
|
||||
|
||||
generate_source_kernel_filename (hashconfig->attack_exec, user_options_extra->attack_kern, hashconfig->kern_type, true, folder_config->shared_dir, source_file);
|
||||
|
||||
if (hc_path_read (source_file) == false)
|
||||
if (user_options->optimized_kernel_enable == true)
|
||||
{
|
||||
if (user_options->quiet == false) event_log_warning (hashcat_ctx, "%s: Optimized kernel not found, falling back to pure kernel", source_file);
|
||||
char source_file[256] = { 0 };
|
||||
|
||||
generate_source_kernel_filename (hashconfig->attack_exec, user_options_extra->attack_kern, hashconfig->kern_type, true, folder_config->shared_dir, source_file);
|
||||
|
||||
if (hc_path_read (source_file) == false)
|
||||
{
|
||||
if (user_options->quiet == false) event_log_warning (hashcat_ctx, "%s: Optimized kernel not found, falling back to pure kernel", source_file);
|
||||
}
|
||||
else
|
||||
{
|
||||
hashconfig->opti_type |= OPTI_TYPE_OPTIMIZED_KERNEL;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
hashconfig->opti_type |= OPTI_TYPE_OPTIMIZED_KERNEL;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
char source_file[256] = { 0 };
|
||||
char source_file[256] = { 0 };
|
||||
|
||||
generate_source_kernel_filename (hashconfig->attack_exec, user_options_extra->attack_kern, hashconfig->kern_type, false, folder_config->shared_dir, source_file);
|
||||
generate_source_kernel_filename (hashconfig->attack_exec, user_options_extra->attack_kern, hashconfig->kern_type, false, folder_config->shared_dir, source_file);
|
||||
|
||||
if (hc_path_read (source_file) == false)
|
||||
{
|
||||
if (user_options->quiet == false) event_log_warning (hashcat_ctx, "%s: Pure kernel not found, falling back to optimized kernel", source_file);
|
||||
if (hc_path_read (source_file) == false)
|
||||
{
|
||||
if (user_options->quiet == false) event_log_warning (hashcat_ctx, "%s: Pure kernel not found, falling back to optimized kernel", source_file);
|
||||
|
||||
hashconfig->opti_type |= OPTI_TYPE_OPTIMIZED_KERNEL;
|
||||
}
|
||||
else
|
||||
{
|
||||
// nothing to do
|
||||
hashconfig->opti_type |= OPTI_TYPE_OPTIMIZED_KERNEL;
|
||||
}
|
||||
else
|
||||
{
|
||||
// nothing to do
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
+11
-10
@@ -60,16 +60,17 @@ 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->progress_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->example_hashes == 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;
|
||||
|
||||
+12
-4
@@ -187,7 +187,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->stdout_flag == false) && (user_options->opencl_info == false) && (user_options->speed_only == false))
|
||||
if ((user_options->example_hashes == false) && (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))
|
||||
{
|
||||
@@ -250,9 +250,10 @@ static void main_cracker_finished (MAYBE_UNUSED hashcat_ctx_t *hashcat_ctx, MAYB
|
||||
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 (user_options->example_hashes == true) return;
|
||||
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
|
||||
|
||||
@@ -1035,6 +1036,13 @@ int main (int argc, char **argv)
|
||||
return 0;
|
||||
}
|
||||
|
||||
if (user_options->example_hashes == true)
|
||||
{
|
||||
example_hashes (hashcat_ctx);
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
// init a hashcat session; this initializes opencl devices, hwmon, etc
|
||||
|
||||
welcome_screen (hashcat_ctx, VERSION_TAG);
|
||||
|
||||
+6
-5
@@ -1372,11 +1372,12 @@ int mask_ctx_init (hashcat_ctx_t *hashcat_ctx)
|
||||
|
||||
mask_ctx->enabled = false;
|
||||
|
||||
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->usage == true) return 0;
|
||||
if (user_options->version == true) return 0;
|
||||
if (user_options->example_hashes == 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->usage == true) return 0;
|
||||
if (user_options->version == true) return 0;
|
||||
|
||||
if (user_options->attack_mode == ATTACK_MODE_STRAIGHT) return 0;
|
||||
if (user_options->attack_mode == ATTACK_MODE_COMBI) return 0;
|
||||
|
||||
+6
-5
@@ -2360,11 +2360,12 @@ int opencl_ctx_init (hashcat_ctx_t *hashcat_ctx)
|
||||
|
||||
opencl_ctx->enabled = false;
|
||||
|
||||
if (user_options->keyspace == true) return 0;
|
||||
if (user_options->left == true) return 0;
|
||||
if (user_options->show == true) return 0;
|
||||
if (user_options->usage == true) return 0;
|
||||
if (user_options->version == true) return 0;
|
||||
if (user_options->example_hashes == true) return 0;
|
||||
if (user_options->keyspace == true) return 0;
|
||||
if (user_options->left == true) return 0;
|
||||
if (user_options->show == true) return 0;
|
||||
if (user_options->usage == true) return 0;
|
||||
if (user_options->version == true) return 0;
|
||||
|
||||
hc_device_param_t *devices_param = (hc_device_param_t *) hccalloc (DEVICES_MAX, sizeof (hc_device_param_t));
|
||||
|
||||
|
||||
+6
-5
@@ -311,11 +311,12 @@ 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->progress_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->example_hashes == 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;
|
||||
|
||||
|
||||
@@ -64,6 +64,7 @@ int potfile_init (hashcat_ctx_t *hashcat_ctx)
|
||||
potfile_ctx->enabled = false;
|
||||
|
||||
if (user_options->benchmark == true) return 0;
|
||||
if (user_options->example_hashes == true) return 0;
|
||||
if (user_options->keyspace == true) return 0;
|
||||
if (user_options->opencl_info == true) return 0;
|
||||
if (user_options->stdout_flag == true) return 0;
|
||||
|
||||
@@ -301,6 +301,7 @@ int restore_ctx_init (hashcat_ctx_t *hashcat_ctx, int argc, char **argv)
|
||||
restore_ctx->enabled = false;
|
||||
|
||||
if (user_options->benchmark == true) return 0;
|
||||
if (user_options->example_hashes == 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;
|
||||
|
||||
+6
-5
@@ -207,11 +207,12 @@ int straight_ctx_init (hashcat_ctx_t *hashcat_ctx)
|
||||
|
||||
straight_ctx->enabled = false;
|
||||
|
||||
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->usage == true) return 0;
|
||||
if (user_options->version == true) return 0;
|
||||
if (user_options->example_hashes == 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->usage == true) return 0;
|
||||
if (user_options->version == true) return 0;
|
||||
|
||||
if (user_options->attack_mode == ATTACK_MODE_BF) return 0;
|
||||
|
||||
|
||||
@@ -513,6 +513,69 @@ void compress_terminal_line_length (char *out_buf, const size_t keep_from_beginn
|
||||
*ptr1 = 0;
|
||||
}
|
||||
|
||||
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: %s", strhashtype (hashconfig->hash_mode));
|
||||
|
||||
if ((hashconfig->st_hash != NULL) && (hashconfig->st_pass != NULL))
|
||||
{
|
||||
event_log_info (hashcat_ctx, "HASH: %s", hashconfig->st_hash);
|
||||
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: %s", strhashtype (hashconfig->hash_mode));
|
||||
|
||||
if ((hashconfig->st_hash != NULL) && (hashconfig->st_pass != NULL))
|
||||
{
|
||||
event_log_info (hashcat_ctx, "HASH: %s", hashconfig->st_hash);
|
||||
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);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void opencl_info (hashcat_ctx_t *hashcat_ctx)
|
||||
{
|
||||
const opencl_ctx_t *opencl_ctx = hashcat_ctx->opencl_ctx;
|
||||
|
||||
+7
-6
@@ -59,12 +59,13 @@ int tuning_db_init (hashcat_ctx_t *hashcat_ctx)
|
||||
|
||||
tuning_db->enabled = false;
|
||||
|
||||
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->usage == true) return 0;
|
||||
if (user_options->version == true) return 0;
|
||||
if (user_options->example_hashes == 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->usage == true) return 0;
|
||||
if (user_options->version == true) return 0;
|
||||
|
||||
tuning_db->enabled = true;
|
||||
|
||||
|
||||
@@ -84,6 +84,7 @@ static const char *USAGE_BIG[] =
|
||||
" --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",
|
||||
" --cpu-affinity | Str | Locks to CPU devices, separated with commas | --cpu-affinity=1,2,3",
|
||||
" --example-hashes | | Show an example hash for each hash-mode |",
|
||||
" -I, --opencl-info | | Show info about detected OpenCL platforms/devices | -I",
|
||||
" --opencl-platforms | Str | OpenCL platforms to use, separated with commas | --opencl-platforms=2",
|
||||
" -d, --opencl-devices | Str | OpenCL devices to use, separated with commas | -d 1",
|
||||
|
||||
+39
-9
@@ -32,6 +32,7 @@ static const struct option long_options[] =
|
||||
{"debug-mode", required_argument, 0, IDX_DEBUG_MODE},
|
||||
{"encoding-from", required_argument, 0, IDX_ENCODING_FROM},
|
||||
{"encoding-to", required_argument, 0, IDX_ENCODING_TO},
|
||||
{"example-hashes", no_argument, 0, IDX_EXAMPLE_HASHES},
|
||||
{"force", no_argument, 0, IDX_FORCE},
|
||||
{"generate-rules-func-max", required_argument, 0, IDX_RP_GEN_FUNC_MAX},
|
||||
{"generate-rules-func-min", required_argument, 0, IDX_RP_GEN_FUNC_MIN},
|
||||
@@ -139,6 +140,7 @@ int user_options_init (hashcat_ctx_t *hashcat_ctx)
|
||||
user_options->custom_charset_4 = NULL;
|
||||
user_options->debug_file = NULL;
|
||||
user_options->debug_mode = DEBUG_MODE;
|
||||
user_options->example_hashes = EXAMPLE_HASHES;
|
||||
user_options->encoding_from = ENCODING_FROM;
|
||||
user_options->encoding_to = ENCODING_TO;
|
||||
user_options->force = FORCE;
|
||||
@@ -171,7 +173,7 @@ int user_options_init (hashcat_ctx_t *hashcat_ctx)
|
||||
user_options->nvidia_spin_damp = NVIDIA_SPIN_DAMP;
|
||||
user_options->opencl_devices = NULL;
|
||||
user_options->opencl_device_types = NULL;
|
||||
user_options->opencl_info = 0;
|
||||
user_options->opencl_info = OPENCL_INFO;
|
||||
user_options->opencl_platforms = NULL;
|
||||
user_options->opencl_vector_width = OPENCL_VECTOR_WIDTH;
|
||||
user_options->optimized_kernel_enable = OPTIMIZED_KERNEL_ENABLE;
|
||||
@@ -335,6 +337,7 @@ int user_options_getopt (hashcat_ctx_t *hashcat_ctx, int argc, char **argv)
|
||||
case IDX_ENCODING_TO: user_options->encoding_to = optarg; break;
|
||||
case IDX_INDUCTION_DIR: user_options->induction_dir = optarg; break;
|
||||
case IDX_OUTFILE_CHECK_DIR: user_options->outfile_check_dir = optarg; break;
|
||||
case IDX_EXAMPLE_HASHES: user_options->example_hashes = true; break;
|
||||
case IDX_FORCE: user_options->force = true; break;
|
||||
case IDX_SELF_TEST_DISABLE: user_options->self_test_disable = true; break;
|
||||
case IDX_SKIP: user_options->skip = atoll (optarg); break;
|
||||
@@ -1028,6 +1031,13 @@ int user_options_sanity (hashcat_ctx_t *hashcat_ctx)
|
||||
show_error = false;
|
||||
}
|
||||
}
|
||||
else if (user_options->example_hashes == true)
|
||||
{
|
||||
if (user_options->hc_argc == 0)
|
||||
{
|
||||
show_error = false;
|
||||
}
|
||||
}
|
||||
else if (user_options->opencl_info == true)
|
||||
{
|
||||
if (user_options->hc_argc == 0)
|
||||
@@ -1177,14 +1187,19 @@ void user_options_session_auto (hashcat_ctx_t *hashcat_ctx)
|
||||
user_options->session = "benchmark";
|
||||
}
|
||||
|
||||
if (user_options->example_hashes == true)
|
||||
{
|
||||
user_options->session = "example_hashes";
|
||||
}
|
||||
|
||||
if (user_options->speed_only == true)
|
||||
{
|
||||
user_options->session = "speed-only";
|
||||
user_options->session = "speed_only";
|
||||
}
|
||||
|
||||
if (user_options->progress_only == true)
|
||||
{
|
||||
user_options->session = "progress-only";
|
||||
user_options->session = "progress_only";
|
||||
}
|
||||
|
||||
if (user_options->keyspace == true)
|
||||
@@ -1227,11 +1242,12 @@ 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
|
||||
|| user_options->progress_only == true)
|
||||
if (user_options->example_hashes == true
|
||||
|| 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;
|
||||
@@ -1277,6 +1293,11 @@ void user_options_preprocess (hashcat_ctx_t *hashcat_ctx)
|
||||
}
|
||||
}
|
||||
|
||||
if (user_options->example_hashes == true)
|
||||
{
|
||||
user_options->quiet = true;
|
||||
}
|
||||
|
||||
if (user_options->progress_only == true)
|
||||
{
|
||||
user_options->speed_only = true;
|
||||
@@ -1373,7 +1394,11 @@ void user_options_preprocess (hashcat_ctx_t *hashcat_ctx)
|
||||
|
||||
if (user_options->attack_mode == ATTACK_MODE_BF)
|
||||
{
|
||||
if (user_options->opencl_info == true)
|
||||
if (user_options->example_hashes == true)
|
||||
{
|
||||
|
||||
}
|
||||
else if (user_options->opencl_info == true)
|
||||
{
|
||||
|
||||
}
|
||||
@@ -1462,6 +1487,10 @@ void user_options_extra_init (hashcat_ctx_t *hashcat_ctx)
|
||||
if (user_options->benchmark == true)
|
||||
{
|
||||
|
||||
}
|
||||
else if (user_options->example_hashes == true)
|
||||
{
|
||||
|
||||
}
|
||||
else if (user_options->opencl_info == true)
|
||||
{
|
||||
@@ -2107,6 +2136,7 @@ void user_options_logger (hashcat_ctx_t *hashcat_ctx)
|
||||
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->example_hashes);
|
||||
logfile_top_uint (user_options->force);
|
||||
logfile_top_uint (user_options->gpu_temp_abort);
|
||||
logfile_top_uint (user_options->gpu_temp_disable);
|
||||
|
||||
+6
-5
@@ -498,11 +498,12 @@ int wl_data_init (hashcat_ctx_t *hashcat_ctx)
|
||||
|
||||
wl_data->enabled = false;
|
||||
|
||||
if (user_options->benchmark == true) return 0;
|
||||
if (user_options->left == true) return 0;
|
||||
if (user_options->opencl_info == 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->example_hashes == true) return 0;
|
||||
if (user_options->left == true) return 0;
|
||||
if (user_options->opencl_info == true) return 0;
|
||||
if (user_options->usage == true) return 0;
|
||||
if (user_options->version == true) return 0;
|
||||
|
||||
wl_data->enabled = true;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user