Compare commits

...

2 Commits

@ -685,6 +685,7 @@ typedef enum user_options_defaults
OUTFILE_AUTOHEX = true,
OUTFILE_CHECK_TIMER = 5,
OUTFILE_FORMAT = 3,
OUTFILE_JSON = false,
POTFILE_DISABLE = false,
PROGRESS_ONLY = false,
QUIET = false,
@ -799,48 +800,49 @@ typedef enum user_options_map
IDX_OUTFILE_CHECK_DIR = 0xff32,
IDX_OUTFILE_CHECK_TIMER = 0xff33,
IDX_OUTFILE_FORMAT = 0xff34,
IDX_OUTFILE_JSON = 0xff35,
IDX_OUTFILE = 'o',
IDX_POTFILE_DISABLE = 0xff35,
IDX_POTFILE_PATH = 0xff36,
IDX_PROGRESS_ONLY = 0xff37,
IDX_QUIET = 0xff38,
IDX_REMOVE = 0xff39,
IDX_REMOVE_TIMER = 0xff3a,
IDX_RESTORE = 0xff3b,
IDX_RESTORE_DISABLE = 0xff3c,
IDX_RESTORE_FILE_PATH = 0xff3d,
IDX_POTFILE_DISABLE = 0xff36,
IDX_POTFILE_PATH = 0xff37,
IDX_PROGRESS_ONLY = 0xff38,
IDX_QUIET = 0xff39,
IDX_REMOVE = 0xff3a,
IDX_REMOVE_TIMER = 0xff3b,
IDX_RESTORE = 0xff3c,
IDX_RESTORE_DISABLE = 0xff3d,
IDX_RESTORE_FILE_PATH = 0xff3e,
IDX_RP_FILE = 'r',
IDX_RP_GEN_FUNC_MAX = 0xff3e,
IDX_RP_GEN_FUNC_MIN = 0xff3f,
IDX_RP_GEN_FUNC_SEL = 0xff40,
IDX_RP_GEN_FUNC_MAX = 0xff3f,
IDX_RP_GEN_FUNC_MIN = 0xff40,
IDX_RP_GEN_FUNC_SEL = 0xff41,
IDX_RP_GEN = 'g',
IDX_RP_GEN_SEED = 0xff41,
IDX_RP_GEN_SEED = 0xff42,
IDX_RULE_BUF_L = 'j',
IDX_RULE_BUF_R = 'k',
IDX_RUNTIME = 0xff42,
IDX_SCRYPT_TMTO = 0xff43,
IDX_RUNTIME = 0xff43,
IDX_SCRYPT_TMTO = 0xff44,
IDX_SEGMENT_SIZE = 'c',
IDX_SELF_TEST_DISABLE = 0xff44,
IDX_SELF_TEST_DISABLE = 0xff45,
IDX_SEPARATOR = 'p',
IDX_SESSION = 0xff45,
IDX_SHOW = 0xff46,
IDX_SESSION = 0xff46,
IDX_SHOW = 0xff47,
IDX_SKIP = 's',
IDX_SLOW_CANDIDATES = 'S',
IDX_SPEED_ONLY = 0xff47,
IDX_SPIN_DAMP = 0xff48,
IDX_STATUS = 0xff49,
IDX_STATUS_JSON = 0xff4a,
IDX_STATUS_TIMER = 0xff4b,
IDX_STDOUT_FLAG = 0xff4c,
IDX_STDIN_TIMEOUT_ABORT = 0xff4d,
IDX_TRUECRYPT_KEYFILES = 0xff4e,
IDX_USERNAME = 0xff4f,
IDX_VERACRYPT_KEYFILES = 0xff50,
IDX_VERACRYPT_PIM_START = 0xff51,
IDX_VERACRYPT_PIM_STOP = 0xff52,
IDX_SPEED_ONLY = 0xff48,
IDX_SPIN_DAMP = 0xff49,
IDX_STATUS = 0xff4a,
IDX_STATUS_JSON = 0xff4b,
IDX_STATUS_TIMER = 0xff4c,
IDX_STDOUT_FLAG = 0xff4d,
IDX_STDIN_TIMEOUT_ABORT = 0xff4e,
IDX_TRUECRYPT_KEYFILES = 0xff4f,
IDX_USERNAME = 0xff50,
IDX_VERACRYPT_KEYFILES = 0xff51,
IDX_VERACRYPT_PIM_START = 0xff52,
IDX_VERACRYPT_PIM_STOP = 0xff53,
IDX_VERSION_LOWER = 'v',
IDX_VERSION = 'V',
IDX_WORDLIST_AUTOHEX_DISABLE = 0xff53,
IDX_WORDLIST_AUTOHEX_DISABLE = 0xff54,
IDX_WORKLOAD_PROFILE = 'w',
} user_options_map_t;
@ -2105,6 +2107,7 @@ typedef struct outfile_ctx
u32 outfile_format;
bool outfile_autohex;
bool outfile_json;
bool is_fifo;
char *filename;
@ -2351,6 +2354,7 @@ typedef struct user_options
bool optimized_kernel_enable;
bool multiply_accel_disable;
bool outfile_autohex;
bool outfile_json;
bool potfile_disable;
bool progress_only;
bool quiet;

