I want to recover a long password with hashcat. The password contains a phrase and between the words are special character sequences. These sequences are limited (< 4) and unknown. But the set of characters to pick from is known and small (< 6).

Example Phrase: Barbara walks the dog
Special Characters: $%-"
Possible Password: Barbara%walks$$%the$dog

I tried to generate all the passwords with regex but that file grew too big. How do I achieve this with hashcat e.g. their rule system?

  • Why not produce a wordlist based on these characteristics in a language of your choice? – Arminius Mar 15 '18 at 13:09
  • That would still produce too large of a file, no? I think OP wants to know how to do this in memory. – Monica Apologists Get Out Mar 15 '18 at 13:12
  • Exactly. It quickly grew to a couple of gigabytes so I figured another approach will be better. – TomTom Mar 15 '18 at 13:15
  • Is the phrase known? – Anders Mar 15 '18 at 15:08

Mask attack seems to be a good solution.

Generate a .hcmask file with the following lines:


And so on, where each line is has differences places for the special characters (?1).

Since you know the phrase, and because the set of characters is small, the total number of lines should be very low.

  • I already tried to generate all the passwords but it looked like that file was going to be very big. Is there a way to generate them in memory while cracking? Or is it easier to just work with a really big file? – TomTom Mar 15 '18 at 13:24
  • It's not about generating passwords, but generating masks. ?1 means "any of the characters at the begining of the line", which should greatly decrease the size of the file. – Benoit Esnard Mar 15 '18 at 13:27

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.