0

I'm trying to generate a wordlist, but I need some help with it. Let's say I execute the command:

crunch 1 1 -p cat dog cow

Crunch will generate the following:

catcowdog
catdogcow
cowcatdog
cowdogcat
dogcatcow
dogcowcat

But I also need permutation with 1 and 2 words, so I also need these ones:

dog
cat
cow
dogcat
dogcow
catdog
catcow
cowdog
cowcat

Is there a way to do this?

2
  • 1
    No idea what crunch is but itertools in python would make quick work of this docs.python.org/2/library/itertools.html#itertools.permutations Apr 12, 2018 at 11:41
  • 1
    @Goose I don't think there is an explicit policy, but in general, the more specific to security the tool is, the more on topic it becomes. I^d say crunch questions are on topic, but that is just my two cents.
    – Anders
    Apr 29, 2018 at 10:45

2 Answers 2

0

The man page will tell you if it is possible and it states that it is not. It even shows you an example of what it outputs.

You will need to write a script to do what you want.

0

If you look at the link to the man page in @schroeder's answer you will see example 3:

Example 3
crunch 1 6 abcdefg\ 

There is a space at the end of the character string.
In order for crunch to use the space you will need to escape it using the \ character.
In this example you could also put quotes around the letters and not need the \, i.e. "abcdefg ".
Crunch will display a wordlist using the character set abcdefg that starts at a and ends at (6 spaces) 

Using this method you will get a wordlist with some spaces in it. You can then use tr to strip out any spaces in the resulting text file:

cat file.txt | tr -d "[:space:]"

I believe this will give you what you are after.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .