Allow using -L with -a 7 (other modes need no modification) for fast hashes

pull/1288/head
jsteube 7 years ago
parent f7a8e7c54b
commit f97c0d38d7

@ -33,11 +33,11 @@ int combinator_ctx_init (hashcat_ctx_t *hashcat_ctx)
combinator_ctx->scratch_buf = (char *) hcmalloc (HCBUFSIZ_LARGE);
if (user_options->attack_mode == ATTACK_MODE_STRAIGHT)
if (user_options->length_limit_disable == true)
{
// nothing to do
}
else if (user_options->attack_mode == ATTACK_MODE_COMBI)
// this is always need to be COMBINATOR_MODE_BASE_LEFT
if (user_options->attack_mode == ATTACK_MODE_COMBI)
{
// display
@ -138,13 +138,161 @@ int combinator_ctx_init (hashcat_ctx_t *hashcat_ctx)
combinator_ctx->dict1 = dictfile1;
combinator_ctx->dict2 = dictfile2;
if (user_options->length_limit_disable == true)
{
combinator_ctx->combs_mode = COMBINATOR_MODE_BASE_LEFT;
combinator_ctx->combs_cnt = words2_cnt;
}
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)
{
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);
combinator_ctx->combs_cnt = words_cnt;
combinator_ctx->combs_mode = COMBINATOR_MODE_BASE_LEFT;
}
}
else
{
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;
@ -168,22 +316,11 @@ int combinator_ctx_init (hashcat_ctx_t *hashcat_ctx)
user_options_extra->rule_len_r = tmpi;
}
}
}
else if (user_options->attack_mode == ATTACK_MODE_BF)
{
// nothing to do
}
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)
{
if (user_options->length_limit_disable == true)
{
combinator_ctx->combs_mode = COMBINATOR_MODE_BASE_LEFT;
}
else
{
combinator_ctx->combs_mode = COMBINATOR_MODE_BASE_RIGHT;
}

@ -313,8 +313,24 @@ static int calc (hashcat_ctx_t *hashcat_ctx, hc_device_param_t *device_param)
const u32 attack_mode = user_options->attack_mode;
const u32 attack_kern = user_options_extra->attack_kern;
if (attack_mode == ATTACK_MODE_BF)
if ((attack_mode == ATTACK_MODE_BF) || ((user_options->length_limit_disable == true) && (attack_mode == ATTACK_MODE_HYBRID2)))
{
if ((user_options->length_limit_disable == true) && (attack_mode == ATTACK_MODE_HYBRID2))
{
char *dictfile = straight_ctx->dict;
FILE *combs_fp = fopen (dictfile, "rb");
if (combs_fp == NULL)
{
event_log_error (hashcat_ctx, "%s: %s", dictfile, strerror (errno));
return -1;
}
device_param->combs_fp = combs_fp;
}
while (status_ctx->run_thread_level1 == true)
{
const u32 work = get_work (hashcat_ctx, device_param, -1u);

@ -1173,6 +1173,41 @@ int mask_ctx_update_loop (hashcat_ctx_t *hashcat_ctx)
}
else if ((user_options->attack_mode == ATTACK_MODE_HYBRID1) || (user_options->attack_mode == ATTACK_MODE_HYBRID2))
{
if ((user_options->length_limit_disable == true) && (user_options->attack_mode == ATTACK_MODE_HYBRID2))
{
mask_ctx->mask = mask_ctx->masks[mask_ctx->masks_pos];
const int rc_mask_file = mask_ctx_parse_maskfile (hashcat_ctx);
if (rc_mask_file == -1) return -1;
mask_ctx->css_buf = (cs_t *) hccalloc (256, sizeof (cs_t));
const int rc_gen_css = mp_gen_css (hashcat_ctx, mask_ctx->mask, strlen (mask_ctx->mask), mask_ctx->mp_sys, mask_ctx->mp_usr, mask_ctx->css_buf, &mask_ctx->css_cnt);
if (rc_gen_css == -1) return -1;
u32 uniq_tbls[SP_PW_MAX][CHARSIZ] = { { 0 } };
mp_css_to_uniq_tbl (hashcat_ctx, mask_ctx->css_cnt, mask_ctx->css_buf, uniq_tbls);
sp_tbl_to_css (mask_ctx->root_table_buf, mask_ctx->markov_table_buf, mask_ctx->root_css_buf, mask_ctx->markov_css_buf, user_options->markov_threshold, uniq_tbls);
const int rc_get_sum = sp_get_sum (0, mask_ctx->css_cnt, mask_ctx->root_css_buf, &mask_ctx->bfs_cnt);
if (rc_get_sum == -1)
{
event_log_error (hashcat_ctx, "Integer overflow detected in keyspace of mask: %s", mask_ctx->mask);
return -1;
}
const int rc_update_mp = opencl_session_update_mp (hashcat_ctx);
if (rc_update_mp == -1) return -1;
}
else
{
mask_ctx->mask = mask_ctx->masks[mask_ctx->masks_pos];
@ -1205,6 +1240,7 @@ int mask_ctx_update_loop (hashcat_ctx_t *hashcat_ctx)
if (rc_update_mp == -1) return -1;
}
}
const int rc_update_combinator = opencl_session_update_combinator (hashcat_ctx);

@ -1746,9 +1746,7 @@ int run_copy (hashcat_ctx_t *hashcat_ctx, hc_device_param_t *device_param, const
if (user_options_extra->attack_kern == ATTACK_KERN_STRAIGHT)
{
int CL_rc;
CL_rc = hc_clEnqueueWriteBuffer (hashcat_ctx, device_param->command_queue, device_param->d_pws_buf, CL_TRUE, 0, pws_cnt * sizeof (pw_t), device_param->pws_buf, 0, NULL, NULL);
const int CL_rc = hc_clEnqueueWriteBuffer (hashcat_ctx, device_param->command_queue, device_param->d_pws_buf, CL_TRUE, 0, pws_cnt * sizeof (pw_t), device_param->pws_buf, 0, NULL, NULL);
if (CL_rc == -1) return -1;
}
@ -1756,8 +1754,28 @@ int run_copy (hashcat_ctx_t *hashcat_ctx, hc_device_param_t *device_param, const
{
if (user_options->length_limit_disable == true)
{
if (user_options->attack_mode == ATTACK_MODE_COMBI)
{
const int CL_rc = hc_clEnqueueWriteBuffer (hashcat_ctx, device_param->command_queue, device_param->d_pws_buf, CL_TRUE, 0, pws_cnt * sizeof (pw_t), device_param->pws_buf, 0, NULL, NULL);
if (CL_rc == -1) return -1;
}
else if (user_options->attack_mode == ATTACK_MODE_HYBRID1)
{
const int CL_rc = hc_clEnqueueWriteBuffer (hashcat_ctx, device_param->command_queue, device_param->d_pws_buf, CL_TRUE, 0, pws_cnt * sizeof (pw_t), device_param->pws_buf, 0, NULL, NULL);
if (CL_rc == -1) return -1;
}
else if (user_options->attack_mode == ATTACK_MODE_HYBRID2)
{
const u64 off = device_param->words_off;
device_param->kernel_params_mp_buf64[3] = off;
const int CL_rc = run_kernel_mp (hashcat_ctx, device_param, KERN_RUN_MP, pws_cnt);
if (CL_rc == -1) return -1;
}
}
else
{
@ -1815,9 +1833,7 @@ int run_copy (hashcat_ctx_t *hashcat_ctx, hc_device_param_t *device_param, const
}
}
int CL_rc;
CL_rc = hc_clEnqueueWriteBuffer (hashcat_ctx, device_param->command_queue, device_param->d_pws_buf, CL_TRUE, 0, pws_cnt * sizeof (pw_t), device_param->pws_buf, 0, NULL, NULL);
const int CL_rc = hc_clEnqueueWriteBuffer (hashcat_ctx, device_param->command_queue, device_param->d_pws_buf, CL_TRUE, 0, pws_cnt * sizeof (pw_t), device_param->pws_buf, 0, NULL, NULL);
if (CL_rc == -1) return -1;
}
@ -1828,9 +1844,7 @@ int run_copy (hashcat_ctx_t *hashcat_ctx, hc_device_param_t *device_param, const
device_param->kernel_params_mp_l_buf64[3] = off;
int CL_rc;
CL_rc = run_kernel_mp (hashcat_ctx, device_param, KERN_RUN_MP_L, pws_cnt);
const int CL_rc = run_kernel_mp (hashcat_ctx, device_param, KERN_RUN_MP_L, pws_cnt);
if (CL_rc == -1) return -1;
}
@ -1900,7 +1914,7 @@ int run_cracker (hashcat_ctx_t *hashcat_ctx, hc_device_param_t *device_param, co
FILE *combs_fp = device_param->combs_fp;
if (user_options->attack_mode == ATTACK_MODE_COMBI)
if ((user_options->attack_mode == ATTACK_MODE_COMBI) || ((user_options->length_limit_disable == true) && (user_options->attack_mode == ATTACK_MODE_HYBRID2)))
{
rewind (combs_fp);
}
@ -1954,9 +1968,19 @@ int run_cracker (hashcat_ctx_t *hashcat_ctx, hc_device_param_t *device_param, co
continue;
}
// initialize amplifiers
// initialize and copy amplifiers
if (user_options->attack_mode == ATTACK_MODE_COMBI)
if (user_options_extra->attack_kern == ATTACK_KERN_STRAIGHT)
{
const int CL_rc = hc_clEnqueueCopyBuffer (hashcat_ctx, device_param->command_queue, device_param->d_rules, device_param->d_rules_c, innerloop_pos * sizeof (kernel_rule_t), 0, innerloop_left * sizeof (kernel_rule_t), 0, NULL, NULL);
if (CL_rc == -1) return -1;
}
else if (user_options_extra->attack_kern == ATTACK_KERN_COMBI)
{
if (user_options->length_limit_disable == true)
{
if ((user_options->attack_mode == ATTACK_MODE_COMBI) || (user_options->attack_mode == ATTACK_MODE_HYBRID2))
{
char *line_buf = combinator_ctx->scratch_buf;
@ -2029,27 +2053,12 @@ int run_cracker (hashcat_ctx_t *hashcat_ctx, hc_device_param_t *device_param, co
for (u32 j = i; j < innerloop_left; j++)
{
device_param->combs_buf[j].i[0] = 0;
device_param->combs_buf[j].i[1] = 0;
device_param->combs_buf[j].i[2] = 0;
device_param->combs_buf[j].i[3] = 0;
device_param->combs_buf[j].i[4] = 0;
device_param->combs_buf[j].i[5] = 0;
device_param->combs_buf[j].i[6] = 0;
device_param->combs_buf[j].i[7] = 0;
device_param->combs_buf[j].pw_len = 0;
memset (&device_param->combs_buf[j], 0, sizeof (pw_t));
}
innerloop_left = i;
}
else if (user_options->attack_mode == ATTACK_MODE_BF)
{
u64 off = innerloop_pos;
device_param->kernel_params_mp_r_buf64[3] = off;
int CL_rc = run_kernel_mp (hashcat_ctx, device_param, KERN_RUN_MP_R, innerloop_left);
const int CL_rc = hc_clEnqueueWriteBuffer (hashcat_ctx, device_param->command_queue, device_param->d_combs_c, CL_TRUE, 0, innerloop_left * sizeof (pw_t), device_param->combs_buf, 0, NULL, NULL);
if (CL_rc == -1) return -1;
}
@ -2059,50 +2068,148 @@ int run_cracker (hashcat_ctx_t *hashcat_ctx, hc_device_param_t *device_param, co
device_param->kernel_params_mp_buf64[3] = off;
int CL_rc = run_kernel_mp (hashcat_ctx, device_param, KERN_RUN_MP, innerloop_left);
int CL_rc;
CL_rc = run_kernel_mp (hashcat_ctx, device_param, KERN_RUN_MP, innerloop_left);
if (CL_rc == -1) return -1;
CL_rc = hc_clEnqueueCopyBuffer (hashcat_ctx, device_param->command_queue, device_param->d_combs, device_param->d_combs_c, 0, 0, innerloop_left * sizeof (pw_t), 0, NULL, NULL);
if (CL_rc == -1) return -1;
}
else if (user_options->attack_mode == ATTACK_MODE_HYBRID2)
}
else
{
u64 off = innerloop_pos;
if (user_options->attack_mode == ATTACK_MODE_COMBI)
{
char *line_buf = combinator_ctx->scratch_buf;
device_param->kernel_params_mp_buf64[3] = off;
u32 i = 0;
while (i < innerloop_left)
{
if (feof (combs_fp)) break;
int CL_rc = run_kernel_mp (hashcat_ctx, device_param, KERN_RUN_MP, innerloop_left);
int line_len = fgetl (combs_fp, line_buf);
if (CL_rc == -1) return -1;
line_len = convert_from_hex (hashcat_ctx, line_buf, line_len);
if (line_len >= PW_MAX) continue;
char *line_buf_new = line_buf;
char rule_buf_out[BLOCK_SIZE];
if (run_rule_engine (user_options_extra->rule_len_r, user_options->rule_buf_r))
{
if (line_len >= BLOCK_SIZE) continue;
memset (rule_buf_out, 0, sizeof (rule_buf_out));
const int rule_len_out = _old_apply_rule (user_options->rule_buf_r, user_options_extra->rule_len_r, line_buf, line_len, rule_buf_out);
if (rule_len_out < 0)
{
status_ctx->words_progress_rejected[salt_pos] += pws_cnt;
continue;
}
// copy amplifiers
line_len = rule_len_out;
if (user_options->attack_mode == ATTACK_MODE_STRAIGHT)
line_buf_new = rule_buf_out;
}
line_len = MIN (line_len, PW_MAX - 1);
u8 *ptr = (u8 *) device_param->combs_buf[i].i;
memcpy (ptr, line_buf_new, line_len);
memset (ptr + line_len, 0, PW_MAX - line_len);
if (hashconfig->opts_type & OPTS_TYPE_PT_UPPER)
{
int CL_rc = hc_clEnqueueCopyBuffer (hashcat_ctx, device_param->command_queue, device_param->d_rules, device_param->d_rules_c, innerloop_pos * sizeof (kernel_rule_t), 0, innerloop_left * sizeof (kernel_rule_t), 0, NULL, NULL);
uppercase (ptr, line_len);
}
if (CL_rc == -1) return -1;
if (combinator_ctx->combs_mode == COMBINATOR_MODE_BASE_LEFT)
{
if (hashconfig->opts_type & OPTS_TYPE_PT_ADD80)
{
ptr[line_len] = 0x80;
}
else if (user_options->attack_mode == ATTACK_MODE_COMBI)
if (hashconfig->opts_type & OPTS_TYPE_PT_ADD01)
{
int CL_rc = hc_clEnqueueWriteBuffer (hashcat_ctx, device_param->command_queue, device_param->d_combs_c, CL_TRUE, 0, innerloop_left * sizeof (pw_t), device_param->combs_buf, 0, NULL, NULL);
ptr[line_len] = 0x01;
}
}
if (CL_rc == -1) return -1;
device_param->combs_buf[i].pw_len = line_len;
i++;
}
else if (user_options->attack_mode == ATTACK_MODE_BF)
for (u32 j = i; j < innerloop_left; j++)
{
int CL_rc = hc_clEnqueueCopyBuffer (hashcat_ctx, device_param->command_queue, device_param->d_bfs, device_param->d_bfs_c, 0, 0, innerloop_left * sizeof (bf_t), 0, NULL, NULL);
memset (&device_param->combs_buf[j], 0, sizeof (pw_t));
}
innerloop_left = i;
const int CL_rc = hc_clEnqueueWriteBuffer (hashcat_ctx, device_param->command_queue, device_param->d_combs_c, CL_TRUE, 0, innerloop_left * sizeof (pw_t), device_param->combs_buf, 0, NULL, NULL);
if (CL_rc == -1) return -1;
}
else if (user_options->attack_mode == ATTACK_MODE_HYBRID1)
{
int CL_rc = hc_clEnqueueCopyBuffer (hashcat_ctx, device_param->command_queue, device_param->d_combs, device_param->d_combs_c, 0, 0, innerloop_left * sizeof (pw_t), 0, NULL, NULL);
u64 off = innerloop_pos;
device_param->kernel_params_mp_buf64[3] = off;
int CL_rc;
CL_rc = run_kernel_mp (hashcat_ctx, device_param, KERN_RUN_MP, innerloop_left);
if (CL_rc == -1) return -1;
CL_rc = hc_clEnqueueCopyBuffer (hashcat_ctx, device_param->command_queue, device_param->d_combs, device_param->d_combs_c, 0, 0, innerloop_left * sizeof (pw_t), 0, NULL, NULL);
if (CL_rc == -1) return -1;
}
else if (user_options->attack_mode == ATTACK_MODE_HYBRID2)
{
int CL_rc = hc_clEnqueueCopyBuffer (hashcat_ctx, device_param->command_queue, device_param->d_combs, device_param->d_combs_c, 0, 0, innerloop_left * sizeof (pw_t), 0, NULL, NULL);
u64 off = innerloop_pos;
device_param->kernel_params_mp_buf64[3] = off;
int CL_rc;
CL_rc = run_kernel_mp (hashcat_ctx, device_param, KERN_RUN_MP, innerloop_left);
if (CL_rc == -1) return -1;
CL_rc = hc_clEnqueueCopyBuffer (hashcat_ctx, device_param->command_queue, device_param->d_combs, device_param->d_combs_c, 0, 0, innerloop_left * sizeof (pw_t), 0, NULL, NULL);
if (CL_rc == -1) return -1;
}
}
}
else if (user_options_extra->attack_kern == ATTACK_KERN_BF)
{
u64 off = innerloop_pos;
device_param->kernel_params_mp_r_buf64[3] = off;
int CL_rc;
CL_rc = run_kernel_mp (hashcat_ctx, device_param, KERN_RUN_MP_R, innerloop_left);
if (CL_rc == -1) return -1;
CL_rc = hc_clEnqueueCopyBuffer (hashcat_ctx, device_param->command_queue, device_param->d_bfs, device_param->d_bfs_c, 0, 0, innerloop_left * sizeof (bf_t), 0, NULL, NULL);
if (CL_rc == -1) return -1;
}
@ -4731,7 +4838,22 @@ int opencl_session_begin (hashcat_ctx_t *hashcat_ctx)
device_param->kernel_params_mp_buf32[7] = 0;
device_param->kernel_params_mp_buf32[8] = 0;
if (user_options->length_limit_disable == true)
{
if (user_options->attack_mode == ATTACK_MODE_HYBRID1)
{
device_param->kernel_params_mp[0] = &device_param->d_combs;
}
else
{
device_param->kernel_params_mp[0] = &device_param->d_pws_buf;
}
}
else
{
device_param->kernel_params_mp[0] = &device_param->d_combs;
}
device_param->kernel_params_mp[1] = &device_param->d_root_css_buf;
device_param->kernel_params_mp[2] = &device_param->d_markov_css_buf;
device_param->kernel_params_mp[3] = &device_param->kernel_params_mp_buf64[3];

@ -151,6 +151,34 @@ int build_plain (hashcat_ctx_t *hashcat_ctx, hc_device_param_t *device_param, pl
if (plain_len > (int) hashconfig->pw_max) plain_len = (int) hashconfig->pw_max;
}
else if (user_options->attack_mode == ATTACK_MODE_HYBRID2)
{
if (user_options->length_limit_disable == true)
{
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 (plain_len > (int) hashconfig->pw_max) plain_len = (int) hashconfig->pw_max;
}
else
{
pw_t pw;
@ -178,6 +206,7 @@ int build_plain (hashcat_ctx_t *hashcat_ctx, hc_device_param_t *device_param, pl
if (plain_len > (int) hashconfig->pw_max) plain_len = (int) hashconfig->pw_max;
}
}
if (user_options->attack_mode == ATTACK_MODE_BF)
{

@ -473,11 +473,20 @@ char *status_get_guess_base (const hashcat_ctx_t *hashcat_ctx)
return strdup (straight_ctx->dict);
}
else if (user_options->attack_mode == ATTACK_MODE_HYBRID2)
{
if (user_options->length_limit_disable == true)
{
const mask_ctx_t *mask_ctx = hashcat_ctx->mask_ctx;
return strdup (mask_ctx->mask);
}
else
{
const straight_ctx_t *straight_ctx = hashcat_ctx->straight_ctx;
return strdup (straight_ctx->dict);
}
}
return NULL;
}
@ -509,11 +518,20 @@ int status_get_guess_base_offset (const hashcat_ctx_t *hashcat_ctx)
return straight_ctx->dicts_pos + 1;
}
else if (user_options->attack_mode == ATTACK_MODE_HYBRID2)
{
if (user_options->length_limit_disable == true)
{
const mask_ctx_t *mask_ctx = hashcat_ctx->mask_ctx;
return mask_ctx->masks_pos + 1;
}
else
{
const straight_ctx_t *straight_ctx = hashcat_ctx->straight_ctx;
return straight_ctx->dicts_pos + 1;
}
}
return 0;
}
@ -545,11 +563,20 @@ int status_get_guess_base_count (const hashcat_ctx_t *hashcat_ctx)
return straight_ctx->dicts_cnt;
}
else if (user_options->attack_mode == ATTACK_MODE_HYBRID2)
{
if (user_options->length_limit_disable == true)
{
const mask_ctx_t *mask_ctx = hashcat_ctx->mask_ctx;
return mask_ctx->masks_cnt;
}
else
{
const straight_ctx_t *straight_ctx = hashcat_ctx->straight_ctx;
return straight_ctx->dicts_cnt;
}
}
return 0;
}
@ -596,11 +623,20 @@ char *status_get_guess_mod (const hashcat_ctx_t *hashcat_ctx)
return strdup (mask_ctx->mask);
}
else if (user_options->attack_mode == ATTACK_MODE_HYBRID2)
{
if (user_options->length_limit_disable == true)
{
const straight_ctx_t *straight_ctx = hashcat_ctx->straight_ctx;
return strdup (straight_ctx->dict);
}
else
{
const mask_ctx_t *mask_ctx = hashcat_ctx->mask_ctx;
return strdup (mask_ctx->mask);
}
}
return NULL;
}
@ -628,11 +664,20 @@ int status_get_guess_mod_offset (const hashcat_ctx_t *hashcat_ctx)
return mask_ctx->masks_pos + 1;
}
else if (user_options->attack_mode == ATTACK_MODE_HYBRID2)
{
if (user_options->length_limit_disable == true)
{
const straight_ctx_t *straight_ctx = hashcat_ctx->straight_ctx;
return straight_ctx->dicts_pos + 1;
}
else
{
const mask_ctx_t *mask_ctx = hashcat_ctx->mask_ctx;
return mask_ctx->masks_pos + 1;
}
}
return 0;
}
@ -660,11 +705,20 @@ int status_get_guess_mod_count (const hashcat_ctx_t *hashcat_ctx)
return mask_ctx->masks_cnt;
}
else if (user_options->attack_mode == ATTACK_MODE_HYBRID2)
{
if (user_options->length_limit_disable == true)
{
const straight_ctx_t *straight_ctx = hashcat_ctx->straight_ctx;
return straight_ctx->dicts_cnt;
}
else
{
const mask_ctx_t *mask_ctx = hashcat_ctx->mask_ctx;
return mask_ctx->masks_cnt;
}
}
return 0;
}

