Allow words of length > 32 in wordlists for -a 0 for slow hashes if no rules are in use or a : rule is in the rulefile

This commit is contained in:
jsteube
2016-09-14 17:40:39 +02:00
parent bc75ba70a1
commit 30371bef10
2 changed files with 64 additions and 11 deletions
+42 -11
View File
@@ -3683,17 +3683,6 @@ int main (int argc, char **argv)
uint pw_min = hashconfig_general_pw_min (hashconfig);
uint pw_max = hashconfig_general_pw_max (hashconfig);
if (hashconfig->attack_exec == ATTACK_EXEC_INSIDE_KERNEL)
{
switch (attack_kern)
{
case ATTACK_KERN_STRAIGHT: if (pw_max > PW_DICTMAX) pw_max = PW_DICTMAX1;
break;
case ATTACK_KERN_COMBI: if (pw_max > PW_DICTMAX) pw_max = PW_DICTMAX1;
break;
}
}
/**
* charsets : keep them together for more easy maintainnce
*/
@@ -4988,6 +4977,48 @@ int main (int argc, char **argv)
return -1;
}
/**
* If we have a NOOP rule then we can process words from wordlists > length 32 for slow hashes
*/
int has_noop = 0;
for (uint kernel_rules_pos = 0; kernel_rules_pos < kernel_rules_cnt; kernel_rules_pos++)
{
if (kernel_rules_buf[kernel_rules_pos].cmds[0] != RULE_OP_MANGLE_NOOP) continue;
if (kernel_rules_buf[kernel_rules_pos].cmds[1] != 0) continue;
has_noop = 1;
}
if (has_noop == 0)
{
switch (attack_kern)
{
case ATTACK_KERN_STRAIGHT: if (pw_max > PW_DICTMAX) pw_max = PW_DICTMAX1;
break;
case ATTACK_KERN_COMBI: if (pw_max > PW_DICTMAX) pw_max = PW_DICTMAX1;
break;
}
}
else
{
if (hashconfig->attack_exec == ATTACK_EXEC_INSIDE_KERNEL)
{
switch (attack_kern)
{
case ATTACK_KERN_STRAIGHT: if (pw_max > PW_DICTMAX) pw_max = PW_DICTMAX1;
break;
case ATTACK_KERN_COMBI: if (pw_max > PW_DICTMAX) pw_max = PW_DICTMAX1;
break;
}
}
else
{
// in this case we can process > 32
}
}
/**
* OpenCL platforms: detect
*/