Added option --keep-guessing to continue cracking hashes even after they have been cracked.

It will be useful if there are multiple collisions and we want a specific one.
This one implements https://github.com/hashcat/hashcat/issues/493
pull/570/head
jsteube 8 years ago
parent 5c8d08d8ef
commit 6d2ce0d71a

@ -16,6 +16,7 @@
- Reduce max. number of allowed function calls per rule from 256 to 32 to save GPU memory
- Status display shows what's the base and modifier keyspace currently in use
- Added a workaround for some OpenCL kernel to compile with amd-gpu-pro
- Added option --keep-guessing to continue cracking hashes even after they have been cracked (to find collisions)
##
## Algorithms

@ -174,9 +174,9 @@ _hashcat_contains ()
_hashcat ()
{
local VERSION=2.10
local VERSION=3.10
local HASH_MODES="0 10 11 12 20 21 22 23 30 40 50 60 100 101 110 111 112 120 121 122 124 130 131 132 133 140 141 150 160 200 300 400 500 501 900 1000 1100 1400 1410 1420 1421 1430 1440 1441 1450 1460 1500 1600 1700 1710 1711 1720 1722 1730 1731 1740 1750 1760 1800 2100 2400 2410 2500 2600 2611 2612 2711 2811 3000 3100 3200 3710 3711 3800 4300 4400 4500 4700 4800 4900 5000 5100 5200 5300 5400 5500 5600 5700 5800 6000 6100 6211 6212 6213 6221 6222 6223 6231 6232 6233 6241 6242 6243 6300 6400 6500 6600 6700 6800 6900 7100 7200 7300 7400 7500 7600 7700 7800 7900 8000 8100 8200 8300 8400 8500 8600 8700 8800 8900 9000 9100 9200 9300 9400 9500 9600 9700 9710 9720 9800 9810 9820 9900 10000 10100 10200 10300 10400 10410 10420 10500 10600 10700 10800 10900 11000 11100 11200 11300 11400 11500 11600 11700 11800 11900 12000 12100 12200 12300 12400 12500 12600 12700 12800 12900 13000"
local HASH_MODES="0 10 11 12 20 21 22 23 30 40 50 60 100 101 110 111 112 120 121 122 124 130 131 132 133 140 141 150 160 200 300 400 500 501 900 1000 1100 1400 1410 1420 1421 1430 1440 1441 1450 1460 1500 1600 1700 1710 1711 1720 1722 1730 1731 1740 1750 1760 1800 2100 2400 2410 2500 2600 2611 2612 2711 2811 3000 3100 3200 3710 3711 3800 4300 4400 4500 4700 4800 4900 5000 5100 5200 5300 5400 5500 5600 5700 5800 6000 6100 6211 6212 6213 6221 6222 6223 6231 6232 6233 6241 6242 6243 6300 6400 6500 6600 6700 6800 6900 7100 7200 7300 7400 7500 7600 7700 7800 7900 8000 8100 8200 8300 8400 8500 8600 8700 8800 8900 9000 9100 9200 9300 9400 9500 9600 9700 9710 9720 9800 9810 9820 9900 10000 10100 10200 10300 10400 10410 10420 10500 10600 10700 10800 10900 11000 11100 11200 11300 11400 11500 11600 11700 11800 11900 12000 12100 12200 12300 12400 12500 12600 12700 12800 12900 13000 13100 13200 13300 13400 13500 13600 13800 13900 14000 14100"
local ATTACK_MODES="0 1 3 6 7"
local OUTFILE_FORMATS="1 2 3 4 5 6 7 8 9 10 11 12 13 14 15"
local OPENCL_DEVICE_TYPES="1 2 3"
@ -188,7 +188,7 @@ _hashcat ()
local BUILD_IN_CHARSETS='?l ?u ?d ?a ?b ?s'
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 --eula --quiet --benchmark --benchmark-repeats --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 --rules-cleanup --custom-charset1 --custom-charset2 --custom-charset3 --custom-charset4 --increment --increment-min --increment-max --logfile-disable --scrypt-tmto --truecrypt-keyfiles"
local LONG_OPTS="--hash-type --attack-mode --version --help --eula --quiet --benchmark --benchmark-repeats --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 --rules-cleanup --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 --benchmark-repeats --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=()

@ -466,6 +466,159 @@ typedef enum progress_mode
} progress_mode_t;
typedef enum user_options_defaults
{
ATTACK_MODE = ATTACK_MODE_STRAIGHT,
BENCHMARK = false,
BITMAP_MAX = 24,
BITMAP_MIN = 16,
DEBUG_MODE = 0,
FORCE = false,
GPU_TEMP_ABORT = 90,
GPU_TEMP_DISABLE = false,
GPU_TEMP_RETAIN = 75,
HASH_MODE = 0,
HEX_CHARSET = false,
HEX_SALT = false,
HEX_WORDLIST = false,
INCREMENT = false,
INCREMENT_MAX = PW_MAX,
INCREMENT_MIN = 1,
KEEP_GUESSING = false,
KERNEL_ACCEL = 0,
KERNEL_LOOPS = 0,
KEYSPACE = false,
LEFT = false,
LIMIT = 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 = true,
OUTFILE_CHECK_TIMER = 5,
OUTFILE_FORMAT = 3,
POTFILE_DISABLE = false,
POWERTUNE_ENABLE = false,
QUIET = false,
REMOVE = false,
REMOVE_TIMER = 60,
RESTORE = false,
RESTORE_DISABLE = false,
RESTORE_TIMER = 60,
RP_GEN = 0,
RP_GEN_FUNC_MAX = 4,
RP_GEN_FUNC_MIN = 1,
RP_GEN_SEED = 0,
RUNTIME = 0,
SCRYPT_TMTO = 0,
SEGMENT_SIZE = 33554432,
SEPARATOR = ':',
SHOW = false,
SKIP = 0,
STATUS = false,
STATUS_TIMER = 10,
STDOUT_FLAG = false,
SPEED_ONLY = false,
USAGE = false,
USERNAME = false,
VERSION = false,
WEAK_HASH_THRESHOLD = 100,
WORKLOAD_PROFILE = 2,
} user_options_defaults_t;
typedef enum user_options_map
{
IDX_ATTACK_MODE = 'a',
IDX_BENCHMARK = 'b',
IDX_BITMAP_MAX = 0xff00,
IDX_BITMAP_MIN = 0xff01,
IDX_CPU_AFFINITY = 0xff02,
IDX_CUSTOM_CHARSET_1 = '1',
IDX_CUSTOM_CHARSET_2 = '2',
IDX_CUSTOM_CHARSET_3 = '3',
IDX_CUSTOM_CHARSET_4 = '4',
IDX_DEBUG_FILE = 0xff03,
IDX_DEBUG_MODE = 0xff04,
IDX_FORCE = 0xff05,
IDX_GPU_TEMP_ABORT = 0xff06,
IDX_GPU_TEMP_DISABLE = 0xff07,
IDX_GPU_TEMP_RETAIN = 0xff08,
IDX_HASH_MODE = 'm',
IDX_HELP = 'h',
IDX_HEX_CHARSET = 0xff09,
IDX_HEX_SALT = 0xff0a,
IDX_HEX_WORDLIST = 0xff0b,
IDX_INCREMENT = 'i',
IDX_INCREMENT_MAX = 0xff0c,
IDX_INCREMENT_MIN = 0xff0d,
IDX_INDUCTION_DIR = 0xff0e,
IDX_KEEP_GUESSING = 0xff0f,
IDX_KERNEL_ACCEL = 'n',
IDX_KERNEL_LOOPS = 'u',
IDX_KEYSPACE = 0xff10,
IDX_LEFT = 0xff11,
IDX_LIMIT = 'l',
IDX_LOGFILE_DISABLE = 0xff12,
IDX_LOOPBACK = 0xff13,
IDX_MACHINE_READABLE = 0xff14,
IDX_MARKOV_CLASSIC = 0xff15,
IDX_MARKOV_DISABLE = 0xff16,
IDX_MARKOV_HCSTAT = 0xff17,
IDX_MARKOV_THRESHOLD = 't',
IDX_NVIDIA_SPIN_DAMP = 0xff18,
IDX_OPENCL_DEVICES = 'd',
IDX_OPENCL_DEVICE_TYPES = 'D',
IDX_OPENCL_INFO = 'I',
IDX_OPENCL_PLATFORMS = 0xff19,
IDX_OPENCL_VECTOR_WIDTH = 0xff1a,
IDX_OUTFILE_AUTOHEX_DISABLE = 0xff1b,
IDX_OUTFILE_CHECK_DIR = 0xff1c,
IDX_OUTFILE_CHECK_TIMER = 0xff1d,
IDX_OUTFILE_FORMAT = 0xff1e,
IDX_OUTFILE = 'o',
IDX_POTFILE_DISABLE = 0xff1f,
IDX_POTFILE_PATH = 0xff20,
IDX_POWERTUNE_ENABLE = 0xff21,
IDX_QUIET = 0xff22,
IDX_REMOVE = 0xff23,
IDX_REMOVE_TIMER = 0xff24,
IDX_RESTORE = 0xff25,
IDX_RESTORE_DISABLE = 0xff26,
IDX_RESTORE_FILE_PATH = 0xff27,
IDX_RP_FILE = 'r',
IDX_RP_GEN_FUNC_MAX = 0xff28,
IDX_RP_GEN_FUNC_MIN = 0xff29,
IDX_RP_GEN = 'g',
IDX_RP_GEN_SEED = 0xff2a,
IDX_RULE_BUF_L = 'j',
IDX_RULE_BUF_R = 'k',
IDX_RUNTIME = 0xff2b,
IDX_SCRYPT_TMTO = 0xff2c,
IDX_SEGMENT_SIZE = 'c',
IDX_SEPARATOR = 'p',
IDX_SESSION = 0xff2d,
IDX_SHOW = 0xff2e,
IDX_SKIP = 's',
IDX_STATUS = 0xff2f,
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_VERSION_LOWER = 'v',
IDX_VERSION = 'V',
IDX_WEAK_HASH_THRESHOLD = 0xff37,
IDX_WORKLOAD_PROFILE = 'w'
} user_options_map_t;
/**
* structs
*/
@ -1182,6 +1335,7 @@ typedef struct user_options
bool hex_salt;
bool hex_wordlist;
bool increment;
bool keep_guessing;
bool keyspace;
bool left;
bool logfile_disable;