@ -888,6 +888,19 @@ void status_display (hashcat_ctx_t *hashcat_ctx)
case GUESS_MODE_HYBRID2:
if (user_options->length_limit_disable == true)
{
event_log_info (hashcat_ctx,
"Guess.Base.......: Mask (%s) [%d], Left Side",
hashcat_status->guess_base,
hashcat_status->guess_mask_length);
event_log_info (hashcat_ctx,
"Guess.Mod........: File (%s), Right Side",
hashcat_status->guess_mod);
}
else
{
event_log_info (hashcat_ctx,
"Guess.Base.......: File (%s), Right Side",
hashcat_status->guess_base);
@ -896,11 +909,29 @@ void status_display (hashcat_ctx_t *hashcat_ctx)
"Guess.Mod........: Mask (%s) [%d], Left Side",
hashcat_status->guess_mod,
hashcat_status->guess_mask_length);
}
break;
case GUESS_MODE_HYBRID2_CS:
if (user_options->length_limit_disable == true)
{
event_log_info (hashcat_ctx,
"Guess.Base.......: Mask (%s) [%d], Left Side",
hashcat_status->guess_base,
hashcat_status->guess_mask_length);
event_log_info (hashcat_ctx,
"Guess.Mod........: File (%s), Right Side",
hashcat_status->guess_mod);
event_log_info (hashcat_ctx,
"Guess.Charset....: %s",
hashcat_status->guess_charset);
}
else
{
event_log_info (hashcat_ctx,
"Guess.Base.......: File (%s), Right Side",
hashcat_status->guess_base);
@ -913,6 +944,7 @@ void status_display (hashcat_ctx_t *hashcat_ctx)
event_log_info (hashcat_ctx,
"Guess.Charset....: %s",
hashcat_status->guess_charset);
}
break;
}