@ -57,6 +57,7 @@ static const char *const USAGE_BIG_PRE_HASHMODES[] =
" --restore-file-path | File | Specific path to restore file | --restore-file-path=x.restore",
" -o, --outfile | File | Define outfile for recovered hash | -o outfile.txt",
" --outfile-format | Str | Outfile format to use, separated with commas | --outfile-format=1,3",
" --outfile-json | | Force JSON format in outfile format |",
" --outfile-autohex-disable | | Disable the use of $HEX[] in output plains |",
" --outfile-check-timer | Num | Sets seconds between outfile checks to X | --outfile-check-timer=30",
" --wordlist-autohex-disable | | Disable the conversion of $HEX[] from the wordlist |",

@ -103,6 +103,7 @@ static const struct option long_options[] =
{"outfile-check-dir", required_argument, NULL, IDX_OUTFILE_CHECK_DIR},
{"outfile-check-timer", required_argument, NULL, IDX_OUTFILE_CHECK_TIMER},
{"outfile-format", required_argument, NULL, IDX_OUTFILE_FORMAT},
{"outfile-json", no_argument, NULL, IDX_OUTFILE_JSON},
{"outfile", required_argument, NULL, IDX_OUTFILE},
{"potfile-disable", no_argument, NULL, IDX_POTFILE_DISABLE},
{"potfile-path", required_argument, NULL, IDX_POTFILE_PATH},
@ -246,6 +247,7 @@ int user_options_init (hashcat_ctx_t *hashcat_ctx)
user_options->outfile_check_dir = NULL;
user_options->outfile_check_timer = OUTFILE_CHECK_TIMER;
user_options->outfile_format = OUTFILE_FORMAT;
user_options->outfile_json = OUTFILE_JSON;
user_options->outfile = NULL;
user_options->potfile_disable = POTFILE_DISABLE;
user_options->potfile_path = NULL;
@ -463,6 +465,7 @@ int user_options_getopt (hashcat_ctx_t *hashcat_ctx, int argc, char **argv)
user_options->outfile_chgd = true; break;
case IDX_OUTFILE_FORMAT: user_options->outfile_format = outfile_format_parse (optarg);
user_options->outfile_format_chgd = true; break;
case IDX_OUTFILE_JSON: user_options->outfile_json = true; break;
case IDX_OUTFILE_AUTOHEX_DISABLE: user_options->outfile_autohex = false; break;
case IDX_OUTFILE_CHECK_TIMER: user_options->outfile_check_timer = hc_strtoul (optarg, NULL, 10); break;
case IDX_WORDLIST_AUTOHEX_DISABLE: user_options->wordlist_autohex_disable = true; break;
@ -1078,6 +1081,13 @@ int user_options_sanity (hashcat_ctx_t *hashcat_ctx)
return -1;
}
if (user_options->outfile_json == false)
{
event_log_error (hashcat_ctx, "Mixing --outfile-json is not allowed with --show.");
return -1;
}
}
if (user_options->keyspace == true)
@ -3252,6 +3262,7 @@ void user_options_logger (hashcat_ctx_t *hashcat_ctx)
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->outfile_json);
logfile_top_uint (user_options->wordlist_autohex_disable);
logfile_top_uint (user_options->potfile_disable);
logfile_top_uint (user_options->progress_only);

Loading…
Cancel
Save