@ -8,157 +8,6 @@
#include <getopt.h>
typedef enum user_options_defaults
{
ATTACK_MODE = ATTACK_MODE_STRAIGHT,
BENCHMARK = false,
BITMAP_MAX = 24,
BITMAP_MIN = 16,
DEBUG_MODE = 0,
FORCE = false,
GPU_TEMP_ABORT = 90,
GPU_TEMP_DISABLE = false,
GPU_TEMP_RETAIN = 75,
HASH_MODE = 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 = false,
LEFT = false,
LIMIT = 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 = true,
OUTFILE_CHECK_TIMER = 5,
OUTFILE_FORMAT = 3,
POTFILE_DISABLE = false,
POWERTUNE_ENABLE = false,
QUIET = false,
REMOVE = false,
REMOVE_TIMER = 60,
RESTORE = false,
RESTORE_DISABLE = false,
RESTORE_TIMER = 60,
RP_GEN = 0,
RP_GEN_FUNC_MAX = 4,
RP_GEN_FUNC_MIN = 1,
RP_GEN_SEED = 0,
RUNTIME = 0,
SCRYPT_TMTO = 0,
SEGMENT_SIZE = 33554432,
SEPARATOR = ':',
SHOW = false,
SKIP = 0,
STATUS = false,
STATUS_TIMER = 10,
STDOUT_FLAG = false,
SPEED_ONLY = false,
USAGE = false,
USERNAME = false,
VERSION = false,
WEAK_HASH_THRESHOLD = 100,
WORKLOAD_PROFILE = 2,
} user_options_defaults_t;
typedef enum user_options_map
{
IDX_ATTACK_MODE = 'a',
IDX_BENCHMARK = 'b',
IDX_BITMAP_MAX = 0xff00,
IDX_BITMAP_MIN = 0xff01,
IDX_CPU_AFFINITY = 0xff02,
IDX_CUSTOM_CHARSET_1 = '1',
IDX_CUSTOM_CHARSET_2 = '2',
IDX_CUSTOM_CHARSET_3 = '3',
IDX_CUSTOM_CHARSET_4 = '4',
IDX_DEBUG_FILE = 0xff03,
IDX_DEBUG_MODE = 0xff04,
IDX_FORCE = 0xff05,
IDX_GPU_TEMP_ABORT = 0xff06,
IDX_GPU_TEMP_DISABLE = 0xff07,
IDX_GPU_TEMP_RETAIN = 0xff08,
IDX_HASH_MODE = 'm',
IDX_HELP = 'h',
IDX_HEX_CHARSET = 0xff09,
IDX_HEX_SALT = 0xff0a,
IDX_HEX_WORDLIST = 0xff0b,
IDX_INCREMENT = 'i',
IDX_INCREMENT_MAX = 0xff0c,
IDX_INCREMENT_MIN = 0xff0d,
IDX_INDUCTION_DIR = 0xff0e,
IDX_KERNEL_ACCEL = 'n',
IDX_KERNEL_LOOPS = 'u',
IDX_KEYSPACE = 0xff0f,
IDX_LEFT = 0xff10,
IDX_LIMIT = 'l',
IDX_LOGFILE_DISABLE = 0xff11,
IDX_LOOPBACK = 0xff12,
IDX_MACHINE_READABLE = 0xff13,
IDX_MARKOV_CLASSIC = 0xff14,
IDX_MARKOV_DISABLE = 0xff15,
IDX_MARKOV_HCSTAT = 0xff16,
IDX_MARKOV_THRESHOLD = 't',
IDX_NVIDIA_SPIN_DAMP = 0xff17,
IDX_OPENCL_DEVICES = 'd',
IDX_OPENCL_DEVICE_TYPES = 'D',
IDX_OPENCL_INFO = 'I',
IDX_OPENCL_PLATFORMS = 0xff18,
IDX_OPENCL_VECTOR_WIDTH = 0xff19,
IDX_OUTFILE_AUTOHEX_DISABLE = 0xff1a,
IDX_OUTFILE_CHECK_DIR = 0xff1b,
IDX_OUTFILE_CHECK_TIMER = 0xff1c,
IDX_OUTFILE_FORMAT = 0xff1d,
IDX_OUTFILE = 'o',
IDX_POTFILE_DISABLE = 0xff1e,
IDX_POTFILE_PATH = 0xff1f,
IDX_POWERTUNE_ENABLE = 0xff20,
IDX_QUIET = 0xff21,
IDX_REMOVE = 0xff22,
IDX_REMOVE_TIMER = 0xff23,
IDX_RESTORE = 0xff24,
IDX_RESTORE_DISABLE = 0xff25,
IDX_RESTORE_FILE_PATH = 0xff26,
IDX_RP_FILE = 'r',
IDX_RP_GEN_FUNC_MAX = 0xff27,
IDX_RP_GEN_FUNC_MIN = 0xff28,
IDX_RP_GEN = 'g',
IDX_RP_GEN_SEED = 0xff29,
IDX_RULE_BUF_L = 'j',
IDX_RULE_BUF_R = 'k',
IDX_RUNTIME = 0xff2a,
IDX_SCRYPT_TMTO = 0xff2b,
IDX_SEGMENT_SIZE = 'c',
IDX_SEPARATOR = 'p',
IDX_SESSION = 0xff2c,
IDX_SHOW = 0xff2d,
IDX_SKIP = 's',
IDX_STATUS = 0xff2e,
IDX_STATUS_TIMER = 0xff2f,
IDX_STDOUT_FLAG = 0xff30,
IDX_SPEED_ONLY = 0xff31,
IDX_TRUECRYPT_KEYFILES = 0xff32,
IDX_USERNAME = 0xff33,
IDX_VERACRYPT_KEYFILES = 0xff34,
IDX_VERACRYPT_PIM = 0xff35,
IDX_VERSION_LOWER = 'v',
IDX_VERSION = 'V',
IDX_WEAK_HASH_THRESHOLD = 0xff36,
IDX_WORKLOAD_PROFILE = 'w'
} user_options_map_t;
int user_options_init (hashcat_ctx_t *hashcat_ctx);
void user_options_destroy (hashcat_ctx_t *hashcat_ctx);

