maskprocessor icon indicating copy to clipboard operation
maskprocessor copied to clipboard

Possible Bug - Conflict between Max Occurrence and Combinations Options

Open sigkill opened this issue 2 years ago • 4 comments

The newer build of maskprocessor requires you to set a value of at least two for max occurrence:

--occurrence-max must be set to at least 2

However, due to this option being required, our --combinations option is now broken:

mp64.bin -1 '?u?d' '?1?1?1?1?1?1?1?1?1?1?1?1' --combinations -r2 --occurrence-max can not be used with --combinations

This was not an issue in earlier versions of maskprocessor.

sigkill avatar Mar 09 '22 13:03 sigkill

Confirmed that the --occurrence-max works in prior commit cd717ca3f7d35fc759057d7ff8cd498acf4c6776 and 2d1a306c2aaf8a48ad35f62ff8c887d93300d45f

sigkill avatar Mar 09 '22 14:03 sigkill

git diff cd717ca3f7d35fc759057d7ff8cd498acf4c6776 master

diff --git a/src/mp.c b/src/mp.c
index 3363ce5..1906cb6 100644
--- a/src/mp.c
+++ b/src/mp.c
@@ -462,7 +462,7 @@ int main (int argc, char *argv[])
     return (-1);
   }

-  if (occur_max == 1)
+  if (occur_max <= 1)
   {
     fprintf (stderr, "--occurrence-max must be set to at least 2\n");

@@ -922,7 +922,7 @@ int main (int argc, char *argv[])

           int occur_cnt = occurs[(int) c];

-          if (occur_cnt >= occur_max) break;
+          if (occur_cnt > occur_max) break;
         }

         if (i < len) continue;

sigkill avatar Mar 09 '22 14:03 sigkill

Not just this. The options --start-at and --stop-at can also no longer be used. Furthermore this if statement is now unconditional and you can no longer have an unlimited amount of character occurrences (which was previously at occur_max==0) https://github.com/hashcat/maskprocessor/blob/d12feb12b4783aa10d25e1b07a0eac560bc12c15/src/mp.c#L915 This was introduced in https://github.com/hashcat/maskprocessor/commit/d12feb12b4783aa10d25e1b07a0eac560bc12c15 There is a simple fix and a pull request already exists (https://github.com/hashcat/maskprocessor/pull/25). This issue should be resolved when the pr gets merged.

Skydef avatar Jun 15 '22 15:06 Skydef

@jsteube confirmed - functionality degraded until this can be fixed.

roycewilliams avatar Jun 19 '22 19:06 roycewilliams