Skip to content

Instantly share code, notes, and snippets.

@Rurik
Created May 5, 2013 15:13
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save Rurik/5521081 to your computer and use it in GitHub Desktop.
Save Rurik/5521081 to your computer and use it in GitHub Desktop.
TrueCrypt password guesser for leet-speak passwords. Blog post here: http://ghettoforensics.blogspot.com/2013/05/31337-password-guessing.html
import os
import subprocess
tc_exe = "C:\\Program Files\\TrueCrypt\\truecrypt.exe"
tc_file = "E:\\test.tlc"
drive_letter = "P"
def leet_lookup(char):
list = {"a": ["a","A","@"],
"b": ["b", "B", "8"],
"c": ["c", "C", "<"],
"e": ["e", "E", "3"],
"i": ["i", "I", "1"],
"l": ["l", "L", "1"],
"o": ["o", "O", "0"],
"t": ["t", "T", "7"] }
try:
result = list[char.lower()]
except KeyError:
result = [char.lower(), char.upper()]
return result
list = []
# V o l l e y b a l l = 10 chars
for c1 in leet_lookup('v'):
for c2 in leet_lookup('o'):
for c3 in leet_lookup('l'):
for c4 in leet_lookup('l'):
for c5 in leet_lookup('e'):
for c6 in leet_lookup('y'):
for c7 in leet_lookup('b'):
for c8 in leet_lookup('a'):
for c9 in leet_lookup('l'):
for c10 in leet_lookup('l'):
list.append("%s%s%s%s%s%s%s%s%s%s" % (c1, c2, c3, c4, c5, c6, c7, c8, c9, c10))
print "%d passwords calculated. Now testing:" % len(list)
count = 0
for password in list:
count += 1
if not count % 10: print ".",
tc_cmdline = "%s %s /l %s /b /a /m ro /q /s /p %s" % (tc_exe, tc_file, drive_letter, password)
process = subprocess.Popen(tc_cmdline)
returncode = process.wait()
if not returncode:
close_cmdline = "%s /d /l %s /q /s" % (tc_exe, drive_letter)
process = subprocess.Popen(close_cmdline).wait()
print "\r\nPassword found: %s" % password
quit()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment