1
mirror of https://github.com/hashcat/hashcat synced 2024-11-20 23:27:31 +01:00

Removed option --example-hashes, now is an alias of --hash-info

This commit is contained in:
Gabriele Gristina 2020-12-29 07:56:20 +01:00
parent 3ed1f0d840
commit 77e328d659
26 changed files with 10 additions and 197 deletions

View File

@ -19,7 +19,8 @@
## Features
##
- Added option --hash-info to print generic information on hash types supported
- Added option --hash-info to show generic information for each hash-mode
- Removed option --example-hashes, now is an alias of --hash-info
##
## Bugs

View File

@ -43,8 +43,6 @@ void compress_terminal_line_length (char *out_buf, const size_t keep_from_beginn
void hash_info (hashcat_ctx_t *hashcat_ctx);
void example_hashes (hashcat_ctx_t *hashcat_ctx);
void backend_info (hashcat_ctx_t *hashcat_ctx);
void backend_info_compact (hashcat_ctx_t *hashcat_ctx);

View File

@ -591,7 +591,6 @@ typedef enum user_options_defaults
BRAIN_SESSION = 0,
#endif
DEBUG_MODE = 0,
EXAMPLE_HASHES = false,
FORCE = false,
HWMON_DISABLE = false,
HWMON_TEMP_ABORT = 90,
@ -697,11 +696,10 @@ typedef enum user_options_map
IDX_DEBUG_MODE = 0xff11,
IDX_ENCODING_FROM = 0xff12,
IDX_ENCODING_TO = 0xff13,
IDX_EXAMPLE_HASHES = 0xff14,
IDX_HASH_INFO = 0xff14,
IDX_FORCE = 0xff15,
IDX_HWMON_DISABLE = 0xff16,
IDX_HWMON_TEMP_ABORT = 0xff17,
IDX_HASH_INFO = 0xff4d, // must be changed before merging
IDX_HASH_MODE = 'm',
IDX_HCCAPX_MESSAGE_PAIR = 0xff18,
IDX_HELP = 'h',
@ -1940,7 +1938,6 @@ typedef struct user_options
bool brain_client;
bool brain_server;
#endif
bool example_hashes;
bool force;
bool hwmon_disable;
bool hash_info;

View File

@ -4,7 +4,7 @@
##
SHARED ?= 0
DEBUG := 1
DEBUG := 0
PRODUCTION := 0
PRODUCTION_VERSION := v6.1.1
ENABLE_CUBIN ?= 1

View File

@ -4957,7 +4957,6 @@ int backend_ctx_init (hashcat_ctx_t *hashcat_ctx)
backend_ctx->enabled = false;
if (user_options->hash_info == 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;

View File

@ -80,7 +80,6 @@ int bitmap_ctx_init (hashcat_ctx_t *hashcat_ctx)
bitmap_ctx->enabled = false;
if (user_options->hash_info == 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->backend_info == true) return 0;

View File

@ -20,7 +20,6 @@ int combinator_ctx_init (hashcat_ctx_t *hashcat_ctx)
combinator_ctx->enabled = false;
if (user_options->hash_info == true) return 0;
if (user_options->example_hashes == true) return 0;
if (user_options->left == true) return 0;
if (user_options->backend_info == true) return 0;
if (user_options->show == true) return 0;

View File

@ -16,7 +16,6 @@ int cpt_ctx_init (hashcat_ctx_t *hashcat_ctx)
cpt_ctx->enabled = false;
if (user_options->hash_info == 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->backend_info == true) return 0;

View File

@ -88,7 +88,6 @@ int debugfile_init (hashcat_ctx_t *hashcat_ctx)
if (user_options->benchmark == true) return 0;
if (user_options->hash_info == 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->backend_info == true) return 0;

View File

@ -58,7 +58,6 @@ int dictstat_init (hashcat_ctx_t *hashcat_ctx)
if (user_options->benchmark == true) return 0;
if (user_options->hash_info == 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->backend_info == true) return 0;

View File

@ -904,9 +904,6 @@ int hashes_init_stage1 (hashcat_ctx_t *hashcat_ctx)
else if (user_options->hash_info == true)
{
}
else if (user_options->example_hashes == true)
{
}
else if (user_options->keyspace == true)
{
}

View File

@ -2226,7 +2226,6 @@ int hwmon_ctx_init (hashcat_ctx_t *hashcat_ctx)
#endif // WITH_HWMON
if (user_options->hash_info == 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->backend_info == true) return 0;

View File

@ -41,7 +41,6 @@ int induct_ctx_init (hashcat_ctx_t *hashcat_ctx)
if (user_options->benchmark == true) return 0;
if (user_options->hash_info == 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->backend_info == true) return 0;

View File

@ -333,7 +333,7 @@ int hashconfig_init (hashcat_ctx_t *hashcat_ctx)
hashconfig->has_optimized_kernel = hc_path_read (source_file);
if (user_options->example_hashes == false && user_options->hash_info == false)
if (user_options->hash_info == false)
{
if (user_options->optimized_kernel_enable == true)
{

View File

@ -62,7 +62,6 @@ int loopback_init (hashcat_ctx_t *hashcat_ctx)
if (user_options->benchmark == true) return 0;
if (user_options->hash_info == 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->backend_info == true) return 0;

View File

@ -185,7 +185,6 @@ static void main_outerloop_starting (MAYBE_UNUSED hashcat_ctx_t *hashcat_ctx, MA
status_ctx->shutdown_outer = false;
if (user_options->hash_info == true) return;
if (user_options->example_hashes == true) return;
if (user_options->keyspace == true) return;
if (user_options->stdout_flag == true) return;
if (user_options->backend_info == true) return;
@ -262,7 +261,6 @@ static void main_cracker_finished (MAYBE_UNUSED hashcat_ctx_t *hashcat_ctx, MAYB
const user_options_extra_t *user_options_extra = hashcat_ctx->user_options_extra;
if (user_options->hash_info == true) return;
if (user_options->example_hashes == true) return;
if (user_options->keyspace == true) return;
if (user_options->backend_info == true) return;
if (user_options->stdout_flag == true) return;
@ -1168,12 +1166,6 @@ int main (int argc, char **argv)
rc_final = 0;
}
else if (user_options->example_hashes == true)
{
example_hashes (hashcat_ctx);
rc_final = 0;
}
else if (user_options->backend_info == true)
{
// if this is just backend_info, no need to execute some real cracking session

View File

@ -1392,7 +1392,6 @@ int mask_ctx_init (hashcat_ctx_t *hashcat_ctx)
mask_ctx->enabled = false;
if (user_options->hash_info == true) return 0;
if (user_options->example_hashes == true) return 0;
if (user_options->left == true) return 0;
if (user_options->backend_info == true) return 0;
if (user_options->show == true) return 0;

View File

@ -361,7 +361,6 @@ 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->hash_info == 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->backend_info == true) return 0;

View File

@ -112,7 +112,6 @@ int potfile_init (hashcat_ctx_t *hashcat_ctx)
if (user_options->benchmark == true) return 0;
if (user_options->hash_info == true) return 0;
if (user_options->example_hashes == true) return 0;
if (user_options->keyspace == true) return 0;
if (user_options->backend_info == true) return 0;
if (user_options->stdout_flag == true) return 0;

View File

@ -300,7 +300,6 @@ int restore_ctx_init (hashcat_ctx_t *hashcat_ctx, int argc, char **argv)
if (user_options->benchmark == true) return 0;
if (user_options->hash_info == 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->backend_info == true) return 0;

View File

@ -262,7 +262,6 @@ int straight_ctx_init (hashcat_ctx_t *hashcat_ctx)
straight_ctx->enabled = false;
if (user_options->hash_info == true) return 0;
if (user_options->example_hashes == true) return 0;
if (user_options->left == true) return 0;
if (user_options->backend_info == true) return 0;
if (user_options->show == true) return 0;

View File

@ -660,133 +660,6 @@ void hash_info (hashcat_ctx_t *hashcat_ctx)
}
}
void example_hashes (hashcat_ctx_t *hashcat_ctx)
{
folder_config_t *folder_config = hashcat_ctx->folder_config;
user_options_t *user_options = hashcat_ctx->user_options;
if (user_options->hash_mode_chgd == true)
{
if (hashconfig_init (hashcat_ctx) == 0)
{
hashconfig_t *hashconfig = hashcat_ctx->hashconfig;
event_log_info (hashcat_ctx, "MODE: %u", hashconfig->hash_mode);
event_log_info (hashcat_ctx, "TYPE: %s", hashconfig->hash_name);
if ((hashconfig->st_hash != NULL) && (hashconfig->st_pass != NULL))
{
if (hashconfig->opts_type & OPTS_TYPE_BINARY_HASHFILE)
{
event_log_info (hashcat_ctx, "HASH (hex-encoded): %s", hashconfig->st_hash);
}
else
{
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, false))
{
char tmp_buf[HCBUFSIZ_LARGE] = { 0 };
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
{
char *modulefile = (char *) hcmalloc (HCBUFSIZ_TINY);
for (int i = 0; i < MODULE_HASH_MODES_MAXIMUM; i++)
{
user_options->hash_mode = i;
module_filename (folder_config, i, modulefile, HCBUFSIZ_TINY);
if (hc_path_exist (modulefile) == false) continue;
if (hashconfig_init (hashcat_ctx) == 0)
{
hashconfig_t *hashconfig = hashcat_ctx->hashconfig;
event_log_info (hashcat_ctx, "MODE: %u", hashconfig->hash_mode);
event_log_info (hashcat_ctx, "TYPE: %s", hashconfig->hash_name);
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, false))
{
char tmp_buf[HCBUFSIZ_LARGE] = { 0 };
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);
}
hcfree (modulefile);
}
}
void backend_info (hashcat_ctx_t *hashcat_ctx)
{
const backend_ctx_t *backend_ctx = hashcat_ctx->backend_ctx;

View File

@ -55,7 +55,6 @@ int tuning_db_init (hashcat_ctx_t *hashcat_ctx)
tuning_db->enabled = false;
if (user_options->hash_info == 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->backend_info == true) return 0;

View File

@ -90,7 +90,7 @@ static const char *const USAGE_BIG_PRE_HASHMODES[] =
" --cpu-affinity | Str | Locks to CPU devices, separated with commas | --cpu-affinity=1,2,3",
" --hook-threads | Num | Sets number of threads for a hook (per compute unit) | --hook-threads=8",
" --hash-info | | Show information for each hash-mode |",
" --example-hashes | | Show an example hash for each hash-mode |",
" --example-hashes | | Alias of --hash-info |",
" --backend-ignore-cuda | | Do not try to open CUDA interface on startup |",
" --backend-ignore-opencl | | Do not try to open OpenCL interface on startup |",
" -I, --backend-info | | Show info about detected backend API devices | -I",

View File

@ -47,7 +47,7 @@ static const struct option long_options[] =
{"debug-mode", required_argument, NULL, IDX_DEBUG_MODE},
{"encoding-from", required_argument, NULL, IDX_ENCODING_FROM},
{"encoding-to", required_argument, NULL, IDX_ENCODING_TO},
{"example-hashes", no_argument, NULL, IDX_EXAMPLE_HASHES},
{"example-hashes", no_argument, NULL, IDX_HASH_INFO}, // alias of hash-info
{"force", no_argument, NULL, IDX_FORCE},
{"generate-rules-func-max", required_argument, NULL, IDX_RP_GEN_FUNC_MAX},
{"generate-rules-func-min", required_argument, NULL, IDX_RP_GEN_FUNC_MIN},
@ -185,7 +185,6 @@ int user_options_init (hashcat_ctx_t *hashcat_ctx)
user_options->debug_mode = DEBUG_MODE;
user_options->encoding_from = ENCODING_FROM;
user_options->encoding_to = ENCODING_TO;
user_options->example_hashes = EXAMPLE_HASHES;
user_options->force = FORCE;
user_options->hwmon_disable = HWMON_DISABLE;
user_options->hwmon_temp_abort = HWMON_TEMP_ABORT;
@ -383,7 +382,6 @@ int user_options_getopt (hashcat_ctx_t *hashcat_ctx, int argc, char **argv)
case IDX_INDUCTION_DIR: user_options->induction_dir = optarg; break;
case IDX_OUTFILE_CHECK_DIR: user_options->outfile_check_dir = optarg; break;
case IDX_HASH_INFO: user_options->hash_info = true; 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 = hc_strtoull (optarg, NULL, 10);
@ -1401,13 +1399,6 @@ 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->backend_info == true)
{
if (user_options->hc_argc == 0)
@ -1604,11 +1595,6 @@ void user_options_session_auto (hashcat_ctx_t *hashcat_ctx)
user_options->session = "hash_info";
}
if (user_options->example_hashes == true)
{
user_options->session = "example_hashes";
}
if (user_options->usage == true)
{
user_options->session = "usage";
@ -1682,8 +1668,7 @@ void user_options_preprocess (hashcat_ctx_t *hashcat_ctx)
user_options->bitmap_max = 1;
}
if (user_options->example_hashes == true
|| user_options->hash_info == true
if (user_options->hash_info == true
|| user_options->backend_info == true
|| user_options->keyspace == true
|| user_options->speed_only == true
@ -1744,11 +1729,6 @@ void user_options_preprocess (hashcat_ctx_t *hashcat_ctx)
user_options->quiet = true;
}
if (user_options->example_hashes == true)
{
user_options->quiet = true;
}
if (user_options->usage == true)
{
user_options->quiet = true;
@ -1858,11 +1838,7 @@ void user_options_preprocess (hashcat_ctx_t *hashcat_ctx)
if (user_options->attack_mode == ATTACK_MODE_BF)
{
if (user_options->example_hashes == true)
{
}
else if (user_options->hash_info == true)
if (user_options->hash_info == true)
{
}
@ -2086,10 +2062,6 @@ void user_options_extra_init (hashcat_ctx_t *hashcat_ctx)
else if (user_options->hash_info == true)
{
}
else if (user_options->example_hashes == true)
{
}
else if (user_options->backend_info == true)
{
@ -3030,11 +3002,10 @@ 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->hash_info);
logfile_top_uint (user_options->force);
logfile_top_uint (user_options->hwmon_disable);
logfile_top_uint (user_options->hwmon_temp_abort);
logfile_top_uint (user_options->hash_info);
logfile_top_uint (user_options->hash_mode);
logfile_top_uint (user_options->hex_charset);
logfile_top_uint (user_options->hex_salt);

View File

@ -589,7 +589,6 @@ int wl_data_init (hashcat_ctx_t *hashcat_ctx)
if (user_options->benchmark == true) return 0;
if (user_options->hash_info == true) return 0;
if (user_options->example_hashes == true) return 0;
if (user_options->left == true) return 0;
if (user_options->backend_info == true) return 0;
if (user_options->usage == true) return 0;