@ -262,6 +262,7 @@ int count_words (hashcat_ctx_t *hashcat_ctx, FILE *fd, const char *dictfile, u64
{
combinator_ctx_t *combinator_ctx = hashcat_ctx->combinator_ctx;
straight_ctx_t *straight_ctx = hashcat_ctx->straight_ctx;
mask_ctx_t *mask_ctx = hashcat_ctx->mask_ctx;
user_options_extra_t *user_options_extra = hashcat_ctx->user_options_extra;
user_options_t *user_options = hashcat_ctx->user_options;
wl_data_t *wl_data = hashcat_ctx->wl_data;
@ -319,11 +320,20 @@ int count_words (hashcat_ctx_t *hashcat_ctx, FILE *fd, const char *dictfile, u64
keyspace *= straight_ctx->kernel_rules_cnt;
}
else if (user_options_extra->attack_kern == ATTACK_KERN_COMBI)
{
if ((user_options->length_limit_disable == true) && (user_options->attack_mode == ATTACK_MODE_HYBRID2))
{
if (overflow_check_u64_mul (keyspace, mask_ctx->bfs_cnt) == false) return -1;
keyspace *= mask_ctx->bfs_cnt;
}
else
{
if (overflow_check_u64_mul (keyspace, combinator_ctx->combs_cnt) == false) return -1;
keyspace *= combinator_ctx->combs_cnt;
}
}
cache_hit_t cache_hit;
@ -413,12 +423,21 @@ int count_words (hashcat_ctx_t *hashcat_ctx, FILE *fd, const char *dictfile, u64
cnt += straight_ctx->kernel_rules_cnt;
}
else if (user_options_extra->attack_kern == ATTACK_KERN_COMBI)
{
if ((user_options->length_limit_disable == true) && (user_options->attack_mode == ATTACK_MODE_HYBRID2))
{
if (overflow_check_u64_add (cnt, mask_ctx->bfs_cnt) == false) return -1;
cnt += mask_ctx->bfs_cnt;
}
else
{
if (overflow_check_u64_add (cnt, combinator_ctx->combs_cnt) == false) return -1;
cnt += combinator_ctx->combs_cnt;
}
}
}
time (&now);

Loading…
Cancel
Save