Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
KeePassX bruteforcer, passwords generated from a few known base words and a few suffixes added at the end
#!/usr/bin/python
from pykeepass import PyKeePass
import sys
import itertools
#db file
f = 'db.kdbx'
#pwd bases
base = [
'base1',
'base2',
'base3',
]
#suffix characters
chars = [ '!', '@', '3', '4', ]
suf = []
#generate suffixes up to 4 characters long
for i in [1, 2, 3, 4]:
suf_cur = [''.join(i) for i in itertools.product(chars, repeat = i)]
suf = suf + suf_cur
pwds = []
for b in base:
for s in suf:
pwds.append(b + s)
found = 0
for p in pwds:
try:
db = PyKeePass(f, password=p)
print "Valid password found for %s : %s" % (f,p)
found = 1
except:
if found == 1:
sys.exit(0)
print p
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.