@ -19605,6 +19605,11 @@ int hashconfig_init (hashcat_ctx_t *hashcat_ctx)
}
}
if (user_options->keep_guessing)
{
hashconfig->opts_type |= OPTS_TYPE_PT_NEVERCRACK;
}
const u32 is_salted = ((hashconfig->salt_type == SALT_TYPE_INTERN)
| (hashconfig->salt_type == SALT_TYPE_EXTERN)
| (hashconfig->salt_type == SALT_TYPE_EMBEDDED)

@ -36,6 +36,7 @@ static const char *USAGE_BIG[] =
" --status | | Enable automatic update of the status-screen |",
" --status-timer | Num | Sets seconds between status-screen update to X | --status-timer=1",
" --machine-readable | | Display the status view in a machine readable format |",
" --keep-guessing | | Keep guessing the hash after it has been cracked |",
" --loopback | | Add new plains to induct directory |",
" --weak-hash-threshold | Num | Threshold X when to stop checking for weak hashes | --weak=0",
" --markov-hcstat | File | Specify hcstat file to use | --markov-hc=my.hcstat",
@ -46,7 +47,7 @@ static const char *USAGE_BIG[] =
" --session | Str | Define specific session name | --session=mysession",
" --restore | | Restore session from --session |",
" --restore-disable | | Do not write restore file |",
" --restore-file-path | Dir | Specific path to restore file | --restore-file-path=my.restore",
" --restore-file-path | File | Specific path to restore file | --restore-file-path=my.restore",
" -o, --outfile | File | Define outfile for recovered hash | -o outfile.txt",
" --outfile-format | Num | Define outfile-format X for recovered hash | --outfile-format=7",
" --outfile-autohex-disable | | Disable the use of $HEX[] in output plains |",

@ -46,6 +46,7 @@ static const struct option long_options[] =
{"increment-min", required_argument, 0, IDX_INCREMENT_MIN},
{"increment", no_argument, 0, IDX_INCREMENT},
{"induction-dir", required_argument, 0, IDX_INDUCTION_DIR},
{"keep-guessing", no_argument, 0, IDX_KEEP_GUESSING},
{"kernel-accel", required_argument, 0, IDX_KERNEL_ACCEL},
{"kernel-loops", required_argument, 0, IDX_KERNEL_LOOPS},
{"keyspace", no_argument, 0, IDX_KEYSPACE},
@ -139,6 +140,7 @@ int user_options_init (hashcat_ctx_t *hashcat_ctx)
user_options->induction_dir = NULL;
user_options->kernel_accel = KERNEL_ACCEL;
user_options->kernel_loops = KERNEL_LOOPS;
user_options->keep_guessing = KEEP_GUESSING;
user_options->keyspace = KEYSPACE;
user_options->left = LEFT;
user_options->limit = LIMIT;
@ -248,6 +250,7 @@ int user_options_getopt (hashcat_ctx_t *hashcat_ctx, int argc, char **argv)
case IDX_FORCE: user_options->force = true; break;
case IDX_SKIP: user_options->skip = atoll (optarg); break;
case IDX_LIMIT: user_options->limit = atoll (optarg); break;
case IDX_KEEP_GUESSING: user_options->keep_guessing = true; break;
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;
@ -1251,6 +1254,7 @@ void user_options_logger (hashcat_ctx_t *hashcat_ctx)
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->keep_guessing);
logfile_top_uint (user_options->kernel_accel);
logfile_top_uint (user_options->kernel_loops);
logfile_top_uint (user_options->keyspace);

Loading…
Cancel
Save