mirror of
https://github.com/hashcat/hashcat.git
synced 2024-11-22 08:08:10 +00:00
Removed option --weak-hash-check (zero-length password check) to increase startup time, it also causes many Trap 6 error on OSX
This commit is contained in:
parent
bac000667c
commit
2517292ac1
@ -10,6 +10,7 @@
|
||||
- Added option --self-test-disable to disable self-test functionality on startup
|
||||
- Added option --wordlist-autohex-disable to disable the automatical conversion of $HEX[] words from the word list
|
||||
- Added option --example-hashes to show an example hash for each hash-mode
|
||||
- Removed option --weak-hash-check (zero-length password check) to increase startup time, it also causes many Trap 6 error on OSX
|
||||
|
||||
##
|
||||
## Algorithms
|
||||
|
@ -189,8 +189,8 @@ _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 -O"
|
||||
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 --wordlist-autohex-disable --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 --example-hashes --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 --veracrypt-keyfiles --veracrypt-pim --stdout --keep-guessing --hccapx-message-pair --nonce-error-corrections --encoding-from --encoding-to --optimized-kernel-enable --self-test-disable"
|
||||
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 --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 --veracrypt-keyfiles --veracrypt-pim --hccapx-message-pair --nonce-error-corrections --encoding-from --encoding-to"
|
||||
local LONG_OPTS="--hash-type --attack-mode --version --help --quiet --benchmark --hex-salt --hex-wordlist --hex-charset --force --status --status-timer --machine-readable --loopback --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 --wordlist-autohex-disable --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 --example-hashes --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 --veracrypt-keyfiles --veracrypt-pim --stdout --keep-guessing --hccapx-message-pair --nonce-error-corrections --encoding-from --encoding-to --optimized-kernel-enable --self-test-disable"
|
||||
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 --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 --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 --veracrypt-keyfiles --veracrypt-pim --hccapx-message-pair --nonce-error-corrections --encoding-from --encoding-to"
|
||||
|
||||
COMPREPLY=()
|
||||
local cur="${COMP_WORDS[COMP_CWORD]}"
|
||||
@ -363,7 +363,7 @@ _hashcat ()
|
||||
--status-timer|--markov-threshold|--runtime|--session|--separator|--segment-size|--rule-left|--rule-right| \
|
||||
--nvidia-spin-damp|--gpu-temp-abort|--gpu-temp-retain|--generate-rules|--generate-rules-func-min|--generate-rules-func-max| \
|
||||
--increment-min|--increment-max|--remove-timer|--bitmap-min|--bitmap-max|--skip|--limit|--generate-rules-seed| \
|
||||
--weak-hash-threshold|--outfile-check-timer|--outfile-check-dir|--induction-dir|--scrypt-tmto|--encoding-from|--encoding-to|--optimized-kernel-enable|--self-test-disable)
|
||||
--outfile-check-timer|--outfile-check-dir|--induction-dir|--scrypt-tmto|--encoding-from|--encoding-to|--optimized-kernel-enable|--self-test-disable)
|
||||
return 0
|
||||
;;
|
||||
|
||||
|
@ -13,10 +13,10 @@
|
||||
#include <limits.h>
|
||||
|
||||
/**
|
||||
* weak hashes shutcut
|
||||
* zero hashes shutcut
|
||||
*/
|
||||
|
||||
static const char LM_WEAK_HASH[] = "aad3b435b51404ee";
|
||||
static const char LM_ZERO_HASH[] = "aad3b435b51404ee";
|
||||
static const char LM_MASKED_PLAIN[] = "[notfound]";
|
||||
|
||||
/**
|
||||
|
@ -140,11 +140,8 @@ typedef enum event_identifier
|
||||
EVENT_SELFTEST_FINISHED = 0x000000c0,
|
||||
EVENT_SELFTEST_STARTING = 0x000000c1,
|
||||
EVENT_SET_KERNEL_POWER_FINAL = 0x000000d0,
|
||||
EVENT_WEAK_HASH_POST = 0x000000e0,
|
||||
EVENT_WEAK_HASH_PRE = 0x000000e1,
|
||||
EVENT_WEAK_HASH_ALL_CRACKED = 0x000000e2,
|
||||
EVENT_WORDLIST_CACHE_GENERATE = 0x000000f0,
|
||||
EVENT_WORDLIST_CACHE_HIT = 0x000000f1,
|
||||
EVENT_WORDLIST_CACHE_GENERATE = 0x000000e0,
|
||||
EVENT_WORDLIST_CACHE_HIT = 0x000000e1,
|
||||
|
||||
// there will be much more event types soon
|
||||
|
||||
@ -584,7 +581,6 @@ typedef enum user_options_defaults
|
||||
USAGE = false,
|
||||
USERNAME = false,
|
||||
VERSION = false,
|
||||
WEAK_HASH_THRESHOLD = 100,
|
||||
WORKLOAD_PROFILE = 2,
|
||||
|
||||
} user_options_defaults_t;
|
||||
@ -682,7 +678,6 @@ typedef enum user_options_map
|
||||
IDX_VERACRYPT_PIM = 0xff3f,
|
||||
IDX_VERSION_LOWER = 'v',
|
||||
IDX_VERSION = 'V',
|
||||
IDX_WEAK_HASH_THRESHOLD = 0xff40,
|
||||
IDX_WORKLOAD_PROFILE = 'w'
|
||||
|
||||
} user_options_map_t;
|
||||
@ -1563,7 +1558,6 @@ typedef struct user_options
|
||||
u32 segment_size;
|
||||
u32 status_timer;
|
||||
u32 veracrypt_pim;
|
||||
u32 weak_hash_threshold;
|
||||
u32 workload_profile;
|
||||
u64 limit;
|
||||
u64 skip;
|
||||
|
@ -1,11 +0,0 @@
|
||||
/**
|
||||
* Author......: See docs/credits.txt
|
||||
* License.....: MIT
|
||||
*/
|
||||
|
||||
#ifndef _WEAK_HASH_H
|
||||
#define _WEAK_HASH_H
|
||||
|
||||
int weak_hash_check (hashcat_ctx_t *hashcat_ctx, hc_device_param_t *device_param, const u32 salt_pos);
|
||||
|
||||
#endif // _WEAK_HASH_H
|
@ -273,7 +273,7 @@ LFLAGS_CROSS_WIN64 += -lpsapi
|
||||
## Objects
|
||||
##
|
||||
|
||||
OBJS_ALL := affinity autotune benchmark bitmap bitops combinator common convert cpt cpu_aes cpu_crc32 cpu_des cpu_md4 cpu_md5 cpu_sha1 cpu_sha256 debugfile dictstat dispatch dynloader event ext_ADL ext_nvapi ext_nvml ext_OpenCL ext_sysfs ext_xnvctrl ext_lzma lzma_sdk/Alloc lzma_sdk/Lzma2Dec lzma_sdk/LzmaDec filehandling folder hashcat hashes hlfmt hwmon induct interface locking logfile loopback memory monitor mpsp opencl outfile_check outfile pidfile potfile restore rp rp_cpu rp_kernel_on_cpu rp_kernel_on_cpu_optimized selftest shared status stdout straight terminal thread timer tuningdb usage user_options weak_hash wordlist
|
||||
OBJS_ALL := affinity autotune benchmark bitmap bitops combinator common convert cpt cpu_aes cpu_crc32 cpu_des cpu_md4 cpu_md5 cpu_sha1 cpu_sha256 debugfile dictstat dispatch dynloader event ext_ADL ext_nvapi ext_nvml ext_OpenCL ext_sysfs ext_xnvctrl ext_lzma lzma_sdk/Alloc lzma_sdk/Lzma2Dec lzma_sdk/LzmaDec filehandling folder hashcat hashes hlfmt hwmon induct interface locking logfile loopback memory monitor mpsp opencl outfile_check outfile pidfile potfile restore rp rp_cpu rp_kernel_on_cpu rp_kernel_on_cpu_optimized selftest shared status stdout straight terminal thread timer tuningdb usage user_options wordlist
|
||||
|
||||
NATIVE_STATIC_OBJS := $(foreach OBJ,$(OBJS_ALL),obj/$(OBJ).NATIVE.STATIC.o)
|
||||
NATIVE_SHARED_OBJS := $(foreach OBJ,$(OBJS_ALL),obj/$(OBJ).NATIVE.SHARED.o)
|
||||
|
@ -49,7 +49,6 @@
|
||||
#include "tuningdb.h"
|
||||
#include "usage.h"
|
||||
#include "user_options.h"
|
||||
#include "weak_hash.h"
|
||||
#include "wordlist.h"
|
||||
|
||||
// inner2_loop iterates through wordlists, then calls kernel execution
|
||||
@ -701,70 +700,14 @@ static int outer_loop (hashcat_ctx_t *hashcat_ctx)
|
||||
EVENT (EVENT_SELFTEST_FINISHED);
|
||||
|
||||
/**
|
||||
* weak hash check is the first to write to potfile, so open it for writing from here
|
||||
* (old) weak hash check is the first to write to potfile, so open it for writing from here
|
||||
* the weak hash check was removed maybe we can move this more to the bottom now
|
||||
*/
|
||||
|
||||
const int rc_potfile_write = potfile_write_open (hashcat_ctx);
|
||||
|
||||
if (rc_potfile_write == -1) return -1;
|
||||
|
||||
/**
|
||||
* weak hash check
|
||||
*/
|
||||
|
||||
if (user_options->weak_hash_threshold >= hashes->salts_cnt)
|
||||
{
|
||||
hc_device_param_t *device_param = NULL;
|
||||
|
||||
for (u32 device_id = 0; device_id < opencl_ctx->devices_cnt; device_id++)
|
||||
{
|
||||
device_param = &opencl_ctx->devices_param[device_id];
|
||||
|
||||
if (device_param->skipped == true) continue;
|
||||
|
||||
break;
|
||||
}
|
||||
|
||||
if (device_param == NULL)
|
||||
{
|
||||
event_log_error (hashcat_ctx, "No device found for weak-hash check.");
|
||||
|
||||
return -1;
|
||||
}
|
||||
|
||||
EVENT (EVENT_WEAK_HASH_PRE);
|
||||
|
||||
for (u32 salt_pos = 0; salt_pos < hashes->salts_cnt; salt_pos++)
|
||||
{
|
||||
const int CL_rc = weak_hash_check (hashcat_ctx, device_param, salt_pos);
|
||||
|
||||
if (CL_rc == -1) return -1;
|
||||
}
|
||||
|
||||
EVENT (EVENT_WEAK_HASH_POST);
|
||||
}
|
||||
|
||||
/**
|
||||
* maybe all hashes were cracked now (as after potfile checks), we can exit here
|
||||
*/
|
||||
|
||||
if (status_ctx->devices_status == STATUS_CRACKED)
|
||||
{
|
||||
if ((user_options->remove == true) && (hashes->hashlist_mode == HL_MODE_FILE))
|
||||
{
|
||||
if (hashes->digests_saved != hashes->digests_done)
|
||||
{
|
||||
const int rc = save_hash (hashcat_ctx);
|
||||
|
||||
if (rc == -1) return -1;
|
||||
}
|
||||
}
|
||||
|
||||
EVENT (EVENT_WEAK_HASH_ALL_CRACKED);
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
/**
|
||||
* status and monitor threads
|
||||
*/
|
||||
|
31
src/main.c
31
src/main.c
@ -550,34 +550,6 @@ static void main_opencl_session_post (MAYBE_UNUSED hashcat_ctx_t *hashcat_ctx, M
|
||||
event_log_info_nn (hashcat_ctx, "Initialized device kernels and memory...");
|
||||
}
|
||||
|
||||
static void main_weak_hash_pre (MAYBE_UNUSED hashcat_ctx_t *hashcat_ctx, MAYBE_UNUSED const void *buf, MAYBE_UNUSED const size_t len)
|
||||
{
|
||||
const user_options_t *user_options = hashcat_ctx->user_options;
|
||||
|
||||
if (user_options->quiet == true) return;
|
||||
|
||||
event_log_info_nn (hashcat_ctx, "Checking for weak hashes...");
|
||||
}
|
||||
|
||||
static void main_weak_hash_post (MAYBE_UNUSED hashcat_ctx_t *hashcat_ctx, MAYBE_UNUSED const void *buf, MAYBE_UNUSED const size_t len)
|
||||
{
|
||||
const user_options_t *user_options = hashcat_ctx->user_options;
|
||||
|
||||
if (user_options->quiet == true) return;
|
||||
|
||||
event_log_info_nn (hashcat_ctx, "Checked for weak hashes...");
|
||||
}
|
||||
|
||||
static void main_weak_hash_all_cracked (MAYBE_UNUSED hashcat_ctx_t *hashcat_ctx, MAYBE_UNUSED const void *buf, MAYBE_UNUSED const size_t len)
|
||||
{
|
||||
const user_options_t *user_options = hashcat_ctx->user_options;
|
||||
|
||||
if (user_options->quiet == true) return;
|
||||
|
||||
event_log_info (hashcat_ctx, "INFO: All hashes found during weak hashes check! Use --show to display them.");
|
||||
event_log_info (hashcat_ctx, NULL);
|
||||
}
|
||||
|
||||
static void main_bitmap_init_pre (MAYBE_UNUSED hashcat_ctx_t *hashcat_ctx, MAYBE_UNUSED const void *buf, MAYBE_UNUSED const size_t len)
|
||||
{
|
||||
const user_options_t *user_options = hashcat_ctx->user_options;
|
||||
@ -988,9 +960,6 @@ static void event (const u32 id, hashcat_ctx_t *hashcat_ctx, const void *buf, co
|
||||
case EVENT_POTFILE_REMOVE_PARSE_POST: main_potfile_remove_parse_post (hashcat_ctx, buf, len); break;
|
||||
case EVENT_POTFILE_REMOVE_PARSE_PRE: main_potfile_remove_parse_pre (hashcat_ctx, buf, len); break;
|
||||
case EVENT_SET_KERNEL_POWER_FINAL: main_set_kernel_power_final (hashcat_ctx, buf, len); break;
|
||||
case EVENT_WEAK_HASH_POST: main_weak_hash_post (hashcat_ctx, buf, len); break;
|
||||
case EVENT_WEAK_HASH_PRE: main_weak_hash_pre (hashcat_ctx, buf, len); break;
|
||||
case EVENT_WEAK_HASH_ALL_CRACKED: main_weak_hash_all_cracked (hashcat_ctx, buf, len); break;
|
||||
case EVENT_WORDLIST_CACHE_GENERATE: main_wordlist_cache_generate (hashcat_ctx, buf, len); break;
|
||||
case EVENT_WORDLIST_CACHE_HIT: main_wordlist_cache_hit (hashcat_ctx, buf, len); break;
|
||||
}
|
||||
|
@ -368,12 +368,11 @@ int potfile_remove_parse (hashcat_ctx_t *hashcat_ctx)
|
||||
hash_buf.hook_salt = hcmalloc (hashconfig->hook_salt_size);
|
||||
}
|
||||
|
||||
// this is usually detected by weak-hash-check
|
||||
// but not if bitslice
|
||||
// special case for a split hash
|
||||
|
||||
if (hashconfig->hash_mode == 3000)
|
||||
{
|
||||
int parser_status = hashconfig->parse_func ((u8 *) LM_WEAK_HASH, 16, &hash_buf, hashconfig);
|
||||
int parser_status = hashconfig->parse_func ((u8 *) LM_ZERO_HASH, 16, &hash_buf, hashconfig);
|
||||
|
||||
if (parser_status == PARSER_OK)
|
||||
{
|
||||
@ -418,9 +417,6 @@ int potfile_remove_parse (hashcat_ctx_t *hashcat_ctx)
|
||||
|
||||
if (line_hash_len == 0) continue;
|
||||
|
||||
// we should allow length 0 passwords (detected by weak hash check)
|
||||
//if (line_pw_len == 0) continue;
|
||||
|
||||
if (hashconfig->is_salted == true)
|
||||
{
|
||||
memset (hash_buf.salt, 0, sizeof (salt_t));
|
||||
|
@ -41,7 +41,6 @@ static const char *USAGE_BIG[] =
|
||||
" --keep-guessing | | Keep guessing the hash after it has been cracked |",
|
||||
" --self-test-disable | | Disable self-test functionality on startup |",
|
||||
" --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",
|
||||
" --markov-disable | | Disables markov-chains, emulates classic brute-force |",
|
||||
" --markov-classic | | Enables classic markov-chains, no per-position |",
|
||||
|
@ -109,7 +109,6 @@ static const struct option long_options[] =
|
||||
{"veracrypt-keyfiles", required_argument, 0, IDX_VERACRYPT_KEYFILES},
|
||||
{"veracrypt-pim", required_argument, 0, IDX_VERACRYPT_PIM},
|
||||
{"version", no_argument, 0, IDX_VERSION},
|
||||
{"weak-hash-threshold", required_argument, 0, IDX_WEAK_HASH_THRESHOLD},
|
||||
{"workload-profile", required_argument, 0, IDX_WORKLOAD_PROFILE},
|
||||
{0, 0, 0, 0}
|
||||
};
|
||||
@ -218,7 +217,6 @@ int user_options_init (hashcat_ctx_t *hashcat_ctx)
|
||||
user_options->veracrypt_keyfiles = NULL;
|
||||
user_options->veracrypt_pim = 0;
|
||||
user_options->version = VERSION;
|
||||
user_options->weak_hash_threshold = WEAK_HASH_THRESHOLD;
|
||||
user_options->workload_profile = WORKLOAD_PROFILE;
|
||||
user_options->rp_files_cnt = 0;
|
||||
user_options->rp_files = (char **) hccalloc (256, sizeof (char *));
|
||||
@ -261,7 +259,6 @@ int user_options_getopt (hashcat_ctx_t *hashcat_ctx, int argc, char **argv)
|
||||
case IDX_SKIP:
|
||||
case IDX_LIMIT:
|
||||
case IDX_STATUS_TIMER:
|
||||
case IDX_WEAK_HASH_THRESHOLD:
|
||||
case IDX_HASH_MODE:
|
||||
case IDX_RUNTIME:
|
||||
case IDX_ATTACK_MODE:
|
||||
@ -354,7 +351,6 @@ int user_options_getopt (hashcat_ctx_t *hashcat_ctx, int argc, char **argv)
|
||||
case IDX_STATUS_TIMER: user_options->status_timer = atoi (optarg); break;
|
||||
case IDX_MACHINE_READABLE: user_options->machine_readable = true; break;
|
||||
case IDX_LOOPBACK: user_options->loopback = true; break;
|
||||
case IDX_WEAK_HASH_THRESHOLD: user_options->weak_hash_threshold = atoi (optarg); break;
|
||||
case IDX_SESSION: user_options->session = optarg; break;
|
||||
case IDX_HASH_MODE: user_options->hash_mode = atoi (optarg);
|
||||
user_options->hash_mode_chgd = true; break;
|
||||
@ -836,16 +832,6 @@ int user_options_sanity (hashcat_ctx_t *hashcat_ctx)
|
||||
}
|
||||
}
|
||||
|
||||
if (user_options->attack_mode != ATTACK_MODE_STRAIGHT)
|
||||
{
|
||||
if ((user_options->weak_hash_threshold != WEAK_HASH_THRESHOLD) && (user_options->weak_hash_threshold != 0))
|
||||
{
|
||||
event_log_error (hashcat_ctx, "Use of --weak-hash-threshold is only allowed in attack mode 0 (straight).");
|
||||
|
||||
return -1;
|
||||
}
|
||||
}
|
||||
|
||||
if (user_options->nvidia_spin_damp > 100)
|
||||
{
|
||||
event_log_error (hashcat_ctx, "Values of --nvidia-spin-damp must be between 0 and 100 (inclusive).");
|
||||
@ -1261,7 +1247,6 @@ void user_options_preprocess (hashcat_ctx_t *hashcat_ctx)
|
||||
user_options->show = false;
|
||||
user_options->status = false;
|
||||
user_options->status_timer = 0;
|
||||
user_options->weak_hash_threshold = 0;
|
||||
}
|
||||
|
||||
if (user_options->benchmark == true)
|
||||
@ -1283,7 +1268,6 @@ void user_options_preprocess (hashcat_ctx_t *hashcat_ctx)
|
||||
user_options->speed_only = true;
|
||||
user_options->status = false;
|
||||
user_options->status_timer = 0;
|
||||
user_options->weak_hash_threshold = 0;
|
||||
|
||||
if (user_options->workload_profile_chgd == false)
|
||||
{
|
||||
@ -1370,11 +1354,6 @@ void user_options_preprocess (hashcat_ctx_t *hashcat_ctx)
|
||||
user_options->limit += user_options->skip;
|
||||
}
|
||||
|
||||
if (user_options->attack_mode != ATTACK_MODE_STRAIGHT)
|
||||
{
|
||||
user_options->weak_hash_threshold = 0;
|
||||
}
|
||||
|
||||
if (user_options->hash_mode == 9710)
|
||||
{
|
||||
user_options->outfile_format = 5;
|
||||
@ -2213,6 +2192,5 @@ void user_options_logger (hashcat_ctx_t *hashcat_ctx)
|
||||
logfile_top_uint (user_options->username);
|
||||
logfile_top_uint (user_options->veracrypt_pim);
|
||||
logfile_top_uint (user_options->version);
|
||||
logfile_top_uint (user_options->weak_hash_threshold);
|
||||
logfile_top_uint (user_options->workload_profile);
|
||||
}
|
||||
|
104
src/weak_hash.c
104
src/weak_hash.c
@ -1,104 +0,0 @@
|
||||
/**
|
||||
* Author......: See docs/credits.txt
|
||||
* License.....: MIT
|
||||
*/
|
||||
|
||||
#include "common.h"
|
||||
#include "types.h"
|
||||
#include "event.h"
|
||||
#include "opencl.h"
|
||||
#include "hashes.h"
|
||||
#include "weak_hash.h"
|
||||
|
||||
int weak_hash_check (hashcat_ctx_t *hashcat_ctx, hc_device_param_t *device_param, const u32 salt_pos)
|
||||
{
|
||||
hashconfig_t *hashconfig = hashcat_ctx->hashconfig;
|
||||
hashes_t *hashes = hashcat_ctx->hashes;
|
||||
straight_ctx_t *straight_ctx = hashcat_ctx->straight_ctx;
|
||||
|
||||
salt_t *salt_buf = &hashes->salts_buf[salt_pos];
|
||||
|
||||
device_param->kernel_params_buf32[27] = salt_pos;
|
||||
device_param->kernel_params_buf32[30] = 1;
|
||||
device_param->kernel_params_buf32[31] = salt_buf->digests_cnt;
|
||||
device_param->kernel_params_buf32[32] = salt_buf->digests_offset;
|
||||
device_param->kernel_params_buf32[33] = 0;
|
||||
device_param->kernel_params_buf64[34] = 1;
|
||||
|
||||
u32 cmd0_rule_old = straight_ctx->kernel_rules_buf[0].cmds[0];
|
||||
|
||||
straight_ctx->kernel_rules_buf[0].cmds[0] = 0;
|
||||
|
||||
/**
|
||||
* run the kernel
|
||||
*/
|
||||
|
||||
int CL_rc;
|
||||
|
||||
if (hashconfig->attack_exec == ATTACK_EXEC_INSIDE_KERNEL)
|
||||
{
|
||||
if (hashconfig->opti_type & OPTI_TYPE_OPTIMIZED_KERNEL)
|
||||
{
|
||||
CL_rc = run_kernel (hashcat_ctx, device_param, KERN_RUN_1, 1, false, 0);
|
||||
|
||||
if (CL_rc == -1) return -1;
|
||||
}
|
||||
else
|
||||
{
|
||||
CL_rc = run_kernel (hashcat_ctx, device_param, KERN_RUN_4, 1, false, 0);
|
||||
|
||||
if (CL_rc == -1) return -1;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
CL_rc = run_kernel (hashcat_ctx, device_param, KERN_RUN_1, 1, false, 0);
|
||||
|
||||
if (CL_rc == -1) return -1;
|
||||
|
||||
u32 loop_step = 16;
|
||||
|
||||
const u32 iter = salt_buf->salt_iter;
|
||||
|
||||
for (u32 loop_pos = 0; loop_pos < iter; loop_pos += loop_step)
|
||||
{
|
||||
u32 loop_left = iter - loop_pos;
|
||||
|
||||
loop_left = MIN (loop_left, loop_step);
|
||||
|
||||
device_param->kernel_params_buf32[28] = loop_pos;
|
||||
device_param->kernel_params_buf32[29] = loop_left;
|
||||
|
||||
CL_rc = run_kernel (hashcat_ctx, device_param, KERN_RUN_2, 1, false, 0);
|
||||
|
||||
if (CL_rc == -1) return -1;
|
||||
}
|
||||
|
||||
CL_rc = run_kernel (hashcat_ctx, device_param, KERN_RUN_3, 1, false, 0);
|
||||
|
||||
if (CL_rc == -1) return -1;
|
||||
}
|
||||
|
||||
/**
|
||||
* result
|
||||
*/
|
||||
|
||||
check_cracked (hashcat_ctx, device_param, salt_pos);
|
||||
|
||||
/**
|
||||
* cleanup
|
||||
*/
|
||||
|
||||
device_param->kernel_params_buf32[27] = 0;
|
||||
device_param->kernel_params_buf32[28] = 0;
|
||||
device_param->kernel_params_buf32[29] = 0;
|
||||
device_param->kernel_params_buf32[30] = 0;
|
||||
device_param->kernel_params_buf32[31] = 0;
|
||||
device_param->kernel_params_buf32[32] = 0;
|
||||
device_param->kernel_params_buf32[33] = 0;
|
||||
device_param->kernel_params_buf64[34] = 0;
|
||||
|
||||
straight_ctx->kernel_rules_buf[0].cmds[0] = cmd0_rule_old;
|
||||
|
||||
return 0;
|
||||
}
|
@ -24,7 +24,7 @@ NEVER_CRACK="11600 14900"
|
||||
|
||||
SLOW_ALGOS="400 500 501 1600 1800 2100 2500 3200 5200 5800 6211 6212 6213 6221 6222 6223 6231 6232 6233 6241 6242 6243 6251 6261 6271 6281 6300 6400 6500 6600 6700 6800 7100 7200 7400 7900 8200 8800 8900 9000 9100 9200 9300 9400 9500 9600 10000 10300 10500 10700 10900 11300 11600 11900 12000 12001 12100 12200 12300 12400 12500 12700 12800 12900 13000 13200 13400 13600 14600 14700 14800 15100 15200 15300 15600 15700"
|
||||
|
||||
OPTS="--quiet --force --potfile-disable --runtime 400 --gpu-temp-disable --weak-hash-threshold=0"
|
||||
OPTS="--quiet --force --potfile-disable --runtime 400 --gpu-temp-disable"
|
||||
|
||||
OUTD="test_$(date +%s)"
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user