-2

I'm new to crunch and I want to generate a specific wordlist but I need the appropriate code for it. Let's take 478, 1990, gmgm and first. I want all the combinations of these two numbers and two words without changing the order of their characters. I know that I need to use -p, but I want upper and lower case to be considered too. How can I do that? For example:

4781990gmgmfirst
4781990Gmgmfirst
4781990gmgMfiRst
gmgm478firsT1990
FIRST1990MGmt478
...

Also can I make crunch generate all the combinations for any two of them, then any three of them then, and finally all of them? For example:

4781990
1990478
1990first478
gmgm1990478
firstgmgm1990478
...
Anders
  • 64,406
  • 24
  • 178
  • 215
john
  • 1
  • 1

1 Answers1

1

I'm unsure if crunch is capable of that. Why don't you want to use a scripting language?

Here is a Python solution:

from itertools import product, permutations


words = ['478', '1990', 'gmgm', 'first']

cases = []
for word in words:
    pr = product(*zip(word, word.upper()))
    cases += [set(map(''.join, pr))]

for perm in permutations(cases):
    for prod in product(*perm):
        print(''.join(prod))
Arminius
  • 43,922
  • 13
  • 140
  • 136