Truecrypt, a variety of bruteforcing options
A lot of people ask the question: How can I recover my truecrypt password? Others ask the question: How can I crack a truecrypt container? So out of curiousity I went on a little investigation to know what the current tools are to bruteforce a truecrypt container. So here is a small compilation of the methods I’ve found to bruteforce a truecrypt container.
First of all, if the user using truecrypt is security aware it will be IMPOSSIBLE(for the moment) to bruteforce the password/key of a truecrypt container. At least normal people will not be able to bruteforce 20+ character passwords or a 2KB random file used as keyfile. I say normal people because the (old article) USA secret service seems to be building it’s own bruteforcing botnet. According to this article:
Ultimately, the agency hopes to build the network out across all 22 federal agencies that comprise the Department of Homeland Security: It currently holds a license to deploy the network out to 100,000 systems
Pretty scary huh? Just to be a little more paranoid imagine the nsa joining them and well…I assume 8 characters passwords is a laugh for them on the other hand I also think that 20+ character passwords will be out of reach even for them. The article dates from 2006, so I imagine they have it working by now, for example in this article they state the following:
Months later, Aragon’s lawyer gave him some bad news. The Secret Service had cracked Butler’s crypto and knew more about the hacker than Aragon did -
We will just never know if the USA secret service used bruteforcing power to crack the crypto or if they abused possible crypto errors. For example truecrypt seems to suffer from a few glitches/errors/vulnerabilities like the ones mentioned here. I have no clue how true the vulnerabilities claims are and if they have been fixed in the meanwhile. So why is this relevant? Just to make sure that everyone who uses truecrypt or any other kind of encryption software uses passwords/pass phrases with more then 20 characters and not easily guessable. Also to make sure that everyone who uses cryptographic software to protect his/her privacy stays informed about possible vulnerabilities that their product could contain and update it or use a work around.
Let’s see the first product capable of bruteforcing truecrypt containers.
If you google around you will see that if I’m not mistaken they also have specialized hardware modules which will speed up the cracking part. It will cost you money but in the end if you manage to link up enough computer it will be worth it.
I imagine that most people asking questions on how to bruteforce truecrypt containers will not have or are not willing to spend the amount of money needed to get DNA up and running. So here is another solution.
The solution explained over here http://www.elitehackers.info/forums/showthread.php?t=11568&page=2 which actually explains two solutions:
- autoitscript
- java based application also availible here
The first one uses a third party application to speed up the manual process and actually uses the truecrypt program to bruteforce the container. Here is the script posted on the forum I linked, just in case the post gets removed someday.
dim $one, $two, $three, $four, $five, $six, $seven, $eight, $pw
dim $Array[94]
$Array[0]="a"
$Array[1]="b"
$Array[2]="c"
$Array[3]="d"
$Array[4]="e"
$Array[5]="f"
$Array[6]="g"
$Array[7]="h"
$Array[8]="i"
$Array[9]="j"
$Array[10]="k"
$Array[11]="l"
$Array[12]="m"
$Array[13]="n"
$Array[14]="o"
$Array[15]="p"
$Array[16]="q"
$Array[17]="r"
$Array[18]="s"
$Array[19]="t"
$Array[20]="u"
$Array[21]="v"
$Array[22]="w"
$Array[23]="x"
$Array[24]="y"
$Array[25]="z"
$Array[26]="A"
$Array[27]="B"
$Array[28]="C"
$Array[29]="D"
$Array[30]="E"
$Array[31]="F"
$Array[32]="G"
$Array[33]="H"
$Array[34]="I"
$Array[35]="J"
$Array[36]="K"
$Array[37]="L"
$Array[38]="M"
$Array[39]="N"
$Array[40]="O"
$Array[41]="P"
$Array[42]="Q"
$Array[43]="R"
$Array[44]="S"
$Array[45]="T"
$Array[46]="U"
$Array[47]="V"
$Array[48]="W"
$Array[49]="X"
$Array[50]="Y"
$Array[51]="Z"
$Array[52]="!"
$Array[53]="@"
$Array[54]="#"
$Array[55]="$"
$Array[56]="%"
$Array[57]="^"
$Array[58]="&"
$Array[59]="*"
$Array[60]="("
$Array[61]=")"
$Array[62]="_"
$Array[63]="+"
$Array[64]="~"
$Array[65]="`"
$Array[66]="1"
$Array[67]="2"
$Array[68]="3"
$Array[69]="4"
$Array[70]="5"
$Array[71]="6"
$Array[72]="7"
$Array[73]="8"
$Array[74]="9"
$Array[75]="0"
$Array[76]="-"
$Array[77]="="
$Array[78]="["
$Array[79]="]"
$Array[80]="\"
$Array[81]="{"
$Array[82]="}"
$Array[83]="|"
$Array[84]=";"
$Array[85]=":"
$Array[86]="'"
$Array[87]=""""
$Array[88]=","
$Array[89]="<"
$Array[90]="."
$Array[91]=">"
$Array[92]="/"
$Array[93]="?"
;Start brute Force
For $one = 0 to 93
$pw = $Array[$one]
Run(@COMSPEC & " /c " & 'C:\fubar\TrueCrypt.exe /q background /s /p "' & $pw & '" /e /m ro /m rm /v "c:\fubar\fubar.ENC"' )
Next
for $two = 0 to 93
for $one = 0 to 93
$pw = $Array[$one]
$pw &= $Array[$two]
Run(@COMSPEC & " /c " & 'C:\fubar\TrueCrypt.exe /q background /s /p "' & $pw & '" /e /m ro /m rm /v "c:\fubar\fubar.ENC"' )
Next
Next
for $three = 0 to 93
for $two = 0 to 93
for $one = 0 to 93
$pw = $Array[$one]
$pw &= $Array[$two]
$pw &= $Array[$three]
Run(@COMSPEC & " /c " & 'C:\fubar\TrueCrypt.exe /q background /s /p "' & $pw & '" /e /m ro /m rm /v "c:\fubar\fubar.ENC"' )
Next
Next
Next
for $four = 0 to 93
for $three = 0 to 93
for $two = 0 to 93
for $one = 0 to 93
$pw = $Array[$one]
$pw &= $Array[$two]
$pw &= $Array[$three]
$pw &= $Array[$four]
Run(@COMSPEC & " /c " & 'C:\fubar\TrueCrypt.exe /q background /s /p "' & $pw & '" /e /m ro /m rm /v "c:\fubar\fubar.ENC"' )
Next
Next
Next
Next
for $five = 0 to 93
for $four = 0 to 93
for $three = 0 to 93
for $two = 0 to 93
for $one = 0 to 93
$pw = $Array[$one]
$pw &= $Array[$two]
$pw &= $Array[$three]
$pw &= $Array[$four]
$pw &= $Array[$five]
Run(@COMSPEC & " /c " & 'C:\fubar\TrueCrypt.exe /q background /s /p "' & $pw & '" /e /m ro /m rm /v "c:\fubar\fubar.ENC"' )
Next
Next
Next
Next
Next
FOR $six = 0 to 93
for $five = 0 to 93
for $four = 0 to 93
for $three = 0 to 93
for $two = 0 to 93
for $one = 0 to 93
$pw = $Array[$one]
$pw &= $Array[$two]
$pw &= $Array[$three]
$pw &= $Array[$four]
$pw &= $Array[$five]
$pw &= $Array[$six]
Run(@COMSPEC & " /c " & 'C:\fubar\TrueCrypt.exe /q background /s /p "' & $pw & '" /e /m ro /m rm /v "c:\fubar\fubar.ENC"' )
Next
Next
Next
Next
Next
Next
for $seven = 0 to 93
FOR $six = 0 to 93
for $five = 0 to 93
for $four = 0 to 93
for $three = 0 to 93
for $two = 0 to 93
for $one = 0 to 93
$pw = $Array[$one]
$pw &= $Array[$two]
$pw &= $Array[$three]
$pw &= $Array[$four]
$pw &= $Array[$five]
$pw &= $Array[$six]
$pw &= $Array[$seven]
Run(@COMSPEC & " /c " & 'C:\fubar\TrueCrypt.exe /q background /s /p "' & $pw & '" /e /m ro /m rm /v "c:\fubar\fubar.ENC"' )
Next
Next
Next
Next
Next
Next
Next
for $eight = 0 to 93
for $seven = 0 to 93
FOR $six = 0 to 93
for $five = 0 to 93
for $four = 0 to 93
for $three = 0 to 93
for $two = 0 to 93
for $one = 0 to 93
$pw = $Array[$one]
$pw &= $Array[$two]
$pw &= $Array[$three]
$pw &= $Array[$four]
$pw &= $Array[$five]
$pw &= $Array[$six]
$pw &= $Array[$seven]
$pw &= $Array[$eight]
Run(@COMSPEC & " /c " & 'C:\fubar\TrueCrypt.exe /q background /s /p "' & $pw & '" /e /m ro /m rm /v "c:\fubar\fubar.ENC"' )
Next
Next
Next
Next
Next
Next
Next
Next
The second solution seems to be a java application coded for linux which also use the truecrypt program to bruteforce the container. Both solutions take time and are not easily expandable to so that the bruteforcing work could be speed up.
One of the last and imo most flexible solutions in my search for current truecrypt bruteforcers where the following articles and websites I found.
- http://blog.bjrn.se/2008/01/truecrypt-explained.html
- http://blog.bjrn.se/2008/02/truecrypt-explained-truecrypt-5-update.html
- http://www.rbgrn.net/blog/2007/09/how-to-write-a-brute-force-password-cracker.html
- http://www.cpushare.com/
All of the above are imo the essential building blocks to build a truecrypt bruteforce application or a truecrypt distributed bruteforce application. Just in case the sites go down you can download a zip with all the sources here, I still need to fix a http server for this kind of stuff so for the moment beeing rapidshare is the choice. The best part is that the code presented in the blog which explains truecrypt works!! Reason I’m so excited about that is because often enough when I download example/poc sourcecode it just doesn’t work and it needs minor changes. For the curious ones here is the output from a small test I run with the sourcecode on a truecrypt volume(I only tested the truecrypt5 source):
Progress: Is this a normal volume?
Progress: Trying SHA-512
Progress: …['Rijndael']
Progress: …['Serpent']
Progress: …['Twofish']
Progress: …['Twofish', 'Rijndael']
Progress: …['Serpent', 'Twofish', 'Rijndael']
Progress: …['Rijndael', 'Serpent']
Progress: …['Rijndael', 'Twofish', 'Serpent']
Progress: …['Serpent', 'Twofish']
Progress: Trying RIPEMD-160
Progress: …['Rijndael']
Progress: …['Serpent']
Progress: …['Twofish']
Progress: …['Twofish', 'Rijndael']
Progress: …['Serpent', 'Twofish', 'Rijndael']
Progress: …['Rijndael', 'Serpent']
Progress: …['Rijndael', 'Twofish', 'Serpent']
Progress: …['Serpent', 'Twofish']
Progress: Trying Whirlpool
Progress: …['Rijndael']
Progress: …['Serpent']
Progress: …['Twofish']
Progress: …['Twofish', 'Rijndael']
Progress: …['Serpent', 'Twofish', 'Rijndael']
Progress: …['Rijndael', 'Serpent']
Progress: …['Rijndael', 'Twofish', 'Serpent']
Progress: Success!
Some of you might argue that using a scripting language for a bruteforcing purpose is just plain stupid. I’d have to agree with that. So that’s why the last option is to write your own bruteforcer in C or asm or modify the truecrypt sourcecode. But for the ones in need of a quick client to recover their password the above solutions should work just fine, assuming you still remember certain parts of the password and thereby reducing the keyspace from millions to like a few thousand options.
If anyone has found more nice tools or sourcecodes or has got nice ideas please share, it’s always fun to learn about new things.
March 13, 2009 at 4:25 pm
I wonder what sort of damage could be done if someone malicious were able to gain access to a machine on a federal botnet?
I can see it now… “Hacker gains access to secret service botnet, uses botnet to brute force password dumps from top secret NSA computer systems.”
April 11, 2009 at 6:35 pm
I have truecrypt and I was using it a while back to store some data. I haven’t used it in a while and was wondering, I know the password, at least all the characters, and I still have the keyfile I used, but is there a quicker way to get back to my files? I feel silly that I forgot how I wrote my password, but I need some help.
April 13, 2009 at 9:12 pm
Well afaik bruteforcing the password is the only method. You could try out a few of the methods I mentioned. Seeing as you know the characters it should be doable depending on the length of your password. Good luck with the bruteforce approach.
April 29, 2009 at 8:21 pm
diablohorn, The link to TC brute building blocks ziparchiv is dead. Can you please renew it.
Would be very appreciate.
May 3, 2009 at 5:02 pm
The link has been renewed
May 19, 2009 at 11:07 am
eh. really like it
May 23, 2009 at 7:20 am
When it comes to random passwords, in my opinion the whole rule of 20+ characters is quite the myth. For example: if you use a 10 character random password comprised of letters and digits (and the attacker knows you didn’t use anything else!), you might have to try up to 62^10 = 839,299,365,868,340,224 passwords. At 500,000 passwords per second (an extraordinary rate when it comes to decrypting AES containers) this would take more than 53,228 years. At 15 characters we exceed 48,763,933,596,446 years. Good look with optimization, maybe you manage to crack password one billion times faster than estimated here – it just wouldn’t make any differende whatsoever (at least in the second example)
Seriously now, with a good password it is much simpler to attack the crytographic key itself instead of the password. Fortunatlely it might still take several centuries. The trick is to avoid any password vulnerable to a dictionary attack (like “house”), even if it’s a modified attack (like “myhouse” or “house05″).
May 31, 2009 at 6:47 pm
Great article for those who know something about programming. But for someone who is very limited in programming experience (Ok practically none except for some VBA in MS Excel), is still a bit complex for trying to modify program for my personal situation. Like so many other people, I know the approx length of PW and have a list of the possible missing phrases and characters but have yet to be able to understand how to get one of these ‘codes’ to work.
June 10, 2009 at 6:00 pm
I’m in the same boat. I know it’s 9 char password, and I know the 11 possible chars that I used, but the precise combination is lost to me.
Any help for a newb?
June 12, 2009 at 7:19 pm
All i can say is good luck bruteforcing it. You will spend years brute forcing it with a regular home based pc, even if you knew most of the password.
June 19, 2009 at 10:06 pm
@dezrah there are scripts out there to help build dictionaries for brute forcing. You could modify one of these to only use the 11 letters, and generate all possible 9 character combinations. This would make things much faster. If you know you could have only used each letter at most say 3 times, you can reduce the number of possibilities further.