1
0
mirror of https://github.com/hashcat/hashcat.git synced 2024-12-22 22:58:30 +00:00

Merge pull request #3237 from philsmd/philsmd-a7-O-rule-right

fixes #3211: fixes -k in -a 7 with -O
This commit is contained in:
Jens Steube 2022-03-24 14:48:32 +01:00 committed by GitHub
commit 84acc32a77
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 27 additions and 7 deletions

View File

@ -47,6 +47,7 @@
- Fixed optimized (-O) candidate generation with --stdout and -a 7
- Fixed password limit in optimized kernel for hash-mode 10700
- Fixed undefined function call to hc_byte_perm_S() in hash-mode 17010 on non-CUDA compute devices
- Fixed usage of --rule-right (-k) in -a 7 with optimized (-O) kernels
- Fixed Unit Test early exit on luks test file download/extract failure
- Fixed Unit Test false negative if there are spaces in the filesystem path to hashcat
- Fixed Unit Test salt-max in case of optimized kernel, with hash-type 22 and 23

View File

@ -152,6 +152,9 @@ static int calc_stdin (hashcat_ctx_t *hashcat_ctx, hc_device_param_t *device_par
straight_ctx_t *straight_ctx = hashcat_ctx->straight_ctx;
status_ctx_t *status_ctx = hashcat_ctx->status_ctx;
const u32 attack_mode = user_options->attack_mode;
const u32 attack_kern = user_options_extra->attack_kern;
char *buf = (char *) hcmalloc (HCBUFSIZ_LARGE);
bool iconv_enabled = false;
@ -243,13 +246,22 @@ static int calc_stdin (hashcat_ctx_t *hashcat_ctx, hc_device_param_t *device_par
char rule_buf_out[RP_PASSWORD_SIZE];
if (run_rule_engine ((int) user_options_extra->rule_len_l, user_options->rule_buf_l))
int rule_jk_len = (int) user_options_extra->rule_len_l;
char *rule_jk_buf = (char *) user_options->rule_buf_l;
if (attack_mode == ATTACK_MODE_HYBRID2)
{
rule_jk_len = (int) user_options_extra->rule_len_r;
rule_jk_buf = (char *) user_options->rule_buf_r;
}
if (run_rule_engine (rule_jk_len, rule_jk_buf))
{
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);
const int rule_len_out = _old_apply_rule (rule_jk_buf, rule_jk_len, line_buf, (int) line_len, rule_buf_out);
if (rule_len_out < 0) continue;
@ -261,8 +273,6 @@ static int calc_stdin (hashcat_ctx_t *hashcat_ctx, hc_device_param_t *device_par
// hmm that's always the case, or?
const u32 attack_kern = user_options_extra->attack_kern;
if (attack_kern == ATTACK_KERN_STRAIGHT)
{
if ((line_len < hashconfig->pw_min) || (line_len > hashconfig->pw_max))
@ -1415,13 +1425,22 @@ static int calc (hashcat_ctx_t *hashcat_ctx, hc_device_param_t *device_param)
// post-process rule engine
if (run_rule_engine ((int) user_options_extra->rule_len_l, user_options->rule_buf_l))
int rule_jk_len = (int) user_options_extra->rule_len_l;
char *rule_jk_buf = (char *) user_options->rule_buf_l;
if (attack_mode == ATTACK_MODE_HYBRID2)
{
rule_jk_len = (int) user_options_extra->rule_len_r;
rule_jk_buf = (char *) user_options->rule_buf_r;
}
if (run_rule_engine (rule_jk_len, rule_jk_buf))
{
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);
const int rule_len_out = _old_apply_rule (rule_jk_buf, rule_jk_len, line_buf, (int) line_len, rule_buf_out);
if (rule_len_out < 0) continue;
@ -1429,7 +1448,7 @@ static int calc (hashcat_ctx_t *hashcat_ctx, hc_device_param_t *device_param)
line_len = (u32) rule_len_out;
}
if (user_options->attack_mode == ATTACK_MODE_ASSOCIATION)
if (attack_mode == ATTACK_MODE_ASSOCIATION)
{
// we can't reject password base on length in -a 9 because it will bring the schedule out of sync
// therefore we render it defective so the other candidates survive