1

I'm sure these questions pop up a lot, but I can't find one that does what I'm looking for. So, I'm trying to use crunch to generate a wordlist with specific amounts of each type of character, i.e. 2 numbers, 1 symbol, 3 uppercase, 1 lowercase, etc. There are is -d, which seems to do what I cant, but it's for consecutive duplicates, which is not what I want. The characters can be anywhere in the string, but there must be at least the specified amount of each type. Is this possible?

Seth Painter
  • 143
  • 1
  • 5
  • 2
    I haven't seen what you are asking for. What I have done previously is generate large wordlists and then parse using regular expressions for whatever outcome I needed. – Rory Alsop Apr 07 '19 at 11:39

1 Answers1

1

There's no way to do this with Crunch that I'm aware of.

The only way I know of to do this is the generate all masks that conform to the composition rules using the policygen tool from the PACK toolkit, as described in my answer here.

In your case, it would be something like:

$ policygen --minlength=8 --maxlength=12 \
  --mindigit=2 --minlower=1 --minupper=3 --minspecial=1 -o test1.masks

You'll have to adjust the minimum and maximum password length accordingly. The number of masks can go up rapidly with the maximum length, so adjust carefully.

Royce Williams
  • 9,128
  • 1
  • 31
  • 55