mirror of
https://github.com/hashcat/hashcat.git
synced 2024-12-22 22:58:30 +00:00
Add new option --slow-candidates which allows hashcat to generate passwords on-host
This commit is contained in:
parent
466ea8eaba
commit
52c52836e3
@ -1,5 +1,11 @@
|
||||
* changes v4.2.1 -> xxx
|
||||
|
||||
##
|
||||
## Features
|
||||
##
|
||||
|
||||
- Add new option --slow-candidates which allows hashcat to generate passwords on-host
|
||||
|
||||
##
|
||||
## Improvements
|
||||
##
|
||||
|
@ -188,8 +188,8 @@ _hashcat ()
|
||||
local HIDDEN_FILES_AGGRESIVE="${HIDDEN_FILES}|hcmask|hcchr"
|
||||
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 --benchmark-all --hex-salt --hex-wordlist --hex-charset --force --status --status-timer --machine-readable --loopback --markov-hcstat2 --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 --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 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 -S -z"
|
||||
local LONG_OPTS="--hash-type --attack-mode --version --help --quiet --benchmark --benchmark-all --hex-salt --hex-wordlist --hex-charset --force --status --status-timer --machine-readable --loopback --markov-hcstat2 --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 --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 --slow-candidates"
|
||||
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-hcstat2 --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 --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=()
|
||||
|
@ -74,8 +74,8 @@ int run_kernel_decompress (hashcat_ctx_t *hashcat_ctx, hc_device_param_t *device
|
||||
int run_copy (hashcat_ctx_t *hashcat_ctx, hc_device_param_t *device_param, const u64 pws_cnt);
|
||||
int run_cracker (hashcat_ctx_t *hashcat_ctx, hc_device_param_t *device_param, const u64 pws_cnt);
|
||||
|
||||
void generate_source_kernel_filename (const u32 attack_exec, const u32 attack_kern, const u32 kern_type, const u32 opti_type, char *shared_dir, char *source_file);
|
||||
void generate_cached_kernel_filename (const u32 attack_exec, const u32 attack_kern, const u32 kern_type, const u32 opti_type, char *profile_dir, const char *device_name_chksum, char *cached_file);
|
||||
void generate_source_kernel_filename (const bool slow_candidates, const u32 attack_exec, const u32 attack_kern, const u32 kern_type, const u32 opti_type, char *shared_dir, char *source_file);
|
||||
void generate_cached_kernel_filename (const bool slow_candidates, const u32 attack_exec, const u32 attack_kern, const u32 kern_type, const u32 opti_type, char *profile_dir, const char *device_name_chksum, char *cached_file);
|
||||
void generate_source_kernel_mp_filename (const u32 opti_type, const u64 opts_type, char *shared_dir, char *source_file);
|
||||
void generate_cached_kernel_mp_filename (const u32 opti_type, const u64 opts_type, char *profile_dir, const char *device_name_chksum, char *cached_file);
|
||||
void generate_source_kernel_amp_filename (const u32 attack_kern, char *shared_dir, char *source_file);
|
||||
|
36
include/slow_candidates.h
Normal file
36
include/slow_candidates.h
Normal file
@ -0,0 +1,36 @@
|
||||
/**
|
||||
* Author......: See docs/credits.txt
|
||||
* License.....: MIT
|
||||
*/
|
||||
|
||||
#ifndef _SLOW_CANDIDATES_H
|
||||
#define _SLOW_CANDIDATES_H
|
||||
|
||||
typedef struct extra_info_straight
|
||||
{
|
||||
FILE *fd;
|
||||
|
||||
u64 rule_pos_prev;
|
||||
u64 rule_pos;
|
||||
|
||||
u8 base_buf[256];
|
||||
u32 base_len;
|
||||
|
||||
u8 out_buf[256];
|
||||
u32 out_len;
|
||||
|
||||
} extra_info_straight_t;
|
||||
|
||||
typedef struct extra_info_mask
|
||||
{
|
||||
u64 pos;
|
||||
|
||||
u8 out_buf[256];
|
||||
u32 out_len;
|
||||
|
||||
} extra_info_mask_t;
|
||||
|
||||
void slow_candidates_seek (hashcat_ctx_t *hashcat_ctx, void *extra_info, const u64 cur, const u64 end);
|
||||
void slow_candidates_next (hashcat_ctx_t *hashcat_ctx, void *extra_info);
|
||||
|
||||
#endif // _SLOW_CANDIDATES_H
|
171
include/status.h
171
include/status.h
@ -13,94 +13,95 @@
|
||||
double get_avg_exec_time (hc_device_param_t *device_param, const int last_num_entries);
|
||||
|
||||
// should be static after refactoring
|
||||
void format_timer_display (struct tm *tm, char *buf, size_t len);
|
||||
void format_speed_display (double val, char *buf, size_t len);
|
||||
void format_timer_display (struct tm *tm, char *buf, size_t len);
|
||||
void format_speed_display (double val, char *buf, size_t len);
|
||||
void format_speed_display_1k (double val, char *buf, size_t len);
|
||||
|
||||
int status_get_device_info_cnt (const hashcat_ctx_t *hashcat_ctx);
|
||||
int status_get_device_info_active (const hashcat_ctx_t *hashcat_ctx);
|
||||
bool status_get_skipped_dev (const hashcat_ctx_t *hashcat_ctx, const int device_id);
|
||||
char *status_get_session (const hashcat_ctx_t *hashcat_ctx);
|
||||
const char *status_get_status_string (const hashcat_ctx_t *hashcat_ctx);
|
||||
int status_get_status_number (const hashcat_ctx_t *hashcat_ctx);
|
||||
int status_get_guess_mode (const hashcat_ctx_t *hashcat_ctx);
|
||||
char *status_get_guess_base (const hashcat_ctx_t *hashcat_ctx);
|
||||
int status_get_guess_base_offset (const hashcat_ctx_t *hashcat_ctx);
|
||||
int status_get_guess_base_count (const hashcat_ctx_t *hashcat_ctx);
|
||||
double status_get_guess_base_percent (const hashcat_ctx_t *hashcat_ctx);
|
||||
char *status_get_guess_mod (const hashcat_ctx_t *hashcat_ctx);
|
||||
int status_get_guess_mod_offset (const hashcat_ctx_t *hashcat_ctx);
|
||||
int status_get_guess_mod_count (const hashcat_ctx_t *hashcat_ctx);
|
||||
double status_get_guess_mod_percent (const hashcat_ctx_t *hashcat_ctx);
|
||||
char *status_get_guess_charset (const hashcat_ctx_t *hashcat_ctx);
|
||||
int status_get_guess_mask_length (const hashcat_ctx_t *hashcat_ctx);
|
||||
char *status_get_guess_candidates_dev (const hashcat_ctx_t *hashcat_ctx, const int device_id);
|
||||
const char *status_get_hash_type (const hashcat_ctx_t *hashcat_ctx);
|
||||
const char *status_get_hash_target (const hashcat_ctx_t *hashcat_ctx);
|
||||
int status_get_digests_done (const hashcat_ctx_t *hashcat_ctx);
|
||||
int status_get_digests_cnt (const hashcat_ctx_t *hashcat_ctx);
|
||||
double status_get_digests_percent (const hashcat_ctx_t *hashcat_ctx);
|
||||
int status_get_salts_done (const hashcat_ctx_t *hashcat_ctx);
|
||||
int status_get_salts_cnt (const hashcat_ctx_t *hashcat_ctx);
|
||||
double status_get_salts_percent (const hashcat_ctx_t *hashcat_ctx);
|
||||
double status_get_msec_running (const hashcat_ctx_t *hashcat_ctx);
|
||||
double status_get_msec_paused (const hashcat_ctx_t *hashcat_ctx);
|
||||
double status_get_msec_real (const hashcat_ctx_t *hashcat_ctx);
|
||||
char *status_get_time_started_absolute (const hashcat_ctx_t *hashcat_ctx);
|
||||
char *status_get_time_started_relative (const hashcat_ctx_t *hashcat_ctx);
|
||||
time_t status_get_sec_etc (const hashcat_ctx_t *hashcat_ctx);
|
||||
char *status_get_time_estimated_absolute (const hashcat_ctx_t *hashcat_ctx);
|
||||
char *status_get_time_estimated_relative (const hashcat_ctx_t *hashcat_ctx);
|
||||
u64 status_get_restore_point (const hashcat_ctx_t *hashcat_ctx);
|
||||
u64 status_get_restore_total (const hashcat_ctx_t *hashcat_ctx);
|
||||
double status_get_restore_percent (const hashcat_ctx_t *hashcat_ctx);
|
||||
int status_get_progress_mode (const hashcat_ctx_t *hashcat_ctx);
|
||||
double status_get_progress_finished_percent (const hashcat_ctx_t *hashcat_ctx);
|
||||
u64 status_get_progress_done (const hashcat_ctx_t *hashcat_ctx);
|
||||
u64 status_get_progress_rejected (const hashcat_ctx_t *hashcat_ctx);
|
||||
double status_get_progress_rejected_percent (const hashcat_ctx_t *hashcat_ctx);
|
||||
u64 status_get_progress_restored (const hashcat_ctx_t *hashcat_ctx);
|
||||
u64 status_get_progress_cur (const hashcat_ctx_t *hashcat_ctx);
|
||||
u64 status_get_progress_end (const hashcat_ctx_t *hashcat_ctx);
|
||||
u64 status_get_progress_ignore (const hashcat_ctx_t *hashcat_ctx);
|
||||
u64 status_get_progress_skip (const hashcat_ctx_t *hashcat_ctx);
|
||||
u64 status_get_progress_cur_relative_skip (const hashcat_ctx_t *hashcat_ctx);
|
||||
u64 status_get_progress_end_relative_skip (const hashcat_ctx_t *hashcat_ctx);
|
||||
double status_get_hashes_msec_all (const hashcat_ctx_t *hashcat_ctx);
|
||||
double status_get_hashes_msec_dev (const hashcat_ctx_t *hashcat_ctx, const int device_id);
|
||||
double status_get_hashes_msec_dev_benchmark (const hashcat_ctx_t *hashcat_ctx, const int device_id);
|
||||
double status_get_exec_msec_all (const hashcat_ctx_t *hashcat_ctx);
|
||||
double status_get_exec_msec_dev (const hashcat_ctx_t *hashcat_ctx, const int device_id);
|
||||
char *status_get_speed_sec_all (const hashcat_ctx_t *hashcat_ctx);
|
||||
char *status_get_speed_sec_dev (const hashcat_ctx_t *hashcat_ctx, const int device_id);
|
||||
int status_get_cpt_cur_min (const hashcat_ctx_t *hashcat_ctx);
|
||||
int status_get_cpt_cur_hour (const hashcat_ctx_t *hashcat_ctx);
|
||||
int status_get_cpt_cur_day (const hashcat_ctx_t *hashcat_ctx);
|
||||
int status_get_cpt_avg_min (const hashcat_ctx_t *hashcat_ctx);
|
||||
int status_get_cpt_avg_hour (const hashcat_ctx_t *hashcat_ctx);
|
||||
int status_get_cpt_avg_day (const hashcat_ctx_t *hashcat_ctx);
|
||||
char *status_get_cpt (const hashcat_ctx_t *hashcat_ctx);
|
||||
int status_get_salt_pos_dev (const hashcat_ctx_t *hashcat_ctx, const int device_id);
|
||||
int status_get_innerloop_pos_dev (const hashcat_ctx_t *hashcat_ctx, const int device_id);
|
||||
int status_get_innerloop_left_dev (const hashcat_ctx_t *hashcat_ctx, const int device_id);
|
||||
int status_get_iteration_pos_dev (const hashcat_ctx_t *hashcat_ctx, const int device_id);
|
||||
int status_get_iteration_left_dev (const hashcat_ctx_t *hashcat_ctx, const int device_id);
|
||||
char *status_get_hwmon_dev (const hashcat_ctx_t *hashcat_ctx, const int device_id);
|
||||
int status_get_corespeed_dev (const hashcat_ctx_t *hashcat_ctx, const int device_id);
|
||||
int status_get_memoryspeed_dev (const hashcat_ctx_t *hashcat_ctx, const int device_id);
|
||||
u64 status_get_progress_dev (const hashcat_ctx_t *hashcat_ctx, const int device_id);
|
||||
double status_get_runtime_msec_dev (const hashcat_ctx_t *hashcat_ctx, const int device_id);
|
||||
int status_get_kernel_accel_dev (const hashcat_ctx_t *hashcat_ctx, const int device_id);
|
||||
int status_get_kernel_loops_dev (const hashcat_ctx_t *hashcat_ctx, const int device_id);
|
||||
int status_get_kernel_threads_dev (const hashcat_ctx_t *hashcat_ctx, const int device_id);
|
||||
int status_get_vector_width_dev (const hashcat_ctx_t *hashcat_ctx, const int device_id);
|
||||
int status_get_device_info_cnt (const hashcat_ctx_t *hashcat_ctx);
|
||||
int status_get_device_info_active (const hashcat_ctx_t *hashcat_ctx);
|
||||
bool status_get_skipped_dev (const hashcat_ctx_t *hashcat_ctx, const int device_id);
|
||||
char *status_get_session (const hashcat_ctx_t *hashcat_ctx);
|
||||
const char *status_get_status_string (const hashcat_ctx_t *hashcat_ctx);
|
||||
int status_get_status_number (const hashcat_ctx_t *hashcat_ctx);
|
||||
int status_get_guess_mode (const hashcat_ctx_t *hashcat_ctx);
|
||||
char *status_get_guess_base (const hashcat_ctx_t *hashcat_ctx);
|
||||
int status_get_guess_base_offset (const hashcat_ctx_t *hashcat_ctx);
|
||||
int status_get_guess_base_count (const hashcat_ctx_t *hashcat_ctx);
|
||||
double status_get_guess_base_percent (const hashcat_ctx_t *hashcat_ctx);
|
||||
char *status_get_guess_mod (const hashcat_ctx_t *hashcat_ctx);
|
||||
int status_get_guess_mod_offset (const hashcat_ctx_t *hashcat_ctx);
|
||||
int status_get_guess_mod_count (const hashcat_ctx_t *hashcat_ctx);
|
||||
double status_get_guess_mod_percent (const hashcat_ctx_t *hashcat_ctx);
|
||||
char *status_get_guess_charset (const hashcat_ctx_t *hashcat_ctx);
|
||||
int status_get_guess_mask_length (const hashcat_ctx_t *hashcat_ctx);
|
||||
char *status_get_guess_candidates_dev (const hashcat_ctx_t *hashcat_ctx, const int device_id);
|
||||
const char *status_get_hash_type (const hashcat_ctx_t *hashcat_ctx);
|
||||
const char *status_get_hash_target (const hashcat_ctx_t *hashcat_ctx);
|
||||
int status_get_digests_done (const hashcat_ctx_t *hashcat_ctx);
|
||||
int status_get_digests_cnt (const hashcat_ctx_t *hashcat_ctx);
|
||||
double status_get_digests_percent (const hashcat_ctx_t *hashcat_ctx);
|
||||
int status_get_salts_done (const hashcat_ctx_t *hashcat_ctx);
|
||||
int status_get_salts_cnt (const hashcat_ctx_t *hashcat_ctx);
|
||||
double status_get_salts_percent (const hashcat_ctx_t *hashcat_ctx);
|
||||
double status_get_msec_running (const hashcat_ctx_t *hashcat_ctx);
|
||||
double status_get_msec_paused (const hashcat_ctx_t *hashcat_ctx);
|
||||
double status_get_msec_real (const hashcat_ctx_t *hashcat_ctx);
|
||||
char *status_get_time_started_absolute (const hashcat_ctx_t *hashcat_ctx);
|
||||
char *status_get_time_started_relative (const hashcat_ctx_t *hashcat_ctx);
|
||||
time_t status_get_sec_etc (const hashcat_ctx_t *hashcat_ctx);
|
||||
char *status_get_time_estimated_absolute (const hashcat_ctx_t *hashcat_ctx);
|
||||
char *status_get_time_estimated_relative (const hashcat_ctx_t *hashcat_ctx);
|
||||
u64 status_get_restore_point (const hashcat_ctx_t *hashcat_ctx);
|
||||
u64 status_get_restore_total (const hashcat_ctx_t *hashcat_ctx);
|
||||
double status_get_restore_percent (const hashcat_ctx_t *hashcat_ctx);
|
||||
int status_get_progress_mode (const hashcat_ctx_t *hashcat_ctx);
|
||||
double status_get_progress_finished_percent (const hashcat_ctx_t *hashcat_ctx);
|
||||
u64 status_get_progress_done (const hashcat_ctx_t *hashcat_ctx);
|
||||
u64 status_get_progress_rejected (const hashcat_ctx_t *hashcat_ctx);
|
||||
double status_get_progress_rejected_percent (const hashcat_ctx_t *hashcat_ctx);
|
||||
u64 status_get_progress_restored (const hashcat_ctx_t *hashcat_ctx);
|
||||
u64 status_get_progress_cur (const hashcat_ctx_t *hashcat_ctx);
|
||||
u64 status_get_progress_end (const hashcat_ctx_t *hashcat_ctx);
|
||||
u64 status_get_progress_ignore (const hashcat_ctx_t *hashcat_ctx);
|
||||
u64 status_get_progress_skip (const hashcat_ctx_t *hashcat_ctx);
|
||||
u64 status_get_progress_cur_relative_skip (const hashcat_ctx_t *hashcat_ctx);
|
||||
u64 status_get_progress_end_relative_skip (const hashcat_ctx_t *hashcat_ctx);
|
||||
double status_get_hashes_msec_all (const hashcat_ctx_t *hashcat_ctx);
|
||||
double status_get_hashes_msec_dev (const hashcat_ctx_t *hashcat_ctx, const int device_id);
|
||||
double status_get_hashes_msec_dev_benchmark (const hashcat_ctx_t *hashcat_ctx, const int device_id);
|
||||
double status_get_exec_msec_all (const hashcat_ctx_t *hashcat_ctx);
|
||||
double status_get_exec_msec_dev (const hashcat_ctx_t *hashcat_ctx, const int device_id);
|
||||
char *status_get_speed_sec_all (const hashcat_ctx_t *hashcat_ctx);
|
||||
char *status_get_speed_sec_dev (const hashcat_ctx_t *hashcat_ctx, const int device_id);
|
||||
int status_get_cpt_cur_min (const hashcat_ctx_t *hashcat_ctx);
|
||||
int status_get_cpt_cur_hour (const hashcat_ctx_t *hashcat_ctx);
|
||||
int status_get_cpt_cur_day (const hashcat_ctx_t *hashcat_ctx);
|
||||
int status_get_cpt_avg_min (const hashcat_ctx_t *hashcat_ctx);
|
||||
int status_get_cpt_avg_hour (const hashcat_ctx_t *hashcat_ctx);
|
||||
int status_get_cpt_avg_day (const hashcat_ctx_t *hashcat_ctx);
|
||||
char *status_get_cpt (const hashcat_ctx_t *hashcat_ctx);
|
||||
int status_get_salt_pos_dev (const hashcat_ctx_t *hashcat_ctx, const int device_id);
|
||||
int status_get_innerloop_pos_dev (const hashcat_ctx_t *hashcat_ctx, const int device_id);
|
||||
int status_get_innerloop_left_dev (const hashcat_ctx_t *hashcat_ctx, const int device_id);
|
||||
int status_get_iteration_pos_dev (const hashcat_ctx_t *hashcat_ctx, const int device_id);
|
||||
int status_get_iteration_left_dev (const hashcat_ctx_t *hashcat_ctx, const int device_id);
|
||||
char *status_get_hwmon_dev (const hashcat_ctx_t *hashcat_ctx, const int device_id);
|
||||
int status_get_corespeed_dev (const hashcat_ctx_t *hashcat_ctx, const int device_id);
|
||||
int status_get_memoryspeed_dev (const hashcat_ctx_t *hashcat_ctx, const int device_id);
|
||||
u64 status_get_progress_dev (const hashcat_ctx_t *hashcat_ctx, const int device_id);
|
||||
double status_get_runtime_msec_dev (const hashcat_ctx_t *hashcat_ctx, const int device_id);
|
||||
int status_get_kernel_accel_dev (const hashcat_ctx_t *hashcat_ctx, const int device_id);
|
||||
int status_get_kernel_loops_dev (const hashcat_ctx_t *hashcat_ctx, const int device_id);
|
||||
int status_get_kernel_threads_dev (const hashcat_ctx_t *hashcat_ctx, const int device_id);
|
||||
int status_get_vector_width_dev (const hashcat_ctx_t *hashcat_ctx, const int device_id);
|
||||
|
||||
int status_progress_init (hashcat_ctx_t *hashcat_ctx);
|
||||
void status_progress_destroy (hashcat_ctx_t *hashcat_ctx);
|
||||
void status_progress_reset (hashcat_ctx_t *hashcat_ctx);
|
||||
int status_progress_init (hashcat_ctx_t *hashcat_ctx);
|
||||
void status_progress_destroy (hashcat_ctx_t *hashcat_ctx);
|
||||
void status_progress_reset (hashcat_ctx_t *hashcat_ctx);
|
||||
|
||||
int status_ctx_init (hashcat_ctx_t *hashcat_ctx);
|
||||
void status_ctx_destroy (hashcat_ctx_t *hashcat_ctx);
|
||||
int status_ctx_init (hashcat_ctx_t *hashcat_ctx);
|
||||
void status_ctx_destroy (hashcat_ctx_t *hashcat_ctx);
|
||||
|
||||
void status_status_destroy (hashcat_ctx_t *hashcat_ctx, hashcat_status_t *status_ctx);
|
||||
void status_status_destroy (hashcat_ctx_t *hashcat_ctx, hashcat_status_t *status_ctx);
|
||||
|
||||
#endif // _STATUS_H
|
||||
|
183
include/types.h
183
include/types.h
@ -529,8 +529,8 @@ typedef enum user_options_defaults
|
||||
{
|
||||
ADVICE_DISABLE = false,
|
||||
ATTACK_MODE = ATTACK_MODE_STRAIGHT,
|
||||
BENCHMARK = false,
|
||||
BENCHMARK_ALL = false,
|
||||
BENCHMARK = false,
|
||||
BITMAP_MAX = 24,
|
||||
BITMAP_MIN = 16,
|
||||
DEBUG_MODE = 0,
|
||||
@ -566,13 +566,13 @@ typedef enum user_options_defaults
|
||||
OUTFILE_AUTOHEX = true,
|
||||
OUTFILE_CHECK_TIMER = 5,
|
||||
OUTFILE_FORMAT = 3,
|
||||
WORDLIST_AUTOHEX_DISABLE = false,
|
||||
POTFILE_DISABLE = false,
|
||||
PROGRESS_ONLY = false,
|
||||
QUIET = false,
|
||||
REMOVE = false,
|
||||
REMOVE_TIMER = 60,
|
||||
RESTORE = false,
|
||||
RESTORE_DISABLE = false,
|
||||
RESTORE = false,
|
||||
RESTORE_TIMER = 60,
|
||||
RP_GEN = 0,
|
||||
RP_GEN_FUNC_MAX = 4,
|
||||
@ -580,19 +580,20 @@ typedef enum user_options_defaults
|
||||
RP_GEN_SEED = 0,
|
||||
RUNTIME = 0,
|
||||
SCRYPT_TMTO = 0,
|
||||
SELF_TEST_DISABLE = false,
|
||||
SEGMENT_SIZE = 33554432,
|
||||
SELF_TEST_DISABLE = false,
|
||||
SEPARATOR = ':',
|
||||
SHOW = false,
|
||||
SKIP = 0,
|
||||
SLOW_CANDIDATES = false,
|
||||
SPEED_ONLY = false,
|
||||
STATUS = false,
|
||||
STATUS_TIMER = 10,
|
||||
STDOUT_FLAG = false,
|
||||
SPEED_ONLY = false,
|
||||
PROGRESS_ONLY = false,
|
||||
USAGE = false,
|
||||
USERNAME = false,
|
||||
VERSION = false,
|
||||
WORDLIST_AUTOHEX_DISABLE = false,
|
||||
WORKLOAD_PROFILE = 2,
|
||||
|
||||
} user_options_defaults_t;
|
||||
@ -601,94 +602,95 @@ typedef enum user_options_map
|
||||
{
|
||||
IDX_ADVICE_DISABLE = 0xff00,
|
||||
IDX_ATTACK_MODE = 'a',
|
||||
IDX_BENCHMARK = 'b',
|
||||
IDX_BENCHMARK_ALL = 0xff01,
|
||||
IDX_BENCHMARK = 'b',
|
||||
IDX_BITMAP_MAX = 0xff02,
|
||||
IDX_BITMAP_MIN = 0xff03,
|
||||
IDX_CPU_AFFINITY = 0xff04,
|
||||
IDX_CPU_AFFINITY = 0xff0a,
|
||||
IDX_CUSTOM_CHARSET_1 = '1',
|
||||
IDX_CUSTOM_CHARSET_2 = '2',
|
||||
IDX_CUSTOM_CHARSET_3 = '3',
|
||||
IDX_CUSTOM_CHARSET_4 = '4',
|
||||
IDX_DEBUG_FILE = 0xff05,
|
||||
IDX_DEBUG_MODE = 0xff06,
|
||||
IDX_ENCODING_FROM = 0xff07,
|
||||
IDX_ENCODING_TO = 0xff08,
|
||||
IDX_EXAMPLE_HASHES = 0xff09,
|
||||
IDX_FORCE = 0xff0a,
|
||||
IDX_GPU_TEMP_ABORT = 0xff0b,
|
||||
IDX_GPU_TEMP_DISABLE = 0xff0c,
|
||||
IDX_DEBUG_FILE = 0xff0b,
|
||||
IDX_DEBUG_MODE = 0xff0c,
|
||||
IDX_ENCODING_FROM = 0xff0d,
|
||||
IDX_ENCODING_TO = 0xff0e,
|
||||
IDX_EXAMPLE_HASHES = 0xff0f,
|
||||
IDX_FORCE = 0xff10,
|
||||
IDX_GPU_TEMP_ABORT = 0xff11,
|
||||
IDX_GPU_TEMP_DISABLE = 0xff12,
|
||||
IDX_HASH_MODE = 'm',
|
||||
IDX_HCCAPX_MESSAGE_PAIR = 0xff0d,
|
||||
IDX_HCCAPX_MESSAGE_PAIR = 0xff13,
|
||||
IDX_HELP = 'h',
|
||||
IDX_HEX_CHARSET = 0xff0e,
|
||||
IDX_HEX_SALT = 0xff0f,
|
||||
IDX_HEX_WORDLIST = 0xff10,
|
||||
IDX_HEX_CHARSET = 0xff14,
|
||||
IDX_HEX_SALT = 0xff15,
|
||||
IDX_HEX_WORDLIST = 0xff16,
|
||||
IDX_INCREMENT = 'i',
|
||||
IDX_INCREMENT_MAX = 0xff11,
|
||||
IDX_INCREMENT_MIN = 0xff12,
|
||||
IDX_INDUCTION_DIR = 0xff13,
|
||||
IDX_KEEP_GUESSING = 0xff14,
|
||||
IDX_INCREMENT_MAX = 0xff17,
|
||||
IDX_INCREMENT_MIN = 0xff18,
|
||||
IDX_INDUCTION_DIR = 0xff19,
|
||||
IDX_KEEP_GUESSING = 0xff1a,
|
||||
IDX_KERNEL_ACCEL = 'n',
|
||||
IDX_KERNEL_LOOPS = 'u',
|
||||
IDX_KEYSPACE = 0xff15,
|
||||
IDX_LEFT = 0xff16,
|
||||
IDX_KEYSPACE = 0xff1b,
|
||||
IDX_LEFT = 0xff1c,
|
||||
IDX_LIMIT = 'l',
|
||||
IDX_LOGFILE_DISABLE = 0xff17,
|
||||
IDX_LOOPBACK = 0xff18,
|
||||
IDX_MACHINE_READABLE = 0xff19,
|
||||
IDX_MARKOV_CLASSIC = 0xff1a,
|
||||
IDX_MARKOV_DISABLE = 0xff1b,
|
||||
IDX_MARKOV_HCSTAT2 = 0xff1c,
|
||||
IDX_LOGFILE_DISABLE = 0xff1d,
|
||||
IDX_LOOPBACK = 0xff1e,
|
||||
IDX_MACHINE_READABLE = 0xff1f,
|
||||
IDX_MARKOV_CLASSIC = 0xff20,
|
||||
IDX_MARKOV_DISABLE = 0xff21,
|
||||
IDX_MARKOV_HCSTAT2 = 0xff22,
|
||||
IDX_MARKOV_THRESHOLD = 't',
|
||||
IDX_NONCE_ERROR_CORRECTIONS = 0xff1d,
|
||||
IDX_NVIDIA_SPIN_DAMP = 0xff1e,
|
||||
IDX_NONCE_ERROR_CORRECTIONS = 0xff23,
|
||||
IDX_NVIDIA_SPIN_DAMP = 0xff24,
|
||||
IDX_OPENCL_DEVICES = 'd',
|
||||
IDX_OPENCL_DEVICE_TYPES = 'D',
|
||||
IDX_OPENCL_INFO = 'I',
|
||||
IDX_OPENCL_PLATFORMS = 0xff1f,
|
||||
IDX_OPENCL_VECTOR_WIDTH = 0xff20,
|
||||
IDX_OPENCL_PLATFORMS = 0xff25,
|
||||
IDX_OPENCL_VECTOR_WIDTH = 0xff26,
|
||||
IDX_OPTIMIZED_KERNEL_ENABLE = 'O',
|
||||
IDX_OUTFILE_AUTOHEX_DISABLE = 0xff21,
|
||||
IDX_OUTFILE_CHECK_DIR = 0xff22,
|
||||
IDX_OUTFILE_CHECK_TIMER = 0xff23,
|
||||
IDX_OUTFILE_FORMAT = 0xff24,
|
||||
IDX_OUTFILE_AUTOHEX_DISABLE = 0xff27,
|
||||
IDX_OUTFILE_CHECK_DIR = 0xff28,
|
||||
IDX_OUTFILE_CHECK_TIMER = 0xff29,
|
||||
IDX_OUTFILE_FORMAT = 0xff2a,
|
||||
IDX_OUTFILE = 'o',
|
||||
IDX_WORDLIST_AUTOHEX_DISABLE = 0xff25,
|
||||
IDX_POTFILE_DISABLE = 0xff26,
|
||||
IDX_POTFILE_PATH = 0xff27,
|
||||
IDX_QUIET = 0xff28,
|
||||
IDX_REMOVE = 0xff29,
|
||||
IDX_REMOVE_TIMER = 0xff2a,
|
||||
IDX_RESTORE = 0xff2b,
|
||||
IDX_RESTORE_DISABLE = 0xff2c,
|
||||
IDX_RESTORE_FILE_PATH = 0xff2d,
|
||||
IDX_POTFILE_DISABLE = 0xff2b,
|
||||
IDX_POTFILE_PATH = 0xff2c,
|
||||
IDX_PROGRESS_ONLY = 0xff2d,
|
||||
IDX_QUIET = 0xff2e,
|
||||
IDX_REMOVE = 0xff2f,
|
||||
IDX_REMOVE_TIMER = 0xff30,
|
||||
IDX_RESTORE = 0xff31,
|
||||
IDX_RESTORE_DISABLE = 0xff32,
|
||||
IDX_RESTORE_FILE_PATH = 0xff33,
|
||||
IDX_RP_FILE = 'r',
|
||||
IDX_RP_GEN_FUNC_MAX = 0xff2e,
|
||||
IDX_RP_GEN_FUNC_MIN = 0xff2f,
|
||||
IDX_RP_GEN_FUNC_MAX = 0xff34,
|
||||
IDX_RP_GEN_FUNC_MIN = 0xff35,
|
||||
IDX_RP_GEN = 'g',
|
||||
IDX_RP_GEN_SEED = 0xff30,
|
||||
IDX_RP_GEN_SEED = 0xff36,
|
||||
IDX_RULE_BUF_L = 'j',
|
||||
IDX_RULE_BUF_R = 'k',
|
||||
IDX_RUNTIME = 0xff31,
|
||||
IDX_SCRYPT_TMTO = 0xff32,
|
||||
IDX_SELF_TEST_DISABLE = 0xff33,
|
||||
IDX_RUNTIME = 0xff37,
|
||||
IDX_SCRYPT_TMTO = 0xff38,
|
||||
IDX_SEGMENT_SIZE = 'c',
|
||||
IDX_SELF_TEST_DISABLE = 0xff39,
|
||||
IDX_SEPARATOR = 'p',
|
||||
IDX_SESSION = 0xff34,
|
||||
IDX_SHOW = 0xff35,
|
||||
IDX_SESSION = 0xff3a,
|
||||
IDX_SHOW = 0xff3b,
|
||||
IDX_SKIP = 's',
|
||||
IDX_STATUS = 0xff36,
|
||||
IDX_STATUS_TIMER = 0xff37,
|
||||
IDX_STDOUT_FLAG = 0xff38,
|
||||
IDX_SPEED_ONLY = 0xff39,
|
||||
IDX_PROGRESS_ONLY = 0xff3a,
|
||||
IDX_TRUECRYPT_KEYFILES = 0xff3b,
|
||||
IDX_USERNAME = 0xff3c,
|
||||
IDX_VERACRYPT_KEYFILES = 0xff3d,
|
||||
IDX_VERACRYPT_PIM = 0xff3e,
|
||||
IDX_SLOW_CANDIDATES = 'S',
|
||||
IDX_SPEED_ONLY = 0xff3c,
|
||||
IDX_STATUS = 0xff3d,
|
||||
IDX_STATUS_TIMER = 0xff3e,
|
||||
IDX_STDOUT_FLAG = 0xff3f,
|
||||
IDX_TRUECRYPT_KEYFILES = 0xff40,
|
||||
IDX_USERNAME = 0xff41,
|
||||
IDX_VERACRYPT_KEYFILES = 0xff42,
|
||||
IDX_VERACRYPT_PIM = 0xff43,
|
||||
IDX_VERSION_LOWER = 'v',
|
||||
IDX_VERSION = 'V',
|
||||
IDX_WORDLIST_AUTOHEX_DISABLE = 0xff44,
|
||||
IDX_WORKLOAD_PROFILE = 'w',
|
||||
|
||||
} user_options_map_t;
|
||||
@ -898,6 +900,18 @@ typedef struct pw
|
||||
|
||||
} pw_t;
|
||||
|
||||
typedef struct pw_pre
|
||||
{
|
||||
u32 pw_buf[64];
|
||||
u32 pw_len;
|
||||
|
||||
u32 base_buf[64];
|
||||
u32 base_len;
|
||||
|
||||
u32 rule_idx;
|
||||
|
||||
} pw_pre_t;
|
||||
|
||||
typedef struct pw_idx
|
||||
{
|
||||
u32 off;
|
||||
@ -1051,6 +1065,8 @@ typedef struct hc_device_param
|
||||
size_t size_pws_amp;
|
||||
size_t size_pws_comp;
|
||||
size_t size_pws_idx;
|
||||
size_t size_pws_pre;
|
||||
size_t size_pws_base;
|
||||
size_t size_tmps;
|
||||
size_t size_hooks;
|
||||
size_t size_bfs;
|
||||
@ -1079,6 +1095,12 @@ typedef struct hc_device_param
|
||||
u32 *pws_comp;
|
||||
u64 pws_cnt;
|
||||
|
||||
pw_pre_t *pws_pre_buf;
|
||||
u64 pws_pre_cnt;
|
||||
|
||||
pw_pre_t *pws_base_buf; // for debug mode
|
||||
u64 pws_base_cnt;
|
||||
|
||||
u64 words_off;
|
||||
u64 words_done;
|
||||
|
||||
@ -1596,20 +1618,20 @@ typedef struct user_options
|
||||
|
||||
bool attack_mode_chgd;
|
||||
bool hash_mode_chgd;
|
||||
bool hccapx_message_pair_chgd;
|
||||
bool increment_max_chgd;
|
||||
bool increment_min_chgd;
|
||||
bool kernel_accel_chgd;
|
||||
bool kernel_loops_chgd;
|
||||
bool nonce_error_corrections_chgd;
|
||||
bool nvidia_spin_damp_chgd;
|
||||
bool opencl_vector_width_chgd;
|
||||
bool outfile_format_chgd;
|
||||
bool remove_timer_chgd;
|
||||
bool rp_gen_seed_chgd;
|
||||
bool runtime_chgd;
|
||||
bool workload_profile_chgd;
|
||||
bool segment_size_chgd;
|
||||
bool hccapx_message_pair_chgd;
|
||||
bool nonce_error_corrections_chgd;
|
||||
bool workload_profile_chgd;
|
||||
|
||||
bool advice_disable;
|
||||
bool benchmark;
|
||||
@ -1632,29 +1654,25 @@ typedef struct user_options
|
||||
bool opencl_info;
|
||||
bool optimized_kernel_enable;
|
||||
bool outfile_autohex;
|
||||
bool wordlist_autohex_disable;
|
||||
bool potfile_disable;
|
||||
bool progress_only;
|
||||
bool quiet;
|
||||
bool remove;
|
||||
bool restore;
|
||||
bool restore_disable;
|
||||
bool self_test_disable;
|
||||
bool show;
|
||||
bool slow_candidates;
|
||||
bool speed_only;
|
||||
bool status;
|
||||
bool stdout_flag;
|
||||
bool speed_only;
|
||||
bool progress_only;
|
||||
bool usage;
|
||||
bool username;
|
||||
bool version;
|
||||
bool wordlist_autohex_disable;
|
||||
char *cpu_affinity;
|
||||
const char *custom_charset_1;
|
||||
const char *custom_charset_2;
|
||||
const char *custom_charset_3;
|
||||
char *custom_charset_4;
|
||||
char *debug_file;
|
||||
const char *encoding_from;
|
||||
const char *encoding_to;
|
||||
char *induction_dir;
|
||||
char *markov_hcstat2;
|
||||
char *opencl_devices;
|
||||
@ -1665,12 +1683,17 @@ typedef struct user_options
|
||||
char *potfile_path;
|
||||
char *restore_file_path;
|
||||
char **rp_files;
|
||||
const char *rule_buf_l;
|
||||
const char *rule_buf_r;
|
||||
char separator;
|
||||
const char *session;
|
||||
char *truecrypt_keyfiles;
|
||||
char *veracrypt_keyfiles;
|
||||
const char *custom_charset_1;
|
||||
const char *custom_charset_2;
|
||||
const char *custom_charset_3;
|
||||
const char *encoding_from;
|
||||
const char *encoding_to;
|
||||
const char *rule_buf_l;
|
||||
const char *rule_buf_r;
|
||||
const char *session;
|
||||
u32 attack_mode;
|
||||
u32 bitmap_max;
|
||||
u32 bitmap_min;
|
||||
|
@ -11,7 +11,9 @@
|
||||
|
||||
size_t convert_from_hex (hashcat_ctx_t *hashcat_ctx, char *line_buf, const size_t line_len);
|
||||
|
||||
void pw_add (hc_device_param_t *device_param, const u8 *pw_buf, const int pw_len);
|
||||
void pw_pre_add (hc_device_param_t *device_param, const u8 *pw_buf, const int pw_len, const u8 *base_buf, const int base_len, const int rule_idx);
|
||||
void pw_base_add (hc_device_param_t *device_param, pw_pre_t *pw_pre);
|
||||
void pw_add (hc_device_param_t *device_param, const u8 *pw_buf, const int pw_len);
|
||||
|
||||
void get_next_word_lm (char *buf, u64 sz, u64 *len, u64 *off);
|
||||
void get_next_word_uc (char *buf, u64 sz, u64 *len, u64 *off);
|
||||
|
@ -315,7 +315,7 @@ CFLAGS_CROSS_WIN64_LZMA := $(filter-out $(CFLAGS_REMOVE_LZMA),$(CFLAGS_CROSS_W
|
||||
## 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_lzma 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
|
||||
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_lzma 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 slow_candidates 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)
|
||||
|
@ -47,6 +47,7 @@ static int autotune (hashcat_ctx_t *hashcat_ctx, hc_device_param_t *device_param
|
||||
const hashconfig_t *hashconfig = hashcat_ctx->hashconfig;
|
||||
const opencl_ctx_t *opencl_ctx = hashcat_ctx->opencl_ctx;
|
||||
const straight_ctx_t *straight_ctx = hashcat_ctx->straight_ctx;
|
||||
const user_options_t *user_options = hashcat_ctx->user_options;
|
||||
|
||||
const double target_msec = opencl_ctx->target_msec;
|
||||
|
||||
@ -103,13 +104,19 @@ static int autotune (hashcat_ctx_t *hashcat_ctx, hc_device_param_t *device_param
|
||||
|
||||
if (CL_rc == -1) return -1;
|
||||
|
||||
if (hashconfig->attack_exec == ATTACK_EXEC_INSIDE_KERNEL)
|
||||
if (user_options->slow_candidates == true)
|
||||
{
|
||||
if (straight_ctx->kernel_rules_cnt > 1)
|
||||
}
|
||||
else
|
||||
{
|
||||
if (hashconfig->attack_exec == ATTACK_EXEC_INSIDE_KERNEL)
|
||||
{
|
||||
CL_rc = hc_clEnqueueCopyBuffer (hashcat_ctx, device_param->command_queue, device_param->d_rules, device_param->d_rules_c, 0, 0, MIN (kernel_loops_max, KERNEL_RULES) * sizeof (kernel_rule_t), 0, NULL, NULL);
|
||||
if (straight_ctx->kernel_rules_cnt > 1)
|
||||
{
|
||||
CL_rc = hc_clEnqueueCopyBuffer (hashcat_ctx, device_param->command_queue, device_param->d_rules, device_param->d_rules_c, 0, 0, MIN (kernel_loops_max, KERNEL_RULES) * sizeof (kernel_rule_t), 0, NULL, NULL);
|
||||
|
||||
if (CL_rc == -1) return -1;
|
||||
if (CL_rc == -1) return -1;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
504
src/combinator.c
504
src/combinator.c
@ -33,296 +33,302 @@ int combinator_ctx_init (hashcat_ctx_t *hashcat_ctx)
|
||||
|
||||
combinator_ctx->enabled = true;
|
||||
|
||||
if (hashconfig->opti_type & OPTI_TYPE_OPTIMIZED_KERNEL)
|
||||
if (user_options->slow_candidates == true)
|
||||
{
|
||||
if (user_options->attack_mode == ATTACK_MODE_COMBI)
|
||||
{
|
||||
// display
|
||||
|
||||
char *dictfile1 = user_options_extra->hc_workv[0];
|
||||
char *dictfile2 = user_options_extra->hc_workv[1];
|
||||
|
||||
// at this point we know the file actually exist
|
||||
// find the bigger dictionary and use as base
|
||||
|
||||
if (hc_path_is_file (dictfile1) == false)
|
||||
{
|
||||
event_log_error (hashcat_ctx, "%s: Not a regular file.", dictfile1);
|
||||
|
||||
return -1;
|
||||
}
|
||||
|
||||
if (hc_path_is_file (dictfile2) == false)
|
||||
{
|
||||
event_log_error (hashcat_ctx, "%s: Not a regular file.", dictfile2);
|
||||
|
||||
return -1;
|
||||
}
|
||||
|
||||
FILE *fp1 = NULL;
|
||||
FILE *fp2 = NULL;
|
||||
|
||||
if ((fp1 = fopen (dictfile1, "rb")) == NULL)
|
||||
{
|
||||
event_log_error (hashcat_ctx, "%s: %s", dictfile1, strerror (errno));
|
||||
|
||||
return -1;
|
||||
}
|
||||
|
||||
if ((fp2 = fopen (dictfile2, "rb")) == NULL)
|
||||
{
|
||||
event_log_error (hashcat_ctx, "%s: %s", dictfile2, strerror (errno));
|
||||
|
||||
fclose (fp1);
|
||||
|
||||
return -1;
|
||||
}
|
||||
|
||||
combinator_ctx->combs_cnt = 1;
|
||||
|
||||
u64 words1_cnt = 0;
|
||||
|
||||
const int rc1 = count_words (hashcat_ctx, fp1, dictfile1, &words1_cnt);
|
||||
|
||||
if (rc1 == -1)
|
||||
{
|
||||
event_log_error (hashcat_ctx, "Integer overflow detected in keyspace of wordlist: %s", dictfile1);
|
||||
|
||||
fclose (fp1);
|
||||
fclose (fp2);
|
||||
|
||||
return -1;
|
||||
}
|
||||
|
||||
if (words1_cnt == 0)
|
||||
{
|
||||
event_log_error (hashcat_ctx, "%s: empty file.", dictfile1);
|
||||
|
||||
fclose (fp1);
|
||||
fclose (fp2);
|
||||
|
||||
return -1;
|
||||
}
|
||||
|
||||
combinator_ctx->combs_cnt = 1;
|
||||
|
||||
u64 words2_cnt = 0;
|
||||
|
||||
const int rc2 = count_words (hashcat_ctx, fp2, dictfile2, &words2_cnt);
|
||||
|
||||
if (rc2 == -1)
|
||||
{
|
||||
event_log_error (hashcat_ctx, "Integer overflow detected in keyspace of wordlist: %s", dictfile2);
|
||||
|
||||
fclose (fp1);
|
||||
fclose (fp2);
|
||||
|
||||
return -1;
|
||||
}
|
||||
|
||||
if (words2_cnt == 0)
|
||||
{
|
||||
event_log_error (hashcat_ctx, "%s: empty file.", dictfile2);
|
||||
|
||||
fclose (fp1);
|
||||
fclose (fp2);
|
||||
|
||||
return -1;
|
||||
}
|
||||
|
||||
fclose (fp1);
|
||||
fclose (fp2);
|
||||
|
||||
combinator_ctx->dict1 = dictfile1;
|
||||
combinator_ctx->dict2 = dictfile2;
|
||||
|
||||
if (words1_cnt >= words2_cnt)
|
||||
{
|
||||
combinator_ctx->combs_mode = COMBINATOR_MODE_BASE_LEFT;
|
||||
combinator_ctx->combs_cnt = words2_cnt;
|
||||
}
|
||||
else
|
||||
{
|
||||
combinator_ctx->combs_mode = COMBINATOR_MODE_BASE_RIGHT;
|
||||
combinator_ctx->combs_cnt = words1_cnt;
|
||||
|
||||
// we also have to switch wordlist related rules!
|
||||
|
||||
const char *tmpc = user_options->rule_buf_l;
|
||||
|
||||
user_options->rule_buf_l = user_options->rule_buf_r;
|
||||
user_options->rule_buf_r = tmpc;
|
||||
|
||||
u32 tmpi = user_options_extra->rule_len_l;
|
||||
|
||||
user_options_extra->rule_len_l = user_options_extra->rule_len_r;
|
||||
user_options_extra->rule_len_r = tmpi;
|
||||
}
|
||||
}
|
||||
else if (user_options->attack_mode == ATTACK_MODE_HYBRID1)
|
||||
{
|
||||
combinator_ctx->combs_mode = COMBINATOR_MODE_BASE_LEFT;
|
||||
}
|
||||
else if (user_options->attack_mode == ATTACK_MODE_HYBRID2)
|
||||
{
|
||||
combinator_ctx->combs_mode = COMBINATOR_MODE_BASE_RIGHT;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
// this is always need to be COMBINATOR_MODE_BASE_LEFT
|
||||
|
||||
if (user_options->attack_mode == ATTACK_MODE_COMBI)
|
||||
if (hashconfig->opti_type & OPTI_TYPE_OPTIMIZED_KERNEL)
|
||||
{
|
||||
// display
|
||||
|
||||
char *dictfile1 = user_options_extra->hc_workv[0];
|
||||
char *dictfile2 = user_options_extra->hc_workv[1];
|
||||
|
||||
// at this point we know the file actually exist
|
||||
// find the bigger dictionary and use as base
|
||||
|
||||
if (hc_path_is_file (dictfile1) == false)
|
||||
if (user_options->attack_mode == ATTACK_MODE_COMBI)
|
||||
{
|
||||
event_log_error (hashcat_ctx, "%s: Not a regular file.", dictfile1);
|
||||
// display
|
||||
|
||||
return -1;
|
||||
}
|
||||
char *dictfile1 = user_options_extra->hc_workv[0];
|
||||
char *dictfile2 = user_options_extra->hc_workv[1];
|
||||
|
||||
if (hc_path_is_file (dictfile2) == false)
|
||||
{
|
||||
event_log_error (hashcat_ctx, "%s: Not a regular file.", dictfile2);
|
||||
// at this point we know the file actually exist
|
||||
// find the bigger dictionary and use as base
|
||||
|
||||
return -1;
|
||||
}
|
||||
if (hc_path_is_file (dictfile1) == false)
|
||||
{
|
||||
event_log_error (hashcat_ctx, "%s: Not a regular file.", dictfile1);
|
||||
|
||||
FILE *fp1 = NULL;
|
||||
FILE *fp2 = NULL;
|
||||
return -1;
|
||||
}
|
||||
|
||||
if ((fp1 = fopen (dictfile1, "rb")) == NULL)
|
||||
{
|
||||
event_log_error (hashcat_ctx, "%s: %s", dictfile1, strerror (errno));
|
||||
if (hc_path_is_file (dictfile2) == false)
|
||||
{
|
||||
event_log_error (hashcat_ctx, "%s: Not a regular file.", dictfile2);
|
||||
|
||||
return -1;
|
||||
}
|
||||
return -1;
|
||||
}
|
||||
|
||||
if ((fp2 = fopen (dictfile2, "rb")) == NULL)
|
||||
{
|
||||
event_log_error (hashcat_ctx, "%s: %s", dictfile2, strerror (errno));
|
||||
FILE *fp1 = NULL;
|
||||
FILE *fp2 = NULL;
|
||||
|
||||
fclose (fp1);
|
||||
if ((fp1 = fopen (dictfile1, "rb")) == NULL)
|
||||
{
|
||||
event_log_error (hashcat_ctx, "%s: %s", dictfile1, strerror (errno));
|
||||
|
||||
return -1;
|
||||
}
|
||||
return -1;
|
||||
}
|
||||
|
||||
combinator_ctx->combs_cnt = 1;
|
||||
if ((fp2 = fopen (dictfile2, "rb")) == NULL)
|
||||
{
|
||||
event_log_error (hashcat_ctx, "%s: %s", dictfile2, strerror (errno));
|
||||
|
||||
u64 words1_cnt = 0;
|
||||
fclose (fp1);
|
||||
|
||||
const int rc1 = count_words (hashcat_ctx, fp1, dictfile1, &words1_cnt);
|
||||
return -1;
|
||||
}
|
||||
|
||||
if (rc1 == -1)
|
||||
{
|
||||
event_log_error (hashcat_ctx, "Integer overflow detected in keyspace of wordlist: %s", dictfile1);
|
||||
combinator_ctx->combs_cnt = 1;
|
||||
|
||||
u64 words1_cnt = 0;
|
||||
|
||||
const int rc1 = count_words (hashcat_ctx, fp1, dictfile1, &words1_cnt);
|
||||
|
||||
if (rc1 == -1)
|
||||
{
|
||||
event_log_error (hashcat_ctx, "Integer overflow detected in keyspace of wordlist: %s", dictfile1);
|
||||
|
||||
fclose (fp1);
|
||||
fclose (fp2);
|
||||
|
||||
return -1;
|
||||
}
|
||||
|
||||
if (words1_cnt == 0)
|
||||
{
|
||||
event_log_error (hashcat_ctx, "%s: empty file.", dictfile1);
|
||||
|
||||
fclose (fp1);
|
||||
fclose (fp2);
|
||||
|
||||
return -1;
|
||||
}
|
||||
|
||||
combinator_ctx->combs_cnt = 1;
|
||||
|
||||
u64 words2_cnt = 0;
|
||||
|
||||
const int rc2 = count_words (hashcat_ctx, fp2, dictfile2, &words2_cnt);
|
||||
|
||||
if (rc2 == -1)
|
||||
{
|
||||
event_log_error (hashcat_ctx, "Integer overflow detected in keyspace of wordlist: %s", dictfile2);
|
||||
|
||||
fclose (fp1);
|
||||
fclose (fp2);
|
||||
|
||||
return -1;
|
||||
}
|
||||
|
||||
if (words2_cnt == 0)
|
||||
{
|
||||
event_log_error (hashcat_ctx, "%s: empty file.", dictfile2);
|
||||
|
||||
fclose (fp1);
|
||||
fclose (fp2);
|
||||
|
||||
return -1;
|
||||
}
|
||||
|
||||
fclose (fp1);
|
||||
fclose (fp2);
|
||||
|
||||
return -1;
|
||||
}
|
||||
combinator_ctx->dict1 = dictfile1;
|
||||
combinator_ctx->dict2 = dictfile2;
|
||||
|
||||
if (words1_cnt == 0)
|
||||
if (words1_cnt >= words2_cnt)
|
||||
{
|
||||
combinator_ctx->combs_mode = COMBINATOR_MODE_BASE_LEFT;
|
||||
combinator_ctx->combs_cnt = words2_cnt;
|
||||
}
|
||||
else
|
||||
{
|
||||
combinator_ctx->combs_mode = COMBINATOR_MODE_BASE_RIGHT;
|
||||
combinator_ctx->combs_cnt = words1_cnt;
|
||||
|
||||
// we also have to switch wordlist related rules!
|
||||
|
||||
const char *tmpc = user_options->rule_buf_l;
|
||||
|
||||
user_options->rule_buf_l = user_options->rule_buf_r;
|
||||
user_options->rule_buf_r = tmpc;
|
||||
|
||||
u32 tmpi = user_options_extra->rule_len_l;
|
||||
|
||||
user_options_extra->rule_len_l = user_options_extra->rule_len_r;
|
||||
user_options_extra->rule_len_r = tmpi;
|
||||
}
|
||||
}
|
||||
else if (user_options->attack_mode == ATTACK_MODE_HYBRID1)
|
||||
{
|
||||
event_log_error (hashcat_ctx, "%s: empty file.", dictfile1);
|
||||
|
||||
fclose (fp1);
|
||||
fclose (fp2);
|
||||
|
||||
return -1;
|
||||
combinator_ctx->combs_mode = COMBINATOR_MODE_BASE_LEFT;
|
||||
}
|
||||
|
||||
combinator_ctx->combs_cnt = 1;
|
||||
|
||||
u64 words2_cnt = 0;
|
||||
|
||||
const int rc2 = count_words (hashcat_ctx, fp2, dictfile2, &words2_cnt);
|
||||
|
||||
if (rc2 == -1)
|
||||
else if (user_options->attack_mode == ATTACK_MODE_HYBRID2)
|
||||
{
|
||||
event_log_error (hashcat_ctx, "Integer overflow detected in keyspace of wordlist: %s", dictfile2);
|
||||
|
||||
fclose (fp1);
|
||||
fclose (fp2);
|
||||
|
||||
return -1;
|
||||
combinator_ctx->combs_mode = COMBINATOR_MODE_BASE_RIGHT;
|
||||
}
|
||||
|
||||
if (words2_cnt == 0)
|
||||
{
|
||||
event_log_error (hashcat_ctx, "%s: empty file.", dictfile2);
|
||||
|
||||
fclose (fp1);
|
||||
fclose (fp2);
|
||||
|
||||
return -1;
|
||||
}
|
||||
|
||||
fclose (fp1);
|
||||
fclose (fp2);
|
||||
|
||||
combinator_ctx->dict1 = dictfile1;
|
||||
combinator_ctx->dict2 = dictfile2;
|
||||
|
||||
combinator_ctx->combs_mode = COMBINATOR_MODE_BASE_LEFT;
|
||||
combinator_ctx->combs_cnt = words2_cnt;
|
||||
}
|
||||
else if (user_options->attack_mode == ATTACK_MODE_HYBRID1)
|
||||
else
|
||||
{
|
||||
combinator_ctx->combs_mode = COMBINATOR_MODE_BASE_LEFT;
|
||||
}
|
||||
else if (user_options->attack_mode == ATTACK_MODE_HYBRID2)
|
||||
{
|
||||
mask_ctx_t *mask_ctx = hashcat_ctx->mask_ctx;
|
||||
// this is always need to be COMBINATOR_MODE_BASE_LEFT
|
||||
|
||||
char *dictfile = user_options_extra->hc_workv[1];
|
||||
|
||||
// at this point we know the file actually exist
|
||||
|
||||
if (hc_path_is_file (dictfile) == false)
|
||||
if (user_options->attack_mode == ATTACK_MODE_COMBI)
|
||||
{
|
||||
event_log_error (hashcat_ctx, "%s: Not a regular file.", dictfile);
|
||||
// display
|
||||
|
||||
return -1;
|
||||
char *dictfile1 = user_options_extra->hc_workv[0];
|
||||
char *dictfile2 = user_options_extra->hc_workv[1];
|
||||
|
||||
// at this point we know the file actually exist
|
||||
// find the bigger dictionary and use as base
|
||||
|
||||
if (hc_path_is_file (dictfile1) == false)
|
||||
{
|
||||
event_log_error (hashcat_ctx, "%s: Not a regular file.", dictfile1);
|
||||
|
||||
return -1;
|
||||
}
|
||||
|
||||
if (hc_path_is_file (dictfile2) == false)
|
||||
{
|
||||
event_log_error (hashcat_ctx, "%s: Not a regular file.", dictfile2);
|
||||
|
||||
return -1;
|
||||
}
|
||||
|
||||
FILE *fp1 = NULL;
|
||||
FILE *fp2 = NULL;
|
||||
|
||||
if ((fp1 = fopen (dictfile1, "rb")) == NULL)
|
||||
{
|
||||
event_log_error (hashcat_ctx, "%s: %s", dictfile1, strerror (errno));
|
||||
|
||||
return -1;
|
||||
}
|
||||
|
||||
if ((fp2 = fopen (dictfile2, "rb")) == NULL)
|
||||
{
|
||||
event_log_error (hashcat_ctx, "%s: %s", dictfile2, strerror (errno));
|
||||
|
||||
fclose (fp1);
|
||||
|
||||
return -1;
|
||||
}
|
||||
|
||||
combinator_ctx->combs_cnt = 1;
|
||||
|
||||
u64 words1_cnt = 0;
|
||||
|
||||
const int rc1 = count_words (hashcat_ctx, fp1, dictfile1, &words1_cnt);
|
||||
|
||||
if (rc1 == -1)
|
||||
{
|
||||
event_log_error (hashcat_ctx, "Integer overflow detected in keyspace of wordlist: %s", dictfile1);
|
||||
|
||||
fclose (fp1);
|
||||
fclose (fp2);
|
||||
|
||||
return -1;
|
||||
}
|
||||
|
||||
if (words1_cnt == 0)
|
||||
{
|
||||
event_log_error (hashcat_ctx, "%s: empty file.", dictfile1);
|
||||
|
||||
fclose (fp1);
|
||||
fclose (fp2);
|
||||
|
||||
return -1;
|
||||
}
|
||||
|
||||
combinator_ctx->combs_cnt = 1;
|
||||
|
||||
u64 words2_cnt = 0;
|
||||
|
||||
const int rc2 = count_words (hashcat_ctx, fp2, dictfile2, &words2_cnt);
|
||||
|
||||
if (rc2 == -1)
|
||||
{
|
||||
event_log_error (hashcat_ctx, "Integer overflow detected in keyspace of wordlist: %s", dictfile2);
|
||||
|
||||
fclose (fp1);
|
||||
fclose (fp2);
|
||||
|
||||
return -1;
|
||||
}
|
||||
|
||||
if (words2_cnt == 0)
|
||||
{
|
||||
event_log_error (hashcat_ctx, "%s: empty file.", dictfile2);
|
||||
|
||||
fclose (fp1);
|
||||
fclose (fp2);
|
||||
|
||||
return -1;
|
||||
}
|
||||
|
||||
fclose (fp1);
|
||||
fclose (fp2);
|
||||
|
||||
combinator_ctx->dict1 = dictfile1;
|
||||
combinator_ctx->dict2 = dictfile2;
|
||||
|
||||
combinator_ctx->combs_mode = COMBINATOR_MODE_BASE_LEFT;
|
||||
combinator_ctx->combs_cnt = words2_cnt;
|
||||
}
|
||||
|
||||
FILE *fp = NULL;
|
||||
|
||||
if ((fp = fopen (dictfile, "rb")) == NULL)
|
||||
else if (user_options->attack_mode == ATTACK_MODE_HYBRID1)
|
||||
{
|
||||
event_log_error (hashcat_ctx, "%s: %s", dictfile, strerror (errno));
|
||||
|
||||
return -1;
|
||||
combinator_ctx->combs_mode = COMBINATOR_MODE_BASE_LEFT;
|
||||
}
|
||||
|
||||
mask_ctx->bfs_cnt = 1;
|
||||
|
||||
u64 words_cnt = 0;
|
||||
|
||||
const int rc = count_words (hashcat_ctx, fp, dictfile, &words_cnt);
|
||||
|
||||
if (rc == -1)
|
||||
else if (user_options->attack_mode == ATTACK_MODE_HYBRID2)
|
||||
{
|
||||
event_log_error (hashcat_ctx, "Integer overflow detected in keyspace of wordlist: %s", dictfile);
|
||||
mask_ctx_t *mask_ctx = hashcat_ctx->mask_ctx;
|
||||
|
||||
char *dictfile = user_options_extra->hc_workv[1];
|
||||
|
||||
// at this point we know the file actually exist
|
||||
|
||||
if (hc_path_is_file (dictfile) == false)
|
||||
{
|
||||
event_log_error (hashcat_ctx, "%s: Not a regular file.", dictfile);
|
||||
|
||||
return -1;
|
||||
}
|
||||
|
||||
FILE *fp = NULL;
|
||||
|
||||
if ((fp = fopen (dictfile, "rb")) == NULL)
|
||||
{
|
||||
event_log_error (hashcat_ctx, "%s: %s", dictfile, strerror (errno));
|
||||
|
||||
return -1;
|
||||
}
|
||||
|
||||
mask_ctx->bfs_cnt = 1;
|
||||
|
||||
u64 words_cnt = 0;
|
||||
|
||||
const int rc = count_words (hashcat_ctx, fp, dictfile, &words_cnt);
|
||||
|
||||
if (rc == -1)
|
||||
{
|
||||
event_log_error (hashcat_ctx, "Integer overflow detected in keyspace of wordlist: %s", dictfile);
|
||||
|
||||
fclose (fp);
|
||||
|
||||
return -1;
|
||||
}
|
||||
|
||||
fclose (fp);
|
||||
|
||||
return -1;
|
||||
combinator_ctx->combs_cnt = words_cnt;
|
||||
combinator_ctx->combs_mode = COMBINATOR_MODE_BASE_LEFT;
|
||||
}
|
||||
|
||||
fclose (fp);
|
||||
|
||||
combinator_ctx->combs_cnt = words_cnt;
|
||||
combinator_ctx->combs_mode = COMBINATOR_MODE_BASE_LEFT;
|
||||
}
|
||||
}
|
||||
|
||||
|
1242
src/dispatch.c
1242
src/dispatch.c
File diff suppressed because it is too large
Load Diff
@ -1386,26 +1386,26 @@ int hashcat_get_status (hashcat_ctx_t *hashcat_ctx, hashcat_status_t *hashcat_st
|
||||
{
|
||||
device_info_t *device_info = hashcat_status->device_info_buf + device_id;
|
||||
|
||||
device_info->skipped_dev = status_get_skipped_dev (hashcat_ctx, device_id);
|
||||
device_info->hashes_msec_dev = status_get_hashes_msec_dev (hashcat_ctx, device_id);
|
||||
device_info->hashes_msec_dev_benchmark = status_get_hashes_msec_dev_benchmark (hashcat_ctx, device_id);
|
||||
device_info->exec_msec_dev = status_get_exec_msec_dev (hashcat_ctx, device_id);
|
||||
device_info->speed_sec_dev = status_get_speed_sec_dev (hashcat_ctx, device_id);
|
||||
device_info->guess_candidates_dev = status_get_guess_candidates_dev (hashcat_ctx, device_id);
|
||||
device_info->hwmon_dev = status_get_hwmon_dev (hashcat_ctx, device_id);
|
||||
device_info->corespeed_dev = status_get_corespeed_dev (hashcat_ctx, device_id);
|
||||
device_info->memoryspeed_dev = status_get_memoryspeed_dev (hashcat_ctx, device_id);
|
||||
device_info->progress_dev = status_get_progress_dev (hashcat_ctx, device_id);
|
||||
device_info->runtime_msec_dev = status_get_runtime_msec_dev (hashcat_ctx, device_id);
|
||||
device_info->kernel_accel_dev = status_get_kernel_accel_dev (hashcat_ctx, device_id);
|
||||
device_info->kernel_loops_dev = status_get_kernel_loops_dev (hashcat_ctx, device_id);
|
||||
device_info->kernel_threads_dev = status_get_kernel_threads_dev (hashcat_ctx, device_id);
|
||||
device_info->vector_width_dev = status_get_vector_width_dev (hashcat_ctx, device_id);
|
||||
device_info->salt_pos_dev = status_get_salt_pos_dev (hashcat_ctx, device_id);
|
||||
device_info->innerloop_pos_dev = status_get_innerloop_pos_dev (hashcat_ctx, device_id);
|
||||
device_info->innerloop_left_dev = status_get_innerloop_left_dev (hashcat_ctx, device_id);
|
||||
device_info->iteration_pos_dev = status_get_iteration_pos_dev (hashcat_ctx, device_id);
|
||||
device_info->iteration_left_dev = status_get_iteration_left_dev (hashcat_ctx, device_id);
|
||||
device_info->skipped_dev = status_get_skipped_dev (hashcat_ctx, device_id);
|
||||
device_info->hashes_msec_dev = status_get_hashes_msec_dev (hashcat_ctx, device_id);
|
||||
device_info->hashes_msec_dev_benchmark = status_get_hashes_msec_dev_benchmark (hashcat_ctx, device_id);
|
||||
device_info->exec_msec_dev = status_get_exec_msec_dev (hashcat_ctx, device_id);
|
||||
device_info->speed_sec_dev = status_get_speed_sec_dev (hashcat_ctx, device_id);
|
||||
device_info->guess_candidates_dev = status_get_guess_candidates_dev (hashcat_ctx, device_id);
|
||||
device_info->hwmon_dev = status_get_hwmon_dev (hashcat_ctx, device_id);
|
||||
device_info->corespeed_dev = status_get_corespeed_dev (hashcat_ctx, device_id);
|
||||
device_info->memoryspeed_dev = status_get_memoryspeed_dev (hashcat_ctx, device_id);
|
||||
device_info->progress_dev = status_get_progress_dev (hashcat_ctx, device_id);
|
||||
device_info->runtime_msec_dev = status_get_runtime_msec_dev (hashcat_ctx, device_id);
|
||||
device_info->kernel_accel_dev = status_get_kernel_accel_dev (hashcat_ctx, device_id);
|
||||
device_info->kernel_loops_dev = status_get_kernel_loops_dev (hashcat_ctx, device_id);
|
||||
device_info->kernel_threads_dev = status_get_kernel_threads_dev (hashcat_ctx, device_id);
|
||||
device_info->vector_width_dev = status_get_vector_width_dev (hashcat_ctx, device_id);
|
||||
device_info->salt_pos_dev = status_get_salt_pos_dev (hashcat_ctx, device_id);
|
||||
device_info->innerloop_pos_dev = status_get_innerloop_pos_dev (hashcat_ctx, device_id);
|
||||
device_info->innerloop_left_dev = status_get_innerloop_left_dev (hashcat_ctx, device_id);
|
||||
device_info->iteration_pos_dev = status_get_iteration_pos_dev (hashcat_ctx, device_id);
|
||||
device_info->iteration_left_dev = status_get_iteration_left_dev (hashcat_ctx, device_id);
|
||||
}
|
||||
|
||||
hashcat_status->hashes_msec_all = status_get_hashes_msec_all (hashcat_ctx);
|
||||
|
@ -51,8 +51,7 @@ int induct_ctx_init (hashcat_ctx_t *hashcat_ctx)
|
||||
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;
|
||||
if (user_options->attack_mode != ATTACK_MODE_STRAIGHT) return 0;
|
||||
|
||||
induct_ctx->enabled = true;
|
||||
|
||||
|
@ -27322,11 +27322,11 @@ int hashconfig_init (hashcat_ctx_t *hashcat_ctx)
|
||||
|
||||
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 (user_options->slow_candidates, hashconfig->attack_exec, user_options_extra->attack_kern, hashconfig->kern_type, false, folder_config->shared_dir, source_file);
|
||||
|
||||
hashconfig->has_pure_kernel = hc_path_read (source_file);
|
||||
|
||||
generate_source_kernel_filename (hashconfig->attack_exec, user_options_extra->attack_kern, hashconfig->kern_type, true, folder_config->shared_dir, source_file);
|
||||
generate_source_kernel_filename (user_options->slow_candidates, hashconfig->attack_exec, user_options_extra->attack_kern, hashconfig->kern_type, true, folder_config->shared_dir, source_file);
|
||||
|
||||
hashconfig->has_optimized_kernel = hc_path_read (source_file);
|
||||
|
||||
@ -27730,14 +27730,30 @@ u32 hashconfig_get_kernel_loops (hashcat_ctx_t *hashcat_ctx)
|
||||
|
||||
u32 kernel_loops_fixed = 0;
|
||||
|
||||
if (hashconfig->hash_mode == 1500 && user_options->attack_mode == ATTACK_MODE_BF)
|
||||
if (user_options->slow_candidates == true)
|
||||
{
|
||||
kernel_loops_fixed = 1024;
|
||||
}
|
||||
|
||||
if (hashconfig->hash_mode == 3000 && user_options->attack_mode == ATTACK_MODE_BF)
|
||||
else
|
||||
{
|
||||
kernel_loops_fixed = 1024;
|
||||
if (hashconfig->hash_mode == 1500 && user_options->attack_mode == ATTACK_MODE_BF)
|
||||
{
|
||||
kernel_loops_fixed = 1024;
|
||||
}
|
||||
|
||||
if (hashconfig->hash_mode == 3000 && user_options->attack_mode == ATTACK_MODE_BF)
|
||||
{
|
||||
kernel_loops_fixed = 1024;
|
||||
}
|
||||
|
||||
if (hashconfig->hash_mode == 14000 && user_options->attack_mode == ATTACK_MODE_BF)
|
||||
{
|
||||
kernel_loops_fixed = 1024;
|
||||
}
|
||||
|
||||
if (hashconfig->hash_mode == 14100 && user_options->attack_mode == ATTACK_MODE_BF)
|
||||
{
|
||||
kernel_loops_fixed = 1024;
|
||||
}
|
||||
}
|
||||
|
||||
if (hashconfig->hash_mode == 8900)
|
||||
@ -27755,16 +27771,6 @@ u32 hashconfig_get_kernel_loops (hashcat_ctx_t *hashcat_ctx)
|
||||
kernel_loops_fixed = ROUNDS_RAR3 / 16;
|
||||
}
|
||||
|
||||
if (hashconfig->hash_mode == 14000 && user_options->attack_mode == ATTACK_MODE_BF)
|
||||
{
|
||||
kernel_loops_fixed = 1024;
|
||||
}
|
||||
|
||||
if (hashconfig->hash_mode == 14100 && user_options->attack_mode == ATTACK_MODE_BF)
|
||||
{
|
||||
kernel_loops_fixed = 1024;
|
||||
}
|
||||
|
||||
if (hashconfig->hash_mode == 15700)
|
||||
{
|
||||
kernel_loops_fixed = 1;
|
||||
@ -27828,17 +27834,11 @@ int hashconfig_get_pw_max (hashcat_ctx_t *hashcat_ctx, const bool optimized_kern
|
||||
|
||||
if ((user_options->rp_files_cnt > 0) || (user_options->rp_gen > 0))
|
||||
{
|
||||
switch (user_options_extra->attack_kern)
|
||||
if (user_options->slow_candidates == true)
|
||||
{
|
||||
case ATTACK_KERN_STRAIGHT: pw_max = MIN (pw_max, PW_DICTMAX);
|
||||
break;
|
||||
case ATTACK_KERN_COMBI: pw_max = MIN (pw_max, PW_DICTMAX);
|
||||
break;
|
||||
pw_max = MIN (pw_max, PW_DICTMAX);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
if (hashconfig->attack_exec == ATTACK_EXEC_INSIDE_KERNEL)
|
||||
else
|
||||
{
|
||||
switch (user_options_extra->attack_kern)
|
||||
{
|
||||
@ -27848,9 +27848,36 @@ int hashconfig_get_pw_max (hashcat_ctx_t *hashcat_ctx, const bool optimized_kern
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
if (user_options->slow_candidates == true)
|
||||
{
|
||||
if (hashconfig->attack_exec == ATTACK_EXEC_INSIDE_KERNEL)
|
||||
{
|
||||
pw_max = MIN (pw_max, PW_DICTMAX);
|
||||
}
|
||||
else
|
||||
{
|
||||
// If we have a NOOP rule then we can process words from wordlists > PW_DICTMAX for slow hashes
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
// If we have a NOOP rule then we can process words from wordlists > PW_DICTMAX for slow hashes
|
||||
if (hashconfig->attack_exec == ATTACK_EXEC_INSIDE_KERNEL)
|
||||
{
|
||||
switch (user_options_extra->attack_kern)
|
||||
{
|
||||
case ATTACK_KERN_STRAIGHT: pw_max = MIN (pw_max, PW_DICTMAX);
|
||||
break;
|
||||
case ATTACK_KERN_COMBI: pw_max = MIN (pw_max, PW_DICTMAX);
|
||||
break;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
// If we have a NOOP rule then we can process words from wordlists > PW_DICTMAX for slow hashes
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
104
src/mpsp.c
104
src/mpsp.c
@ -37,64 +37,72 @@ static int sp_comp_val (const void *p1, const void *p2)
|
||||
|
||||
static void mp_css_split_cnt (hashcat_ctx_t *hashcat_ctx, const u32 css_cnt_orig, u32 css_cnt_lr[2])
|
||||
{
|
||||
const mask_ctx_t *mask_ctx = hashcat_ctx->mask_ctx;
|
||||
const hashconfig_t *hashconfig = hashcat_ctx->hashconfig;
|
||||
const mask_ctx_t *mask_ctx = hashcat_ctx->mask_ctx;
|
||||
const hashconfig_t *hashconfig = hashcat_ctx->hashconfig;
|
||||
const user_options_t *user_options = hashcat_ctx->user_options;
|
||||
|
||||
u32 css_cnt_l = mask_ctx->css_cnt;
|
||||
u32 css_cnt_r;
|
||||
|
||||
if (hashconfig->attack_exec == ATTACK_EXEC_INSIDE_KERNEL)
|
||||
if (user_options->slow_candidates == true)
|
||||
{
|
||||
if (css_cnt_orig < 6)
|
||||
{
|
||||
css_cnt_r = 1;
|
||||
}
|
||||
else if (css_cnt_orig == 6)
|
||||
{
|
||||
css_cnt_r = 2;
|
||||
}
|
||||
else
|
||||
{
|
||||
if ((hashconfig->opts_type & OPTS_TYPE_PT_UTF16LE) || (hashconfig->opts_type & OPTS_TYPE_PT_UTF16BE))
|
||||
{
|
||||
if (css_cnt_orig == 8 || css_cnt_orig == 10)
|
||||
{
|
||||
css_cnt_r = 2;
|
||||
}
|
||||
else
|
||||
{
|
||||
css_cnt_r = 4;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
if ((mask_ctx->css_buf[0].cs_len * mask_ctx->css_buf[1].cs_len * mask_ctx->css_buf[2].cs_len) > 256)
|
||||
{
|
||||
css_cnt_r = 3;
|
||||
}
|
||||
else
|
||||
{
|
||||
css_cnt_r = 4;
|
||||
}
|
||||
}
|
||||
}
|
||||
css_cnt_r = 0;
|
||||
}
|
||||
else
|
||||
{
|
||||
css_cnt_r = 1;
|
||||
|
||||
/* unfinished code?
|
||||
int sum = css_buf[css_cnt_r - 1].cs_len;
|
||||
|
||||
for (u32 i = 1; i < 4 && i < css_cnt; i++)
|
||||
if (hashconfig->attack_exec == ATTACK_EXEC_INSIDE_KERNEL)
|
||||
{
|
||||
if (sum > 1) break; // we really don't need alot of amplifier them for slow hashes
|
||||
|
||||
css_cnt_r++;
|
||||
|
||||
sum *= css_buf[css_cnt_r - 1].cs_len;
|
||||
if (css_cnt_orig < 6)
|
||||
{
|
||||
css_cnt_r = 1;
|
||||
}
|
||||
else if (css_cnt_orig == 6)
|
||||
{
|
||||
css_cnt_r = 2;
|
||||
}
|
||||
else
|
||||
{
|
||||
if ((hashconfig->opts_type & OPTS_TYPE_PT_UTF16LE) || (hashconfig->opts_type & OPTS_TYPE_PT_UTF16BE))
|
||||
{
|
||||
if (css_cnt_orig == 8 || css_cnt_orig == 10)
|
||||
{
|
||||
css_cnt_r = 2;
|
||||
}
|
||||
else
|
||||
{
|
||||
css_cnt_r = 4;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
if ((mask_ctx->css_buf[0].cs_len * mask_ctx->css_buf[1].cs_len * mask_ctx->css_buf[2].cs_len) > 256)
|
||||
{
|
||||
css_cnt_r = 3;
|
||||
}
|
||||
else
|
||||
{
|
||||
css_cnt_r = 4;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
css_cnt_r = 1;
|
||||
|
||||
/* unfinished code?
|
||||
int sum = css_buf[css_cnt_r - 1].cs_len;
|
||||
|
||||
for (u32 i = 1; i < 4 && i < css_cnt; i++)
|
||||
{
|
||||
if (sum > 1) break; // we really don't need alot of amplifier them for slow hashes
|
||||
|
||||
css_cnt_r++;
|
||||
|
||||
sum *= css_buf[css_cnt_r - 1].cs_len;
|
||||
}
|
||||
*/
|
||||
}
|
||||
*/
|
||||
}
|
||||
|
||||
css_cnt_l -= css_cnt_r;
|
||||
|
1942
src/opencl.c
1942
src/opencl.c
File diff suppressed because it is too large
Load Diff
362
src/outfile.c
362
src/outfile.c
@ -35,7 +35,7 @@ int build_plain (hashcat_ctx_t *hashcat_ctx, hc_device_param_t *device_param, pl
|
||||
|
||||
u8 *plain_ptr = (u8 *) plain_buf;
|
||||
|
||||
if (user_options->attack_mode == ATTACK_MODE_STRAIGHT)
|
||||
if (user_options->slow_candidates == true)
|
||||
{
|
||||
pw_t pw;
|
||||
|
||||
@ -43,101 +43,89 @@ int build_plain (hashcat_ctx_t *hashcat_ctx, hc_device_param_t *device_param, pl
|
||||
|
||||
if (rc == -1) return -1;
|
||||
|
||||
const u64 off = device_param->innerloop_pos + il_pos;
|
||||
memcpy (plain_buf, pw.i, pw.pw_len);
|
||||
|
||||
if (hashconfig->opti_type & OPTI_TYPE_OPTIMIZED_KERNEL)
|
||||
plain_len = pw.pw_len;
|
||||
}
|
||||
else
|
||||
{
|
||||
if (user_options->attack_mode == ATTACK_MODE_STRAIGHT)
|
||||
{
|
||||
for (int i = 0; i < 8; i++)
|
||||
pw_t pw;
|
||||
|
||||
const int rc = gidd_to_pw_t (hashcat_ctx, device_param, gidvid, &pw);
|
||||
|
||||
if (rc == -1) return -1;
|
||||
|
||||
const u64 off = device_param->innerloop_pos + il_pos;
|
||||
|
||||
if (hashconfig->opti_type & OPTI_TYPE_OPTIMIZED_KERNEL)
|
||||
{
|
||||
plain_buf[i] = pw.i[i];
|
||||
}
|
||||
for (int i = 0; i < 8; i++)
|
||||
{
|
||||
plain_buf[i] = pw.i[i];
|
||||
}
|
||||
|
||||
plain_len = apply_rules_optimized (straight_ctx->kernel_rules_buf[off].cmds, &plain_buf[0], &plain_buf[4], pw.pw_len);
|
||||
plain_len = apply_rules_optimized (straight_ctx->kernel_rules_buf[off].cmds, &plain_buf[0], &plain_buf[4], pw.pw_len);
|
||||
}
|
||||
else
|
||||
{
|
||||
for (int i = 0; i < 64; i++)
|
||||
{
|
||||
plain_buf[i] = pw.i[i];
|
||||
}
|
||||
|
||||
plain_len = apply_rules (straight_ctx->kernel_rules_buf[off].cmds, plain_buf, pw.pw_len);
|
||||
}
|
||||
}
|
||||
else
|
||||
else if (user_options->attack_mode == ATTACK_MODE_COMBI)
|
||||
{
|
||||
pw_t pw;
|
||||
|
||||
const int rc = gidd_to_pw_t (hashcat_ctx, device_param, gidvid, &pw);
|
||||
|
||||
if (rc == -1) return -1;
|
||||
|
||||
for (int i = 0; i < 64; i++)
|
||||
{
|
||||
plain_buf[i] = pw.i[i];
|
||||
}
|
||||
|
||||
plain_len = apply_rules (straight_ctx->kernel_rules_buf[off].cmds, plain_buf, pw.pw_len);
|
||||
plain_len = (int) pw.pw_len;
|
||||
|
||||
char *comb_buf = (char *) device_param->combs_buf[il_pos].i;
|
||||
u32 comb_len = device_param->combs_buf[il_pos].pw_len;
|
||||
|
||||
if (combinator_ctx->combs_mode == COMBINATOR_MODE_BASE_LEFT)
|
||||
{
|
||||
memcpy (plain_ptr + plain_len, comb_buf, (size_t) comb_len);
|
||||
}
|
||||
else
|
||||
{
|
||||
memmove (plain_ptr + comb_len, plain_ptr, (size_t) plain_len);
|
||||
|
||||
memcpy (plain_ptr, comb_buf, comb_len);
|
||||
}
|
||||
|
||||
plain_len += comb_len;
|
||||
}
|
||||
}
|
||||
else if (user_options->attack_mode == ATTACK_MODE_COMBI)
|
||||
{
|
||||
pw_t pw;
|
||||
|
||||
const int rc = gidd_to_pw_t (hashcat_ctx, device_param, gidvid, &pw);
|
||||
|
||||
if (rc == -1) return -1;
|
||||
|
||||
for (int i = 0; i < 64; i++)
|
||||
else if (user_options->attack_mode == ATTACK_MODE_BF)
|
||||
{
|
||||
plain_buf[i] = pw.i[i];
|
||||
u64 l_off = device_param->kernel_params_mp_l_buf64[3] + gidvid;
|
||||
u64 r_off = device_param->kernel_params_mp_r_buf64[3] + il_pos;
|
||||
|
||||
u32 l_start = device_param->kernel_params_mp_l_buf32[5];
|
||||
u32 r_start = device_param->kernel_params_mp_r_buf32[5];
|
||||
|
||||
u32 l_stop = device_param->kernel_params_mp_l_buf32[4];
|
||||
u32 r_stop = device_param->kernel_params_mp_r_buf32[4];
|
||||
|
||||
sp_exec (l_off, (char *) plain_ptr + l_start, mask_ctx->root_css_buf, mask_ctx->markov_css_buf, l_start, l_start + l_stop);
|
||||
sp_exec (r_off, (char *) plain_ptr + r_start, mask_ctx->root_css_buf, mask_ctx->markov_css_buf, r_start, r_start + r_stop);
|
||||
|
||||
plain_len = (int) mask_ctx->css_cnt;
|
||||
}
|
||||
|
||||
plain_len = (int) pw.pw_len;
|
||||
|
||||
char *comb_buf = (char *) device_param->combs_buf[il_pos].i;
|
||||
u32 comb_len = device_param->combs_buf[il_pos].pw_len;
|
||||
|
||||
if (combinator_ctx->combs_mode == COMBINATOR_MODE_BASE_LEFT)
|
||||
{
|
||||
memcpy (plain_ptr + plain_len, comb_buf, (size_t) comb_len);
|
||||
}
|
||||
else
|
||||
{
|
||||
memmove (plain_ptr + comb_len, plain_ptr, (size_t) plain_len);
|
||||
|
||||
memcpy (plain_ptr, comb_buf, comb_len);
|
||||
}
|
||||
|
||||
plain_len += comb_len;
|
||||
}
|
||||
else if (user_options->attack_mode == ATTACK_MODE_BF)
|
||||
{
|
||||
u64 l_off = device_param->kernel_params_mp_l_buf64[3] + gidvid;
|
||||
u64 r_off = device_param->kernel_params_mp_r_buf64[3] + il_pos;
|
||||
|
||||
u32 l_start = device_param->kernel_params_mp_l_buf32[5];
|
||||
u32 r_start = device_param->kernel_params_mp_r_buf32[5];
|
||||
|
||||
u32 l_stop = device_param->kernel_params_mp_l_buf32[4];
|
||||
u32 r_stop = device_param->kernel_params_mp_r_buf32[4];
|
||||
|
||||
sp_exec (l_off, (char *) plain_ptr + l_start, mask_ctx->root_css_buf, mask_ctx->markov_css_buf, l_start, l_start + l_stop);
|
||||
sp_exec (r_off, (char *) plain_ptr + r_start, mask_ctx->root_css_buf, mask_ctx->markov_css_buf, r_start, r_start + r_stop);
|
||||
|
||||
plain_len = (int) mask_ctx->css_cnt;
|
||||
}
|
||||
else if (user_options->attack_mode == ATTACK_MODE_HYBRID1)
|
||||
{
|
||||
pw_t pw;
|
||||
|
||||
const int rc = gidd_to_pw_t (hashcat_ctx, device_param, gidvid, &pw);
|
||||
|
||||
if (rc == -1) return -1;
|
||||
|
||||
for (int i = 0; i < 64; i++)
|
||||
{
|
||||
plain_buf[i] = pw.i[i];
|
||||
}
|
||||
|
||||
plain_len = (int) pw.pw_len;
|
||||
|
||||
u64 off = device_param->kernel_params_mp_buf64[3] + il_pos;
|
||||
|
||||
u32 start = 0;
|
||||
u32 stop = device_param->kernel_params_mp_buf32[4];
|
||||
|
||||
sp_exec (off, (char *) plain_ptr + plain_len, mask_ctx->root_css_buf, mask_ctx->markov_css_buf, start, start + stop);
|
||||
|
||||
plain_len += start + stop;
|
||||
}
|
||||
else if (user_options->attack_mode == ATTACK_MODE_HYBRID2)
|
||||
{
|
||||
if (hashconfig->opti_type & OPTI_TYPE_OPTIMIZED_KERNEL)
|
||||
else if (user_options->attack_mode == ATTACK_MODE_HYBRID1)
|
||||
{
|
||||
pw_t pw;
|
||||
|
||||
@ -157,67 +145,94 @@ int build_plain (hashcat_ctx_t *hashcat_ctx, hc_device_param_t *device_param, pl
|
||||
u32 start = 0;
|
||||
u32 stop = device_param->kernel_params_mp_buf32[4];
|
||||
|
||||
memmove (plain_ptr + stop, plain_ptr, plain_len);
|
||||
|
||||
sp_exec (off, (char *) plain_ptr, mask_ctx->root_css_buf, mask_ctx->markov_css_buf, start, start + stop);
|
||||
sp_exec (off, (char *) plain_ptr + plain_len, mask_ctx->root_css_buf, mask_ctx->markov_css_buf, start, start + stop);
|
||||
|
||||
plain_len += start + stop;
|
||||
}
|
||||
else
|
||||
else if (user_options->attack_mode == ATTACK_MODE_HYBRID2)
|
||||
{
|
||||
pw_t pw;
|
||||
if (hashconfig->opti_type & OPTI_TYPE_OPTIMIZED_KERNEL)
|
||||
{
|
||||
pw_t pw;
|
||||
|
||||
const int rc = gidd_to_pw_t (hashcat_ctx, device_param, gidvid, &pw);
|
||||
const int rc = gidd_to_pw_t (hashcat_ctx, device_param, gidvid, &pw);
|
||||
|
||||
if (rc == -1) return -1;
|
||||
if (rc == -1) return -1;
|
||||
|
||||
u64 off = device_param->kernel_params_mp_buf64[3] + gidvid;
|
||||
for (int i = 0; i < 64; i++)
|
||||
{
|
||||
plain_buf[i] = pw.i[i];
|
||||
}
|
||||
|
||||
u32 start = 0;
|
||||
u32 stop = device_param->kernel_params_mp_buf32[4];
|
||||
plain_len = (int) pw.pw_len;
|
||||
|
||||
sp_exec (off, (char *) plain_ptr, mask_ctx->root_css_buf, mask_ctx->markov_css_buf, start, start + stop);
|
||||
u64 off = device_param->kernel_params_mp_buf64[3] + il_pos;
|
||||
|
||||
plain_len = stop;
|
||||
u32 start = 0;
|
||||
u32 stop = device_param->kernel_params_mp_buf32[4];
|
||||
|
||||
char *comb_buf = (char *) device_param->combs_buf[il_pos].i;
|
||||
u32 comb_len = device_param->combs_buf[il_pos].pw_len;
|
||||
memmove (plain_ptr + stop, plain_ptr, plain_len);
|
||||
|
||||
memcpy (plain_ptr + plain_len, comb_buf, comb_len);
|
||||
sp_exec (off, (char *) plain_ptr, mask_ctx->root_css_buf, mask_ctx->markov_css_buf, start, start + stop);
|
||||
|
||||
plain_len += comb_len;
|
||||
plain_len += start + stop;
|
||||
}
|
||||
else
|
||||
{
|
||||
pw_t pw;
|
||||
|
||||
const int rc = gidd_to_pw_t (hashcat_ctx, device_param, gidvid, &pw);
|
||||
|
||||
if (rc == -1) return -1;
|
||||
|
||||
u64 off = device_param->kernel_params_mp_buf64[3] + gidvid;
|
||||
|
||||
u32 start = 0;
|
||||
u32 stop = device_param->kernel_params_mp_buf32[4];
|
||||
|
||||
sp_exec (off, (char *) plain_ptr, mask_ctx->root_css_buf, mask_ctx->markov_css_buf, start, start + stop);
|
||||
|
||||
plain_len = stop;
|
||||
|
||||
char *comb_buf = (char *) device_param->combs_buf[il_pos].i;
|
||||
u32 comb_len = device_param->combs_buf[il_pos].pw_len;
|
||||
|
||||
memcpy (plain_ptr + plain_len, comb_buf, comb_len);
|
||||
|
||||
plain_len += comb_len;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (user_options->attack_mode == ATTACK_MODE_BF)
|
||||
{
|
||||
if (hashconfig->opti_type & OPTI_TYPE_BRUTE_FORCE) // lots of optimizations can happen here
|
||||
if (user_options->attack_mode == ATTACK_MODE_BF)
|
||||
{
|
||||
if (hashconfig->opti_type & OPTI_TYPE_SINGLE_HASH)
|
||||
if (hashconfig->opti_type & OPTI_TYPE_BRUTE_FORCE) // lots of optimizations can happen here
|
||||
{
|
||||
if (hashconfig->opti_type & OPTI_TYPE_APPENDED_SALT)
|
||||
if (hashconfig->opti_type & OPTI_TYPE_SINGLE_HASH)
|
||||
{
|
||||
plain_len = plain_len - hashes->salts_buf[0].salt_len;
|
||||
}
|
||||
}
|
||||
|
||||
if (hashconfig->opts_type & OPTS_TYPE_PT_UTF16LE)
|
||||
{
|
||||
for (int i = 0, j = 0; i < plain_len; i += 2, j += 1)
|
||||
{
|
||||
plain_ptr[j] = plain_ptr[i];
|
||||
if (hashconfig->opti_type & OPTI_TYPE_APPENDED_SALT)
|
||||
{
|
||||
plain_len = plain_len - hashes->salts_buf[0].salt_len;
|
||||
}
|
||||
}
|
||||
|
||||
plain_len = plain_len / 2;
|
||||
}
|
||||
else if (hashconfig->opts_type & OPTS_TYPE_PT_UTF16BE)
|
||||
{
|
||||
for (int i = 1, j = 0; i < plain_len; i += 2, j += 1)
|
||||
if (hashconfig->opts_type & OPTS_TYPE_PT_UTF16LE)
|
||||
{
|
||||
plain_ptr[j] = plain_ptr[i];
|
||||
}
|
||||
for (int i = 0, j = 0; i < plain_len; i += 2, j += 1)
|
||||
{
|
||||
plain_ptr[j] = plain_ptr[i];
|
||||
}
|
||||
|
||||
plain_len = plain_len / 2;
|
||||
plain_len = plain_len / 2;
|
||||
}
|
||||
else if (hashconfig->opts_type & OPTS_TYPE_PT_UTF16BE)
|
||||
{
|
||||
for (int i = 1, j = 0; i < plain_len; i += 2, j += 1)
|
||||
{
|
||||
plain_ptr[j] = plain_ptr[i];
|
||||
}
|
||||
|
||||
plain_len = plain_len / 2;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -238,6 +253,7 @@ int build_crackpos (hashcat_ctx_t *hashcat_ctx, hc_device_param_t *device_param,
|
||||
const combinator_ctx_t *combinator_ctx = hashcat_ctx->combinator_ctx;
|
||||
const mask_ctx_t *mask_ctx = hashcat_ctx->mask_ctx;
|
||||
const straight_ctx_t *straight_ctx = hashcat_ctx->straight_ctx;
|
||||
const user_options_t *user_options = hashcat_ctx->user_options;
|
||||
const user_options_extra_t *user_options_extra = hashcat_ctx->user_options_extra;
|
||||
|
||||
const u64 gidvid = plain->gidvid;
|
||||
@ -245,23 +261,30 @@ int build_crackpos (hashcat_ctx_t *hashcat_ctx, hc_device_param_t *device_param,
|
||||
|
||||
u64 crackpos = device_param->words_off;
|
||||
|
||||
if (user_options_extra->attack_kern == ATTACK_KERN_STRAIGHT)
|
||||
if (user_options->slow_candidates == true)
|
||||
{
|
||||
crackpos += gidvid;
|
||||
crackpos *= straight_ctx->kernel_rules_cnt;
|
||||
crackpos += device_param->innerloop_pos + il_pos;
|
||||
crackpos = gidvid;
|
||||
}
|
||||
else if (user_options_extra->attack_kern == ATTACK_KERN_COMBI)
|
||||
else
|
||||
{
|
||||
crackpos += gidvid;
|
||||
crackpos *= combinator_ctx->combs_cnt;
|
||||
crackpos += device_param->innerloop_pos + il_pos;
|
||||
}
|
||||
else if (user_options_extra->attack_kern == ATTACK_MODE_BF)
|
||||
{
|
||||
crackpos += gidvid;
|
||||
crackpos *= mask_ctx->bfs_cnt;
|
||||
crackpos += device_param->innerloop_pos + il_pos;
|
||||
if (user_options_extra->attack_kern == ATTACK_KERN_STRAIGHT)
|
||||
{
|
||||
crackpos += gidvid;
|
||||
crackpos *= straight_ctx->kernel_rules_cnt;
|
||||
crackpos += device_param->innerloop_pos + il_pos;
|
||||
}
|
||||
else if (user_options_extra->attack_kern == ATTACK_KERN_COMBI)
|
||||
{
|
||||
crackpos += gidvid;
|
||||
crackpos *= combinator_ctx->combs_cnt;
|
||||
crackpos += device_param->innerloop_pos + il_pos;
|
||||
}
|
||||
else if (user_options_extra->attack_kern == ATTACK_MODE_BF)
|
||||
{
|
||||
crackpos += gidvid;
|
||||
crackpos *= mask_ctx->bfs_cnt;
|
||||
crackpos += device_param->innerloop_pos + il_pos;
|
||||
}
|
||||
}
|
||||
|
||||
*out_pos = crackpos;
|
||||
@ -284,34 +307,61 @@ int build_debugdata (hashcat_ctx_t *hashcat_ctx, hc_device_param_t *device_param
|
||||
|
||||
if (debug_mode == 0) return 0;
|
||||
|
||||
pw_t pw;
|
||||
|
||||
const int rc = gidd_to_pw_t (hashcat_ctx, device_param, gidvid, &pw);
|
||||
|
||||
if (rc == -1) return -1;
|
||||
|
||||
int plain_len = (int) pw.pw_len;
|
||||
|
||||
const u64 off = device_param->innerloop_pos + il_pos;
|
||||
|
||||
// save rule
|
||||
if ((debug_mode == 1) || (debug_mode == 3) || (debug_mode == 4))
|
||||
if (user_options->slow_candidates == true)
|
||||
{
|
||||
const int len = kernel_rule_to_cpu_rule ((char *) debug_rule_buf, &straight_ctx->kernel_rules_buf[off]);
|
||||
pw_pre_t *pw_base = device_param->pws_base_buf + gidvid;
|
||||
|
||||
debug_rule_buf[len] = 0;
|
||||
// save rule
|
||||
if ((debug_mode == 1) || (debug_mode == 3) || (debug_mode == 4))
|
||||
{
|
||||
const int len = kernel_rule_to_cpu_rule ((char *) debug_rule_buf, &straight_ctx->kernel_rules_buf[pw_base->rule_idx]);
|
||||
|
||||
*debug_rule_len = len;
|
||||
debug_rule_buf[len] = 0;
|
||||
|
||||
*debug_rule_len = len;
|
||||
}
|
||||
|
||||
// save plain
|
||||
if ((debug_mode == 2) || (debug_mode == 3) || (debug_mode == 4))
|
||||
{
|
||||
memcpy (debug_plain_ptr, pw_base->base_buf, pw_base->base_len);
|
||||
|
||||
debug_plain_ptr[pw_base->base_len] = 0;
|
||||
|
||||
*debug_plain_len = pw_base->base_len;
|
||||
}
|
||||
}
|
||||
|
||||
// save plain
|
||||
if ((debug_mode == 2) || (debug_mode == 3) || (debug_mode == 4))
|
||||
else
|
||||
{
|
||||
memcpy (debug_plain_ptr, (char *) pw.i, (size_t) plain_len);
|
||||
pw_t pw;
|
||||
|
||||
debug_plain_ptr[plain_len] = 0;
|
||||
const int rc = gidd_to_pw_t (hashcat_ctx, device_param, gidvid, &pw);
|
||||
|
||||
*debug_plain_len = plain_len;
|
||||
if (rc == -1) return -1;
|
||||
|
||||
int plain_len = (int) pw.pw_len;
|
||||
|
||||
const u64 off = device_param->innerloop_pos + il_pos;
|
||||
|
||||
// save rule
|
||||
if ((debug_mode == 1) || (debug_mode == 3) || (debug_mode == 4))
|
||||
{
|
||||
const int len = kernel_rule_to_cpu_rule ((char *) debug_rule_buf, &straight_ctx->kernel_rules_buf[off]);
|
||||
|
||||
debug_rule_buf[len] = 0;
|
||||
|
||||
*debug_rule_len = len;
|
||||
}
|
||||
|
||||
// save plain
|
||||
if ((debug_mode == 2) || (debug_mode == 3) || (debug_mode == 4))
|
||||
{
|
||||
memcpy (debug_plain_ptr, (char *) pw.i, (size_t) plain_len);
|
||||
|
||||
debug_plain_ptr[plain_len] = 0;
|
||||
|
||||
*debug_plain_len = plain_len;
|
||||
}
|
||||
}
|
||||
|
||||
return 0;
|
||||
|
508
src/selftest.c
508
src/selftest.c
@ -18,6 +18,7 @@ static int selftest (hashcat_ctx_t *hashcat_ctx, hc_device_param_t *device_param
|
||||
hashconfig_t *hashconfig = hashcat_ctx->hashconfig;
|
||||
hashes_t *hashes = hashcat_ctx->hashes;
|
||||
status_ctx_t *status_ctx = hashcat_ctx->status_ctx;
|
||||
user_options_t *user_options = hashcat_ctx->user_options;
|
||||
user_options_extra_t *user_options_extra = hashcat_ctx->user_options_extra;
|
||||
|
||||
cl_int CL_err;
|
||||
@ -39,239 +40,13 @@ static int selftest (hashcat_ctx_t *hashcat_ctx, hc_device_param_t *device_param
|
||||
|
||||
u32 highest_pw_len = 0;
|
||||
|
||||
if (hashconfig->attack_exec == ATTACK_EXEC_INSIDE_KERNEL)
|
||||
if (user_options->slow_candidates == true)
|
||||
{
|
||||
if (user_options_extra->attack_kern == ATTACK_KERN_STRAIGHT)
|
||||
if (hashconfig->attack_exec == ATTACK_EXEC_INSIDE_KERNEL)
|
||||
{
|
||||
device_param->kernel_params_buf32[30] = 1;
|
||||
|
||||
pw_t pw; memset (&pw, 0, sizeof (pw));
|
||||
|
||||
char *pw_ptr = (char *) &pw.i;
|
||||
|
||||
const size_t pw_len = strlen (hashconfig->st_pass);
|
||||
|
||||
memcpy (pw_ptr, hashconfig->st_pass, pw_len);
|
||||
|
||||
pw.pw_len = (u32) pw_len;
|
||||
|
||||
if (hashconfig->opts_type & OPTS_TYPE_PT_UPPER)
|
||||
{
|
||||
uppercase ((u8 *) pw_ptr, pw.pw_len);
|
||||
}
|
||||
|
||||
CL_err = hc_clEnqueueWriteBuffer (hashcat_ctx, device_param->command_queue, device_param->d_pws_buf, CL_TRUE, 0, 1 * sizeof (pw_t), &pw, 0, NULL, NULL);
|
||||
|
||||
if (CL_err != CL_SUCCESS) return -1;
|
||||
}
|
||||
else if (user_options_extra->attack_kern == ATTACK_KERN_COMBI)
|
||||
{
|
||||
device_param->kernel_params_buf32[30] = 1;
|
||||
device_param->kernel_params_buf32[33] = COMBINATOR_MODE_BASE_LEFT;
|
||||
|
||||
pw_t pw; memset (&pw, 0, sizeof (pw));
|
||||
|
||||
char *pw_ptr = (char *) &pw.i;
|
||||
|
||||
const size_t pw_len = strlen (hashconfig->st_pass);
|
||||
|
||||
memcpy (pw_ptr, hashconfig->st_pass, pw_len - 1);
|
||||
|
||||
pw.pw_len = (u32) pw_len - 1;
|
||||
|
||||
if (hashconfig->opts_type & OPTS_TYPE_PT_UPPER)
|
||||
{
|
||||
uppercase ((u8 *) pw_ptr, pw.pw_len);
|
||||
}
|
||||
|
||||
pw_t comb; memset (&comb, 0, sizeof (comb));
|
||||
|
||||
char *comb_ptr = (char *) &comb.i;
|
||||
|
||||
memcpy (comb_ptr, hashconfig->st_pass + pw_len - 1, 1);
|
||||
|
||||
comb.pw_len = 1;
|
||||
|
||||
if (hashconfig->opts_type & OPTS_TYPE_PT_UPPER)
|
||||
{
|
||||
uppercase ((u8 *) comb_ptr, comb.pw_len);
|
||||
}
|
||||
|
||||
if (hashconfig->opts_type & OPTS_TYPE_PT_ADD01)
|
||||
{
|
||||
comb_ptr[comb.pw_len] = 0x01;
|
||||
}
|
||||
|
||||
if (hashconfig->opts_type & OPTS_TYPE_PT_ADD80)
|
||||
{
|
||||
comb_ptr[comb.pw_len] = 0x80;
|
||||
}
|
||||
|
||||
CL_err = hc_clEnqueueWriteBuffer (hashcat_ctx, device_param->command_queue, device_param->d_combs_c, CL_TRUE, 0, 1 * sizeof (pw_t), &comb, 0, NULL, NULL);
|
||||
|
||||
if (CL_err != CL_SUCCESS) return -1;
|
||||
|
||||
CL_err = hc_clEnqueueWriteBuffer (hashcat_ctx, device_param->command_queue, device_param->d_pws_buf, CL_TRUE, 0, 1 * sizeof (pw_t), &pw, 0, NULL, NULL);
|
||||
|
||||
if (CL_err != CL_SUCCESS) return -1;
|
||||
}
|
||||
else if (user_options_extra->attack_kern == ATTACK_KERN_BF)
|
||||
{
|
||||
device_param->kernel_params_buf32[30] = 1;
|
||||
|
||||
if (hashconfig->opts_type & OPTS_TYPE_PT_BITSLICE)
|
||||
{
|
||||
pw_t pw; memset (&pw, 0, sizeof (pw));
|
||||
|
||||
char *pw_ptr = (char *) &pw.i;
|
||||
|
||||
const size_t pw_len = strlen (hashconfig->st_pass);
|
||||
|
||||
memcpy (pw_ptr, hashconfig->st_pass, pw_len);
|
||||
|
||||
if (hashconfig->opts_type & OPTS_TYPE_PT_UPPER)
|
||||
{
|
||||
uppercase ((u8 *) pw_ptr, pw_len);
|
||||
}
|
||||
|
||||
pw.pw_len = (u32) pw_len;
|
||||
|
||||
CL_err = hc_clEnqueueWriteBuffer (hashcat_ctx, device_param->command_queue, device_param->d_pws_buf, CL_TRUE, 0, 1 * sizeof (pw_t), &pw, 0, NULL, NULL);
|
||||
|
||||
if (CL_err != CL_SUCCESS) return -1;
|
||||
}
|
||||
else
|
||||
{
|
||||
bf_t bf; memset (&bf, 0, sizeof (bf));
|
||||
|
||||
char *bf_ptr = (char *) &bf.i;
|
||||
|
||||
memcpy (bf_ptr, hashconfig->st_pass, 1);
|
||||
|
||||
if (hashconfig->opts_type & OPTS_TYPE_PT_UTF16LE)
|
||||
{
|
||||
memset (bf_ptr, 0, 4);
|
||||
|
||||
for (int i = 0, j = 0; i < 1; i += 1, j += 2)
|
||||
{
|
||||
bf_ptr[j + 0] = hashconfig->st_pass[i];
|
||||
bf_ptr[j + 1] = 0;
|
||||
}
|
||||
}
|
||||
else if (hashconfig->opts_type & OPTS_TYPE_PT_UTF16BE)
|
||||
{
|
||||
memset (bf_ptr, 0, 4);
|
||||
|
||||
for (int i = 0, j = 0; i < 1; i += 1, j += 2)
|
||||
{
|
||||
bf_ptr[j + 0] = 0;
|
||||
bf_ptr[j + 1] = hashconfig->st_pass[i];
|
||||
}
|
||||
}
|
||||
|
||||
if (hashconfig->opts_type & OPTS_TYPE_PT_UPPER)
|
||||
{
|
||||
uppercase ((u8 *) bf_ptr, 4);
|
||||
}
|
||||
|
||||
if (hashconfig->opts_type & OPTS_TYPE_PT_GENERATE_BE)
|
||||
{
|
||||
bf.i = byte_swap_32 (bf.i);
|
||||
}
|
||||
|
||||
CL_err = hc_clEnqueueWriteBuffer (hashcat_ctx, device_param->command_queue, device_param->d_bfs_c, CL_TRUE, 0, 1 * sizeof (bf_t), &bf, 0, NULL, NULL);
|
||||
|
||||
if (CL_err != CL_SUCCESS) return -1;
|
||||
|
||||
pw_t pw; memset (&pw, 0, sizeof (pw));
|
||||
|
||||
char *pw_ptr = (char *) &pw.i;
|
||||
|
||||
const size_t pw_len = strlen (hashconfig->st_pass);
|
||||
|
||||
memcpy (pw_ptr + 1, hashconfig->st_pass + 1, pw_len - 1);
|
||||
|
||||
size_t new_pass_len = pw_len;
|
||||
|
||||
if (hashconfig->opts_type & OPTS_TYPE_PT_UTF16LE)
|
||||
{
|
||||
memset (pw_ptr, 0, pw_len);
|
||||
|
||||
for (size_t i = 1, j = 2; i < new_pass_len; i += 1, j += 2)
|
||||
{
|
||||
pw_ptr[j + 0] = hashconfig->st_pass[i];
|
||||
pw_ptr[j + 1] = 0;
|
||||
}
|
||||
|
||||
new_pass_len *= 2;
|
||||
}
|
||||
else if (hashconfig->opts_type & OPTS_TYPE_PT_UTF16BE)
|
||||
{
|
||||
memset (pw_ptr, 0, pw_len);
|
||||
|
||||
for (size_t i = 1, j = 2; i < new_pass_len; i += 1, j += 2)
|
||||
{
|
||||
pw_ptr[j + 0] = 0;
|
||||
pw_ptr[j + 1] = hashconfig->st_pass[i];
|
||||
}
|
||||
|
||||
new_pass_len *= 2;
|
||||
}
|
||||
|
||||
if (hashconfig->opts_type & OPTS_TYPE_PT_UPPER)
|
||||
{
|
||||
uppercase ((u8 *) pw_ptr, new_pass_len);
|
||||
}
|
||||
|
||||
if (hashconfig->opti_type & OPTI_TYPE_SINGLE_HASH)
|
||||
{
|
||||
if (hashconfig->opti_type & OPTI_TYPE_APPENDED_SALT)
|
||||
{
|
||||
memcpy (pw_ptr + new_pass_len, (char *) hashes->st_salts_buf[0].salt_buf, 64 - new_pass_len);
|
||||
|
||||
new_pass_len += hashes->st_salts_buf[0].salt_len;
|
||||
}
|
||||
}
|
||||
|
||||
pw.pw_len = (u32) new_pass_len;
|
||||
|
||||
if (hashconfig->opts_type & OPTS_TYPE_PT_ADD01)
|
||||
{
|
||||
pw_ptr[new_pass_len] = 0x01;
|
||||
}
|
||||
|
||||
if (hashconfig->opts_type & OPTS_TYPE_PT_ADD80)
|
||||
{
|
||||
pw_ptr[new_pass_len] = 0x80;
|
||||
}
|
||||
|
||||
if (hashconfig->opts_type & OPTS_TYPE_PT_ADDBITS14)
|
||||
{
|
||||
pw.i[14] = (u32) new_pass_len * 8;
|
||||
pw.i[15] = 0;
|
||||
}
|
||||
|
||||
if (hashconfig->opts_type & OPTS_TYPE_PT_ADDBITS15)
|
||||
{
|
||||
pw.i[14] = 0;
|
||||
pw.i[15] = (u32) new_pass_len * 8;
|
||||
}
|
||||
|
||||
if (hashconfig->opts_type & OPTS_TYPE_PT_GENERATE_BE)
|
||||
{
|
||||
for (int i = 0; i < 14; i++) pw.i[i] = byte_swap_32 (pw.i[i]);
|
||||
}
|
||||
|
||||
CL_err = hc_clEnqueueWriteBuffer (hashcat_ctx, device_param->command_queue, device_param->d_pws_buf, CL_TRUE, 0, 1 * sizeof (pw_t), &pw, 0, NULL, NULL);
|
||||
|
||||
if (CL_err != CL_SUCCESS) return -1;
|
||||
|
||||
highest_pw_len = pw.pw_len;
|
||||
}
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
pw_t pw; memset (&pw, 0, sizeof (pw));
|
||||
|
||||
char *pw_ptr = (char *) &pw.i;
|
||||
@ -286,6 +61,256 @@ static int selftest (hashcat_ctx_t *hashcat_ctx, hc_device_param_t *device_param
|
||||
|
||||
if (CL_err != CL_SUCCESS) return -1;
|
||||
}
|
||||
else
|
||||
{
|
||||
if (hashconfig->attack_exec == ATTACK_EXEC_INSIDE_KERNEL)
|
||||
{
|
||||
if (user_options_extra->attack_kern == ATTACK_KERN_STRAIGHT)
|
||||
{
|
||||
device_param->kernel_params_buf32[30] = 1;
|
||||
|
||||
pw_t pw; memset (&pw, 0, sizeof (pw));
|
||||
|
||||
char *pw_ptr = (char *) &pw.i;
|
||||
|
||||
const size_t pw_len = strlen (hashconfig->st_pass);
|
||||
|
||||
memcpy (pw_ptr, hashconfig->st_pass, pw_len);
|
||||
|
||||
pw.pw_len = (u32) pw_len;
|
||||
|
||||
if (hashconfig->opts_type & OPTS_TYPE_PT_UPPER)
|
||||
{
|
||||
uppercase ((u8 *) pw_ptr, pw.pw_len);
|
||||
}
|
||||
|
||||
CL_err = hc_clEnqueueWriteBuffer (hashcat_ctx, device_param->command_queue, device_param->d_pws_buf, CL_TRUE, 0, 1 * sizeof (pw_t), &pw, 0, NULL, NULL);
|
||||
|
||||
if (CL_err != CL_SUCCESS) return -1;
|
||||
}
|
||||
else if (user_options_extra->attack_kern == ATTACK_KERN_COMBI)
|
||||
{
|
||||
device_param->kernel_params_buf32[30] = 1;
|
||||
device_param->kernel_params_buf32[33] = COMBINATOR_MODE_BASE_LEFT;
|
||||
|
||||
pw_t pw; memset (&pw, 0, sizeof (pw));
|
||||
|
||||
char *pw_ptr = (char *) &pw.i;
|
||||
|
||||
const size_t pw_len = strlen (hashconfig->st_pass);
|
||||
|
||||
memcpy (pw_ptr, hashconfig->st_pass, pw_len - 1);
|
||||
|
||||
pw.pw_len = (u32) pw_len - 1;
|
||||
|
||||
if (hashconfig->opts_type & OPTS_TYPE_PT_UPPER)
|
||||
{
|
||||
uppercase ((u8 *) pw_ptr, pw.pw_len);
|
||||
}
|
||||
|
||||
pw_t comb; memset (&comb, 0, sizeof (comb));
|
||||
|
||||
char *comb_ptr = (char *) &comb.i;
|
||||
|
||||
memcpy (comb_ptr, hashconfig->st_pass + pw_len - 1, 1);
|
||||
|
||||
comb.pw_len = 1;
|
||||
|
||||
if (hashconfig->opts_type & OPTS_TYPE_PT_UPPER)
|
||||
{
|
||||
uppercase ((u8 *) comb_ptr, comb.pw_len);
|
||||
}
|
||||
|
||||
if (hashconfig->opts_type & OPTS_TYPE_PT_ADD01)
|
||||
{
|
||||
comb_ptr[comb.pw_len] = 0x01;
|
||||
}
|
||||
|
||||
if (hashconfig->opts_type & OPTS_TYPE_PT_ADD80)
|
||||
{
|
||||
comb_ptr[comb.pw_len] = 0x80;
|
||||
}
|
||||
|
||||
CL_err = hc_clEnqueueWriteBuffer (hashcat_ctx, device_param->command_queue, device_param->d_combs_c, CL_TRUE, 0, 1 * sizeof (pw_t), &comb, 0, NULL, NULL);
|
||||
|
||||
if (CL_err != CL_SUCCESS) return -1;
|
||||
|
||||
CL_err = hc_clEnqueueWriteBuffer (hashcat_ctx, device_param->command_queue, device_param->d_pws_buf, CL_TRUE, 0, 1 * sizeof (pw_t), &pw, 0, NULL, NULL);
|
||||
|
||||
if (CL_err != CL_SUCCESS) return -1;
|
||||
}
|
||||
else if (user_options_extra->attack_kern == ATTACK_KERN_BF)
|
||||
{
|
||||
device_param->kernel_params_buf32[30] = 1;
|
||||
|
||||
if (hashconfig->opts_type & OPTS_TYPE_PT_BITSLICE)
|
||||
{
|
||||
pw_t pw; memset (&pw, 0, sizeof (pw));
|
||||
|
||||
char *pw_ptr = (char *) &pw.i;
|
||||
|
||||
const size_t pw_len = strlen (hashconfig->st_pass);
|
||||
|
||||
memcpy (pw_ptr, hashconfig->st_pass, pw_len);
|
||||
|
||||
if (hashconfig->opts_type & OPTS_TYPE_PT_UPPER)
|
||||
{
|
||||
uppercase ((u8 *) pw_ptr, pw_len);
|
||||
}
|
||||
|
||||
pw.pw_len = (u32) pw_len;
|
||||
|
||||
CL_err = hc_clEnqueueWriteBuffer (hashcat_ctx, device_param->command_queue, device_param->d_pws_buf, CL_TRUE, 0, 1 * sizeof (pw_t), &pw, 0, NULL, NULL);
|
||||
|
||||
if (CL_err != CL_SUCCESS) return -1;
|
||||
}
|
||||
else
|
||||
{
|
||||
bf_t bf; memset (&bf, 0, sizeof (bf));
|
||||
|
||||
char *bf_ptr = (char *) &bf.i;
|
||||
|
||||
memcpy (bf_ptr, hashconfig->st_pass, 1);
|
||||
|
||||
if (hashconfig->opts_type & OPTS_TYPE_PT_UTF16LE)
|
||||
{
|
||||
memset (bf_ptr, 0, 4);
|
||||
|
||||
for (int i = 0, j = 0; i < 1; i += 1, j += 2)
|
||||
{
|
||||
bf_ptr[j + 0] = hashconfig->st_pass[i];
|
||||
bf_ptr[j + 1] = 0;
|
||||
}
|
||||
}
|
||||
else if (hashconfig->opts_type & OPTS_TYPE_PT_UTF16BE)
|
||||
{
|
||||
memset (bf_ptr, 0, 4);
|
||||
|
||||
for (int i = 0, j = 0; i < 1; i += 1, j += 2)
|
||||
{
|
||||
bf_ptr[j + 0] = 0;
|
||||
bf_ptr[j + 1] = hashconfig->st_pass[i];
|
||||
}
|
||||
}
|
||||
|
||||
if (hashconfig->opts_type & OPTS_TYPE_PT_UPPER)
|
||||
{
|
||||
uppercase ((u8 *) bf_ptr, 4);
|
||||
}
|
||||
|
||||
if (hashconfig->opts_type & OPTS_TYPE_PT_GENERATE_BE)
|
||||
{
|
||||
bf.i = byte_swap_32 (bf.i);
|
||||
}
|
||||
|
||||
CL_err = hc_clEnqueueWriteBuffer (hashcat_ctx, device_param->command_queue, device_param->d_bfs_c, CL_TRUE, 0, 1 * sizeof (bf_t), &bf, 0, NULL, NULL);
|
||||
|
||||
if (CL_err != CL_SUCCESS) return -1;
|
||||
|
||||
pw_t pw; memset (&pw, 0, sizeof (pw));
|
||||
|
||||
char *pw_ptr = (char *) &pw.i;
|
||||
|
||||
const size_t pw_len = strlen (hashconfig->st_pass);
|
||||
|
||||
memcpy (pw_ptr + 1, hashconfig->st_pass + 1, pw_len - 1);
|
||||
|
||||
size_t new_pass_len = pw_len;
|
||||
|
||||
if (hashconfig->opts_type & OPTS_TYPE_PT_UTF16LE)
|
||||
{
|
||||
memset (pw_ptr, 0, pw_len);
|
||||
|
||||
for (size_t i = 1, j = 2; i < new_pass_len; i += 1, j += 2)
|
||||
{
|
||||
pw_ptr[j + 0] = hashconfig->st_pass[i];
|
||||
pw_ptr[j + 1] = 0;
|
||||
}
|
||||
|
||||
new_pass_len *= 2;
|
||||
}
|
||||
else if (hashconfig->opts_type & OPTS_TYPE_PT_UTF16BE)
|
||||
{
|
||||
memset (pw_ptr, 0, pw_len);
|
||||
|
||||
for (size_t i = 1, j = 2; i < new_pass_len; i += 1, j += 2)
|
||||
{
|
||||
pw_ptr[j + 0] = 0;
|
||||
pw_ptr[j + 1] = hashconfig->st_pass[i];
|
||||
}
|
||||
|
||||
new_pass_len *= 2;
|
||||
}
|
||||
|
||||
if (hashconfig->opts_type & OPTS_TYPE_PT_UPPER)
|
||||
{
|
||||
uppercase ((u8 *) pw_ptr, new_pass_len);
|
||||
}
|
||||
|
||||
if (hashconfig->opti_type & OPTI_TYPE_SINGLE_HASH)
|
||||
{
|
||||
if (hashconfig->opti_type & OPTI_TYPE_APPENDED_SALT)
|
||||
{
|
||||
memcpy (pw_ptr + new_pass_len, (char *) hashes->st_salts_buf[0].salt_buf, 64 - new_pass_len);
|
||||
|
||||
new_pass_len += hashes->st_salts_buf[0].salt_len;
|
||||
}
|
||||
}
|
||||
|
||||
pw.pw_len = (u32) new_pass_len;
|
||||
|
||||
if (hashconfig->opts_type & OPTS_TYPE_PT_ADD01)
|
||||
{
|
||||
pw_ptr[new_pass_len] = 0x01;
|
||||
}
|
||||
|
||||
if (hashconfig->opts_type & OPTS_TYPE_PT_ADD80)
|
||||
{
|
||||
pw_ptr[new_pass_len] = 0x80;
|
||||
}
|
||||
|
||||
if (hashconfig->opts_type & OPTS_TYPE_PT_ADDBITS14)
|
||||
{
|
||||
pw.i[14] = (u32) new_pass_len * 8;
|
||||
pw.i[15] = 0;
|
||||
}
|
||||
|
||||
if (hashconfig->opts_type & OPTS_TYPE_PT_ADDBITS15)
|
||||
{
|
||||
pw.i[14] = 0;
|
||||
pw.i[15] = (u32) new_pass_len * 8;
|
||||
}
|
||||
|
||||
if (hashconfig->opts_type & OPTS_TYPE_PT_GENERATE_BE)
|
||||
{
|
||||
for (int i = 0; i < 14; i++) pw.i[i] = byte_swap_32 (pw.i[i]);
|
||||
}
|
||||
|
||||
CL_err = hc_clEnqueueWriteBuffer (hashcat_ctx, device_param->command_queue, device_param->d_pws_buf, CL_TRUE, 0, 1 * sizeof (pw_t), &pw, 0, NULL, NULL);
|
||||
|
||||
if (CL_err != CL_SUCCESS) return -1;
|
||||
|
||||
highest_pw_len = pw.pw_len;
|
||||
}
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
pw_t pw; memset (&pw, 0, sizeof (pw));
|
||||
|
||||
char *pw_ptr = (char *) &pw.i;
|
||||
|
||||
const size_t pw_len = strlen (hashconfig->st_pass);
|
||||
|
||||
memcpy (pw_ptr, hashconfig->st_pass, pw_len);
|
||||
|
||||
pw.pw_len = (u32) pw_len;
|
||||
|
||||
CL_err = hc_clEnqueueWriteBuffer (hashcat_ctx, device_param->command_queue, device_param->d_pws_buf, CL_TRUE, 0, 1 * sizeof (pw_t), &pw, 0, NULL, NULL);
|
||||
|
||||
if (CL_err != CL_SUCCESS) return -1;
|
||||
}
|
||||
}
|
||||
|
||||
// main : run the kernel
|
||||
|
||||
@ -479,23 +504,32 @@ static int selftest (hashcat_ctx_t *hashcat_ctx, hc_device_param_t *device_param
|
||||
CL_rc = run_kernel_bzero (hashcat_ctx, device_param, device_param->d_digests_shown, device_param->size_shown); if (CL_rc == -1) return -1;
|
||||
CL_rc = run_kernel_bzero (hashcat_ctx, device_param, device_param->d_result, device_param->size_results); if (CL_rc == -1) return -1;
|
||||
|
||||
if (user_options_extra->attack_kern == ATTACK_KERN_STRAIGHT)
|
||||
if (user_options->slow_candidates == true)
|
||||
{
|
||||
CL_rc = run_kernel_bzero (hashcat_ctx, device_param, device_param->d_rules_c, device_param->size_rules_c);
|
||||
|
||||
if (CL_rc == -1) return -1;
|
||||
}
|
||||
else if (user_options_extra->attack_kern == ATTACK_KERN_COMBI)
|
||||
else
|
||||
{
|
||||
CL_rc = run_kernel_bzero (hashcat_ctx, device_param, device_param->d_combs_c, device_param->size_combs);
|
||||
if (user_options_extra->attack_kern == ATTACK_KERN_STRAIGHT)
|
||||
{
|
||||
CL_rc = run_kernel_bzero (hashcat_ctx, device_param, device_param->d_rules_c, device_param->size_rules_c);
|
||||
|
||||
if (CL_rc == -1) return -1;
|
||||
}
|
||||
else if (user_options_extra->attack_kern == ATTACK_KERN_BF)
|
||||
{
|
||||
CL_rc = run_kernel_bzero (hashcat_ctx, device_param, device_param->d_bfs_c, device_param->size_bfs);
|
||||
if (CL_rc == -1) return -1;
|
||||
}
|
||||
else if (user_options_extra->attack_kern == ATTACK_KERN_COMBI)
|
||||
{
|
||||
CL_rc = run_kernel_bzero (hashcat_ctx, device_param, device_param->d_combs_c, device_param->size_combs);
|
||||
|
||||
if (CL_rc == -1) return -1;
|
||||
if (CL_rc == -1) return -1;
|
||||
}
|
||||
else if (user_options_extra->attack_kern == ATTACK_KERN_BF)
|
||||
{
|
||||
CL_rc = run_kernel_bzero (hashcat_ctx, device_param, device_param->d_bfs_c, device_param->size_bfs);
|
||||
|
||||
if (CL_rc == -1) return -1;
|
||||
}
|
||||
}
|
||||
|
||||
// check return
|
||||
|
163
src/slow_candidates.c
Normal file
163
src/slow_candidates.c
Normal file
@ -0,0 +1,163 @@
|
||||
/**
|
||||
* Author......: See docs/credits.txt
|
||||
* License.....: MIT
|
||||
*/
|
||||
|
||||
#include "common.h"
|
||||
#include "types.h"
|
||||
#include "rp.h"
|
||||
#include "rp_cpu.h"
|
||||
#include "rp_kernel_on_cpu.h"
|
||||
#include "rp_kernel_on_cpu_optimized.h"
|
||||
#include "wordlist.h"
|
||||
#include "mpsp.h"
|
||||
#include "slow_candidates.h"
|
||||
|
||||
void slow_candidates_seek (hashcat_ctx_t *hashcat_ctx, void *extra_info, const u64 cur, const u64 end)
|
||||
{
|
||||
straight_ctx_t *straight_ctx = hashcat_ctx->straight_ctx;
|
||||
user_options_t *user_options = hashcat_ctx->user_options;
|
||||
user_options_extra_t *user_options_extra = hashcat_ctx->user_options_extra;
|
||||
|
||||
const u32 attack_mode = user_options->attack_mode;
|
||||
|
||||
if (attack_mode == ATTACK_MODE_STRAIGHT)
|
||||
{
|
||||
extra_info_straight_t *extra_info_straight = (extra_info_straight_t *) extra_info;
|
||||
|
||||
FILE *fd = extra_info_straight->fd;
|
||||
|
||||
const u64 overlap = end % straight_ctx->kernel_rules_cnt;
|
||||
|
||||
const u64 init = end - overlap;
|
||||
|
||||
for (u64 i = cur; i < init; i += straight_ctx->kernel_rules_cnt)
|
||||
{
|
||||
char *line_buf;
|
||||
u32 line_len;
|
||||
|
||||
while (1)
|
||||
{
|
||||
get_next_word (hashcat_ctx, fd, &line_buf, &line_len);
|
||||
|
||||
// post-process rule engine
|
||||
|
||||
char rule_buf_out[RP_PASSWORD_SIZE];
|
||||
|
||||
if (run_rule_engine ((int) user_options_extra->rule_len_l, user_options->rule_buf_l))
|
||||
{
|
||||
if (line_len >= RP_PASSWORD_SIZE) continue;
|
||||
|
||||
memset (rule_buf_out, 0, sizeof (rule_buf_out));
|
||||
|
||||
const int rule_len_out = _old_apply_rule (user_options->rule_buf_l, (int) user_options_extra->rule_len_l, line_buf, (int) line_len, rule_buf_out);
|
||||
|
||||
if (rule_len_out < 0) continue;
|
||||
|
||||
line_buf = rule_buf_out;
|
||||
line_len = (u32) rule_len_out;
|
||||
}
|
||||
|
||||
break;
|
||||
}
|
||||
|
||||
memcpy (extra_info_straight->base_buf, line_buf, line_len);
|
||||
|
||||
extra_info_straight->base_len = line_len;
|
||||
}
|
||||
|
||||
extra_info_straight->rule_pos_prev = overlap;
|
||||
extra_info_straight->rule_pos = overlap;
|
||||
}
|
||||
else if (attack_mode == ATTACK_MODE_BF)
|
||||
{
|
||||
// nothing to do
|
||||
}
|
||||
}
|
||||
|
||||
void slow_candidates_next (hashcat_ctx_t *hashcat_ctx, void *extra_info)
|
||||
{
|
||||
hashconfig_t *hashconfig = hashcat_ctx->hashconfig;
|
||||
mask_ctx_t *mask_ctx = hashcat_ctx->mask_ctx;
|
||||
straight_ctx_t *straight_ctx = hashcat_ctx->straight_ctx;
|
||||
user_options_t *user_options = hashcat_ctx->user_options;
|
||||
user_options_extra_t *user_options_extra = hashcat_ctx->user_options_extra;
|
||||
|
||||
const u32 attack_mode = user_options->attack_mode;
|
||||
|
||||
if (attack_mode == ATTACK_MODE_STRAIGHT)
|
||||
{
|
||||
extra_info_straight_t *extra_info_straight = (extra_info_straight_t *) extra_info;
|
||||
|
||||
FILE *fd = extra_info_straight->fd;
|
||||
|
||||
if (extra_info_straight->rule_pos == 0)
|
||||
{
|
||||
char *line_buf;
|
||||
u32 line_len;
|
||||
|
||||
while (1)
|
||||
{
|
||||
get_next_word (hashcat_ctx, fd, &line_buf, &line_len);
|
||||
|
||||
line_len = (u32) convert_from_hex (hashcat_ctx, line_buf, line_len);
|
||||
|
||||
// post-process rule engine
|
||||
|
||||
char rule_buf_out[RP_PASSWORD_SIZE];
|
||||
|
||||
if (run_rule_engine ((int) user_options_extra->rule_len_l, user_options->rule_buf_l))
|
||||
{
|
||||
if (line_len >= RP_PASSWORD_SIZE) continue;
|
||||
|
||||
memset (rule_buf_out, 0, sizeof (rule_buf_out));
|
||||
|
||||
const int rule_len_out = _old_apply_rule (user_options->rule_buf_l, (int) user_options_extra->rule_len_l, line_buf, (int) line_len, rule_buf_out);
|
||||
|
||||
if (rule_len_out < 0) continue;
|
||||
|
||||
line_buf = rule_buf_out;
|
||||
line_len = (u32) rule_len_out;
|
||||
}
|
||||
|
||||
break;
|
||||
}
|
||||
|
||||
memcpy (extra_info_straight->base_buf, line_buf, line_len);
|
||||
|
||||
extra_info_straight->base_len = line_len;
|
||||
}
|
||||
|
||||
memcpy (extra_info_straight->out_buf, extra_info_straight->base_buf, extra_info_straight->base_len);
|
||||
|
||||
extra_info_straight->out_len = extra_info_straight->base_len;
|
||||
|
||||
memset (extra_info_straight->out_buf + extra_info_straight->base_len, 0, sizeof (extra_info_straight->out_buf) - extra_info_straight->out_len);
|
||||
|
||||
u32 *out_ptr = (u32 *) extra_info_straight->out_buf;
|
||||
|
||||
if (hashconfig->opti_type & OPTI_TYPE_OPTIMIZED_KERNEL)
|
||||
{
|
||||
extra_info_straight->out_len = apply_rules_optimized (straight_ctx->kernel_rules_buf[extra_info_straight->rule_pos].cmds, &out_ptr[0], &out_ptr[4], extra_info_straight->out_len);
|
||||
}
|
||||
else
|
||||
{
|
||||
extra_info_straight->out_len = apply_rules (straight_ctx->kernel_rules_buf[extra_info_straight->rule_pos].cmds, out_ptr, extra_info_straight->out_len);
|
||||
}
|
||||
|
||||
extra_info_straight->rule_pos_prev = extra_info_straight->rule_pos;
|
||||
|
||||
extra_info_straight->rule_pos++;
|
||||
|
||||
if (extra_info_straight->rule_pos == straight_ctx->kernel_rules_cnt)
|
||||
{
|
||||
extra_info_straight->rule_pos = 0;
|
||||
}
|
||||
}
|
||||
else if (attack_mode == ATTACK_MODE_BF)
|
||||
{
|
||||
extra_info_mask_t *extra_info_mask = (extra_info_mask_t *) extra_info;
|
||||
|
||||
sp_exec (extra_info_mask->pos, (char *) extra_info_mask->out_buf, mask_ctx->root_css_buf, mask_ctx->markov_css_buf, 0, mask_ctx->css_cnt);
|
||||
}
|
||||
}
|
38
src/status.c
38
src/status.c
@ -141,6 +141,38 @@ void format_speed_display (double val, char *buf, size_t len)
|
||||
}
|
||||
}
|
||||
|
||||
void format_speed_display_1k (double val, char *buf, size_t len)
|
||||
{
|
||||
if (val <= 0)
|
||||
{
|
||||
buf[0] = '0';
|
||||
buf[1] = ' ';
|
||||
buf[2] = 0;
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
u32 level = 0;
|
||||
|
||||
while (val > 999)
|
||||
{
|
||||
val /= 1000;
|
||||
|
||||
level++;
|
||||
}
|
||||
|
||||
/* generate output */
|
||||
|
||||
if (level == 0)
|
||||
{
|
||||
snprintf (buf, len - 1, "%.0f ", val);
|
||||
}
|
||||
else
|
||||
{
|
||||
snprintf (buf, len - 1, "%.1f %c", val, UNITS[level]);
|
||||
}
|
||||
}
|
||||
|
||||
double get_avg_exec_time (hc_device_param_t *device_param, const int last_num_entries)
|
||||
{
|
||||
int exec_pos = (int) device_param->exec_pos - last_num_entries;
|
||||
@ -2029,8 +2061,8 @@ void status_status_destroy (hashcat_ctx_t *hashcat_ctx, hashcat_status_t *hashca
|
||||
hcfree (device_info->guess_candidates_dev);
|
||||
hcfree (device_info->hwmon_dev);
|
||||
|
||||
device_info->speed_sec_dev = NULL;
|
||||
device_info->guess_candidates_dev = NULL;
|
||||
device_info->hwmon_dev = NULL;
|
||||
device_info->speed_sec_dev = NULL;
|
||||
device_info->guess_candidates_dev = NULL;
|
||||
device_info->hwmon_dev = NULL;
|
||||
}
|
||||
}
|
||||
|
@ -1216,7 +1216,7 @@ void status_display (hashcat_ctx_t *hashcat_ctx)
|
||||
if (device_info->skipped_dev == true) continue;
|
||||
|
||||
event_log_info (hashcat_ctx,
|
||||
"Speed.Dev.#%d.....: %9sH/s (%0.2fms) @ Accel:%d Loops:%d Thr:%d Vec:%d", device_id + 1,
|
||||
"Speed.#%d.........: %9sH/s (%0.2fms) @ Accel:%d Loops:%d Thr:%d Vec:%d", device_id + 1,
|
||||
device_info->speed_sec_dev,
|
||||
device_info->exec_msec_dev,
|
||||
device_info->kernel_accel_dev,
|
||||
@ -1228,7 +1228,7 @@ void status_display (hashcat_ctx_t *hashcat_ctx)
|
||||
if (hashcat_status->device_info_active > 1)
|
||||
{
|
||||
event_log_info (hashcat_ctx,
|
||||
"Speed.Dev.#*.....: %9sH/s",
|
||||
"Speed.#*.........: %9sH/s",
|
||||
hashcat_status->speed_sec_all);
|
||||
}
|
||||
|
||||
@ -1264,12 +1264,6 @@ void status_display (hashcat_ctx_t *hashcat_ctx)
|
||||
hashcat_status->progress_cur_relative_skip,
|
||||
hashcat_status->progress_rejected_percent);
|
||||
|
||||
event_log_info (hashcat_ctx,
|
||||
"Restore.Point....: %" PRIu64 "/%" PRIu64 " (%.02f%%)",
|
||||
hashcat_status->restore_point,
|
||||
hashcat_status->restore_total,
|
||||
hashcat_status->restore_percent);
|
||||
|
||||
break;
|
||||
|
||||
case PROGRESS_MODE_KEYSPACE_UNKNOWN:
|
||||
@ -1282,6 +1276,23 @@ void status_display (hashcat_ctx_t *hashcat_ctx)
|
||||
"Rejected.........: %" PRIu64,
|
||||
hashcat_status->progress_rejected);
|
||||
|
||||
break;
|
||||
}
|
||||
|
||||
switch (hashcat_status->progress_mode)
|
||||
{
|
||||
case PROGRESS_MODE_KEYSPACE_KNOWN:
|
||||
|
||||
event_log_info (hashcat_ctx,
|
||||
"Restore.Point....: %" PRIu64 "/%" PRIu64 " (%.02f%%)",
|
||||
hashcat_status->restore_point,
|
||||
hashcat_status->restore_total,
|
||||
hashcat_status->restore_percent);
|
||||
|
||||
break;
|
||||
|
||||
case PROGRESS_MODE_KEYSPACE_UNKNOWN:
|
||||
|
||||
event_log_info (hashcat_ctx,
|
||||
"Restore.Point....: %" PRIu64,
|
||||
hashcat_status->restore_point);
|
||||
@ -1328,7 +1339,7 @@ void status_display (hashcat_ctx_t *hashcat_ctx)
|
||||
if (device_info->hwmon_dev == NULL) continue;
|
||||
|
||||
event_log_info (hashcat_ctx,
|
||||
"HWMon.Dev.#%d.....: %s", device_id + 1,
|
||||
"Hardware.Mon.#%d..: %s", device_id + 1,
|
||||
device_info->hwmon_dev);
|
||||
}
|
||||
}
|
||||
@ -1398,7 +1409,7 @@ void status_benchmark (hashcat_ctx_t *hashcat_ctx)
|
||||
if (device_info->skipped_dev == true) continue;
|
||||
|
||||
event_log_info (hashcat_ctx,
|
||||
"Speed.Dev.#%d.....: %9sH/s (%0.2fms) @ Accel:%d Loops:%d Thr:%d Vec:%d", device_id + 1,
|
||||
"Speed.#%d.........: %9sH/s (%0.2fms) @ Accel:%d Loops:%d Thr:%d Vec:%d", device_id + 1,
|
||||
device_info->speed_sec_dev,
|
||||
device_info->exec_msec_dev,
|
||||
device_info->kernel_accel_dev,
|
||||
@ -1410,7 +1421,7 @@ void status_benchmark (hashcat_ctx_t *hashcat_ctx)
|
||||
if (hashcat_status->device_info_active > 1)
|
||||
{
|
||||
event_log_info (hashcat_ctx,
|
||||
"Speed.Dev.#*.....: %9sH/s",
|
||||
"Speed.#*.........: %9sH/s",
|
||||
hashcat_status->speed_sec_all);
|
||||
}
|
||||
|
||||
@ -1475,7 +1486,7 @@ void status_speed (hashcat_ctx_t *hashcat_ctx)
|
||||
if (device_info->skipped_dev == true) continue;
|
||||
|
||||
event_log_info (hashcat_ctx,
|
||||
"Speed.Dev.#%d.....: %9sH/s (%0.2fms)", device_id + 1,
|
||||
"Speed.#%d.........: %9sH/s (%0.2fms)", device_id + 1,
|
||||
device_info->speed_sec_dev,
|
||||
device_info->exec_msec_dev);
|
||||
}
|
||||
@ -1483,7 +1494,7 @@ void status_speed (hashcat_ctx_t *hashcat_ctx)
|
||||
if (hashcat_status->device_info_active > 1)
|
||||
{
|
||||
event_log_info (hashcat_ctx,
|
||||
"Speed.Dev.#*.....: %9sH/s",
|
||||
"Speed.#*.........: %9sH/s",
|
||||
hashcat_status->speed_sec_all);
|
||||
}
|
||||
|
||||
@ -1548,7 +1559,7 @@ void status_progress (hashcat_ctx_t *hashcat_ctx)
|
||||
if (device_info->skipped_dev == true) continue;
|
||||
|
||||
event_log_info (hashcat_ctx,
|
||||
"Progress.Dev.#%d..: %" PRIu64, device_id + 1,
|
||||
"Progress.#%d......: %" PRIu64, device_id + 1,
|
||||
device_info->progress_dev);
|
||||
}
|
||||
|
||||
@ -1559,7 +1570,7 @@ void status_progress (hashcat_ctx_t *hashcat_ctx)
|
||||
if (device_info->skipped_dev == true) continue;
|
||||
|
||||
event_log_info (hashcat_ctx,
|
||||
"Runtime.Dev.#%d...: %0.2fms", device_id + 1,
|
||||
"Runtime.#%d.......: %0.2fms", device_id + 1,
|
||||
device_info->runtime_msec_dev);
|
||||
}
|
||||
|
||||
|
@ -115,6 +115,7 @@ static const char *const USAGE_BIG[] =
|
||||
" -i, --increment | | Enable mask increment mode |",
|
||||
" --increment-min | Num | Start mask incrementing at X | --increment-min=4",
|
||||
" --increment-max | Num | Stop mask incrementing at X | --increment-max=8",
|
||||
" -S, --slow-candidates | | Enable slower (but advanced) candidate generators |",
|
||||
"",
|
||||
"- [ Hash modes ] -",
|
||||
"",
|
||||
|
@ -14,14 +14,14 @@
|
||||
#include "outfile.h"
|
||||
#include "user_options.h"
|
||||
|
||||
static const char *short_options = "hVvm:a:r:j:k:g:o:t:d:D:n:u:c:p:s:l:1:2:3:4:iIbw:O";
|
||||
static const char *short_options = "hVvm:a:r:j:k:g:o:t:d:D:n:u:c:p:s:l:1:2:3:4:iIbw:OS";
|
||||
|
||||
static const struct option long_options[] =
|
||||
{
|
||||
{"advice-disable", no_argument, NULL, IDX_ADVICE_DISABLE},
|
||||
{"attack-mode", required_argument, NULL, IDX_ATTACK_MODE},
|
||||
{"benchmark", no_argument, NULL, IDX_BENCHMARK},
|
||||
{"benchmark-all", no_argument, NULL, IDX_BENCHMARK_ALL},
|
||||
{"benchmark", no_argument, NULL, IDX_BENCHMARK},
|
||||
{"bitmap-max", required_argument, NULL, IDX_BITMAP_MAX},
|
||||
{"bitmap-min", required_argument, NULL, IDX_BITMAP_MIN},
|
||||
{"cpu-affinity", required_argument, NULL, IDX_CPU_AFFINITY},
|
||||
@ -77,9 +77,9 @@ static const struct option long_options[] =
|
||||
{"outfile-check-timer", required_argument, NULL, IDX_OUTFILE_CHECK_TIMER},
|
||||
{"outfile-format", required_argument, NULL, IDX_OUTFILE_FORMAT},
|
||||
{"outfile", required_argument, NULL, IDX_OUTFILE},
|
||||
{"wordlist-autohex-disable", no_argument, NULL, IDX_WORDLIST_AUTOHEX_DISABLE},
|
||||
{"potfile-disable", no_argument, NULL, IDX_POTFILE_DISABLE},
|
||||
{"potfile-path", required_argument, NULL, IDX_POTFILE_PATH},
|
||||
{"progress-only", no_argument, NULL, IDX_PROGRESS_ONLY},
|
||||
{"quiet", no_argument, NULL, IDX_QUIET},
|
||||
{"remove", no_argument, NULL, IDX_REMOVE},
|
||||
{"remove-timer", required_argument, NULL, IDX_REMOVE_TIMER},
|
||||
@ -91,23 +91,24 @@ static const struct option long_options[] =
|
||||
{"rules-file", required_argument, NULL, IDX_RP_FILE},
|
||||
{"runtime", required_argument, NULL, IDX_RUNTIME},
|
||||
{"scrypt-tmto", required_argument, NULL, IDX_SCRYPT_TMTO},
|
||||
{"self-test-disable", no_argument, NULL, IDX_SELF_TEST_DISABLE},
|
||||
{"segment-size", required_argument, NULL, IDX_SEGMENT_SIZE},
|
||||
{"self-test-disable", no_argument, NULL, IDX_SELF_TEST_DISABLE},
|
||||
{"separator", required_argument, NULL, IDX_SEPARATOR},
|
||||
{"seperator", required_argument, NULL, IDX_SEPARATOR},
|
||||
{"session", required_argument, NULL, IDX_SESSION},
|
||||
{"show", no_argument, NULL, IDX_SHOW},
|
||||
{"skip", required_argument, NULL, IDX_SKIP},
|
||||
{"slow-candidates", no_argument, NULL, IDX_SLOW_CANDIDATES},
|
||||
{"speed-only", no_argument, NULL, IDX_SPEED_ONLY},
|
||||
{"status", no_argument, NULL, IDX_STATUS},
|
||||
{"status-timer", required_argument, NULL, IDX_STATUS_TIMER},
|
||||
{"stdout", no_argument, NULL, IDX_STDOUT_FLAG},
|
||||
{"speed-only", no_argument, NULL, IDX_SPEED_ONLY},
|
||||
{"progress-only", no_argument, NULL, IDX_PROGRESS_ONLY},
|
||||
{"truecrypt-keyfiles", required_argument, NULL, IDX_TRUECRYPT_KEYFILES},
|
||||
{"username", no_argument, NULL, IDX_USERNAME},
|
||||
{"veracrypt-keyfiles", required_argument, NULL, IDX_VERACRYPT_KEYFILES},
|
||||
{"veracrypt-pim", required_argument, NULL, IDX_VERACRYPT_PIM},
|
||||
{"version", no_argument, NULL, IDX_VERSION},
|
||||
{"wordlist-autohex-disable", no_argument, NULL, IDX_WORDLIST_AUTOHEX_DISABLE},
|
||||
{"workload-profile", required_argument, NULL, IDX_WORKLOAD_PROFILE},
|
||||
{NULL, 0, NULL, 0 }
|
||||
};
|
||||
@ -128,8 +129,8 @@ int user_options_init (hashcat_ctx_t *hashcat_ctx)
|
||||
|
||||
user_options->advice_disable = ADVICE_DISABLE;
|
||||
user_options->attack_mode = ATTACK_MODE;
|
||||
user_options->benchmark = BENCHMARK;
|
||||
user_options->benchmark_all = BENCHMARK_ALL;
|
||||
user_options->benchmark = BENCHMARK;
|
||||
user_options->bitmap_max = BITMAP_MAX;
|
||||
user_options->bitmap_min = BITMAP_MIN;
|
||||
user_options->cpu_affinity = NULL;
|
||||
@ -139,9 +140,9 @@ 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->example_hashes = EXAMPLE_HASHES;
|
||||
user_options->force = FORCE;
|
||||
user_options->gpu_temp_abort = GPU_TEMP_ABORT;
|
||||
user_options->gpu_temp_disable = GPU_TEMP_DISABLE;
|
||||
@ -154,9 +155,9 @@ int user_options_init (hashcat_ctx_t *hashcat_ctx)
|
||||
user_options->increment_max = INCREMENT_MAX;
|
||||
user_options->increment_min = INCREMENT_MIN;
|
||||
user_options->induction_dir = NULL;
|
||||
user_options->keep_guessing = KEEP_GUESSING;
|
||||
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;
|
||||
@ -175,7 +176,6 @@ int user_options_init (hashcat_ctx_t *hashcat_ctx)
|
||||
user_options->opencl_platforms = NULL;
|
||||
user_options->opencl_vector_width = OPENCL_VECTOR_WIDTH;
|
||||
user_options->optimized_kernel_enable = OPTIMIZED_KERNEL_ENABLE;
|
||||
user_options->wordlist_autohex_disable = WORDLIST_AUTOHEX_DISABLE;
|
||||
user_options->outfile_autohex = OUTFILE_AUTOHEX;
|
||||
user_options->outfile_check_dir = NULL;
|
||||
user_options->outfile_check_timer = OUTFILE_CHECK_TIMER;
|
||||
@ -183,6 +183,7 @@ int user_options_init (hashcat_ctx_t *hashcat_ctx)
|
||||
user_options->outfile = NULL;
|
||||
user_options->potfile_disable = POTFILE_DISABLE;
|
||||
user_options->potfile_path = NULL;
|
||||
user_options->progress_only = PROGRESS_ONLY;
|
||||
user_options->quiet = QUIET;
|
||||
user_options->remove = REMOVE;
|
||||
user_options->remove_timer = REMOVE_TIMER;
|
||||
@ -198,23 +199,24 @@ int user_options_init (hashcat_ctx_t *hashcat_ctx)
|
||||
user_options->rule_buf_r = RULE_BUF_R;
|
||||
user_options->runtime = RUNTIME;
|
||||
user_options->scrypt_tmto = SCRYPT_TMTO;
|
||||
user_options->self_test_disable = SELF_TEST_DISABLE;
|
||||
user_options->segment_size = SEGMENT_SIZE;
|
||||
user_options->self_test_disable = SELF_TEST_DISABLE;
|
||||
user_options->separator = SEPARATOR;
|
||||
user_options->session = PROGNAME;
|
||||
user_options->show = SHOW;
|
||||
user_options->skip = SKIP;
|
||||
user_options->slow_candidates = SLOW_CANDIDATES;
|
||||
user_options->speed_only = SPEED_ONLY;
|
||||
user_options->status = STATUS;
|
||||
user_options->status_timer = STATUS_TIMER;
|
||||
user_options->stdout_flag = STDOUT_FLAG;
|
||||
user_options->speed_only = SPEED_ONLY;
|
||||
user_options->progress_only = PROGRESS_ONLY;
|
||||
user_options->truecrypt_keyfiles = NULL;
|
||||
user_options->usage = USAGE;
|
||||
user_options->username = USERNAME;
|
||||
user_options->veracrypt_keyfiles = NULL;
|
||||
user_options->veracrypt_pim = 0;
|
||||
user_options->version = VERSION;
|
||||
user_options->wordlist_autohex_disable = WORDLIST_AUTOHEX_DISABLE;
|
||||
user_options->workload_profile = WORKLOAD_PROFILE;
|
||||
user_options->rp_files_cnt = 0;
|
||||
user_options->rp_files = (char **) hccalloc (256, sizeof (char *));
|
||||
@ -416,6 +418,7 @@ int user_options_getopt (hashcat_ctx_t *hashcat_ctx, int argc, char **argv)
|
||||
case IDX_CUSTOM_CHARSET_2: user_options->custom_charset_2 = optarg; break;
|
||||
case IDX_CUSTOM_CHARSET_3: user_options->custom_charset_3 = optarg; break;
|
||||
case IDX_CUSTOM_CHARSET_4: user_options->custom_charset_4 = optarg; break;
|
||||
case IDX_SLOW_CANDIDATES: user_options->slow_candidates = true; break;
|
||||
}
|
||||
}
|
||||
|
||||
@ -445,16 +448,29 @@ int user_options_sanity (hashcat_ctx_t *hashcat_ctx)
|
||||
return -1;
|
||||
}
|
||||
|
||||
if ((user_options->attack_mode != ATTACK_MODE_STRAIGHT)
|
||||
&& (user_options->attack_mode != ATTACK_MODE_COMBI)
|
||||
&& (user_options->attack_mode != ATTACK_MODE_BF)
|
||||
&& (user_options->attack_mode != ATTACK_MODE_HYBRID1)
|
||||
&& (user_options->attack_mode != ATTACK_MODE_HYBRID2)
|
||||
&& (user_options->attack_mode != ATTACK_MODE_NONE))
|
||||
if (user_options->slow_candidates == true)
|
||||
{
|
||||
event_log_error (hashcat_ctx, "Invalid attack mode (-a) value specified.");
|
||||
if ((user_options->attack_mode != ATTACK_MODE_STRAIGHT)
|
||||
&& (user_options->attack_mode != ATTACK_MODE_BF))
|
||||
{
|
||||
event_log_error (hashcat_ctx, "Invalid attack mode (-a) value specified in slow-candidates mode.");
|
||||
|
||||
return -1;
|
||||
return -1;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
if ((user_options->attack_mode != ATTACK_MODE_STRAIGHT)
|
||||
&& (user_options->attack_mode != ATTACK_MODE_COMBI)
|
||||
&& (user_options->attack_mode != ATTACK_MODE_BF)
|
||||
&& (user_options->attack_mode != ATTACK_MODE_HYBRID1)
|
||||
&& (user_options->attack_mode != ATTACK_MODE_HYBRID2)
|
||||
&& (user_options->attack_mode != ATTACK_MODE_NONE))
|
||||
{
|
||||
event_log_error (hashcat_ctx, "Invalid attack mode (-a) value specified.");
|
||||
|
||||
return -1;
|
||||
}
|
||||
}
|
||||
|
||||
if (user_options->hccapx_message_pair_chgd == true)
|
||||
@ -1278,6 +1294,11 @@ void user_options_preprocess (hashcat_ctx_t *hashcat_ctx)
|
||||
user_options->quiet = true;
|
||||
}
|
||||
|
||||
if (user_options->slow_candidates == true)
|
||||
{
|
||||
user_options->opencl_vector_width = 1;
|
||||
}
|
||||
|
||||
if (user_options->stdout_flag == true)
|
||||
{
|
||||
user_options->force = true;
|
||||
@ -1646,27 +1667,35 @@ u64 user_options_extra_amplifier (hashcat_ctx_t *hashcat_ctx)
|
||||
const combinator_ctx_t *combinator_ctx = hashcat_ctx->combinator_ctx;
|
||||
const mask_ctx_t *mask_ctx = hashcat_ctx->mask_ctx;
|
||||
const straight_ctx_t *straight_ctx = hashcat_ctx->straight_ctx;
|
||||
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_extra->attack_kern == ATTACK_KERN_STRAIGHT)
|
||||
if (user_options->slow_candidates == true)
|
||||
{
|
||||
if (straight_ctx->kernel_rules_cnt)
|
||||
{
|
||||
return straight_ctx->kernel_rules_cnt;
|
||||
}
|
||||
return 1;
|
||||
}
|
||||
else if (user_options_extra->attack_kern == ATTACK_KERN_COMBI)
|
||||
else
|
||||
{
|
||||
if (combinator_ctx->combs_cnt)
|
||||
if (user_options_extra->attack_kern == ATTACK_KERN_STRAIGHT)
|
||||
{
|
||||
return combinator_ctx->combs_cnt;
|
||||
if (straight_ctx->kernel_rules_cnt)
|
||||
{
|
||||
return straight_ctx->kernel_rules_cnt;
|
||||
}
|
||||
}
|
||||
}
|
||||
else if (user_options_extra->attack_kern == ATTACK_KERN_BF)
|
||||
{
|
||||
if (mask_ctx->bfs_cnt)
|
||||
else if (user_options_extra->attack_kern == ATTACK_KERN_COMBI)
|
||||
{
|
||||
return mask_ctx->bfs_cnt;
|
||||
if (combinator_ctx->combs_cnt)
|
||||
{
|
||||
return combinator_ctx->combs_cnt;
|
||||
}
|
||||
}
|
||||
else if (user_options_extra->attack_kern == ATTACK_KERN_BF)
|
||||
{
|
||||
if (mask_ctx->bfs_cnt)
|
||||
{
|
||||
return mask_ctx->bfs_cnt;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@ -2340,6 +2369,7 @@ void user_options_logger (hashcat_ctx_t *hashcat_ctx)
|
||||
logfile_top_uint (user_options->scrypt_tmto);
|
||||
logfile_top_uint (user_options->segment_size);
|
||||
logfile_top_uint (user_options->self_test_disable);
|
||||
logfile_top_uint (user_options->slow_candidates);
|
||||
logfile_top_uint (user_options->show);
|
||||
logfile_top_uint (user_options->speed_only);
|
||||
logfile_top_uint (user_options->status);
|
||||
|
@ -238,6 +238,51 @@ void get_next_word (hashcat_ctx_t *hashcat_ctx, FILE *fd, char **out_buf, u32 *o
|
||||
get_next_word (hashcat_ctx, fd, out_buf, out_len);
|
||||
}
|
||||
|
||||
void pw_pre_add (hc_device_param_t *device_param, const u8 *pw_buf, const int pw_len, const u8 *base_buf, const int base_len, const int rule_idx)
|
||||
{
|
||||
if (device_param->pws_pre_cnt < device_param->kernel_power)
|
||||
{
|
||||
pw_pre_t *pw_pre = device_param->pws_pre_buf + device_param->pws_pre_cnt;
|
||||
|
||||
memcpy (pw_pre->pw_buf, pw_buf, pw_len);
|
||||
|
||||
pw_pre->pw_len = pw_len;
|
||||
|
||||
if (base_buf != NULL)
|
||||
{
|
||||
memcpy (pw_pre->base_buf, base_buf, base_len);
|
||||
|
||||
pw_pre->base_len = base_len;
|
||||
}
|
||||
|
||||
pw_pre->rule_idx = rule_idx;
|
||||
|
||||
device_param->pws_pre_cnt++;
|
||||
}
|
||||
else
|
||||
{
|
||||
fprintf (stdout, "BUG pw_pre_add()!!\n");
|
||||
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
void pw_base_add (hc_device_param_t *device_param, pw_pre_t *pw_pre)
|
||||
{
|
||||
if (device_param->pws_base_cnt < device_param->kernel_power)
|
||||
{
|
||||
memcpy (device_param->pws_base_buf + device_param->pws_base_cnt, pw_pre, sizeof (pw_pre_t));
|
||||
|
||||
device_param->pws_base_cnt++;
|
||||
}
|
||||
else
|
||||
{
|
||||
fprintf (stderr, "BUG pw_base_add()!!\n");
|
||||
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
void pw_add (hc_device_param_t *device_param, const u8 *pw_buf, const int pw_len)
|
||||
{
|
||||
if (device_param->pws_cnt < device_param->kernel_power)
|
||||
|
Loading…
Reference in New Issue
Block a user