glv2 / bruteforce-luks

Try to find the password of a LUKS encrypted volume.
GNU General Public License v3.0
238 stars 34 forks source link

How to pre-define a known middle-string of character spaces? #15

Closed LRonHubs closed 7 years ago

LRonHubs commented 7 years ago

I have a password like this, where "T" is a character I am sure about and "?" is an unknown character.

TTTTTT???TTTT?????

What would be the easiest way to modify the code such that I can swap in certain strings of known characters? I.e., Can the 4 Ts in the middle can be hard-coded somewhere, or better yet passed in as a parameter?

If you can think of a one-liner off the top of your head, even if it's just modifying the .c file, that would be great and likely very useful to others, because allocating memory in C is like a nightmare to my generation of coders, but would probably take like 30 seconds for someone else to describe. Even if it were just for one possible middle string, someone else would likely be able to extend this use case for more than one middle string using the code provided.

Something like:

for(0:possiblePasswords):
     if(idx > 5 && idx < 9){
          appendToPassword(knownMiddleString[idx-5]);
           continue;
      }else{
            doMemoryStuff();
            randomGuess();
      }
LRonHubs commented 7 years ago

I got around this by creating a series of dictionary files.