Skip to content

Instantly share code, notes, and snippets.

What would you like to do?
KeePassX bruteforcer, passwords generated from a few known base words and a few suffixes added at the end
from pykeepass import PyKeePass
import sys
import itertools
#db file
f = 'db.kdbx'
#pwd bases
base = [
#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:
db = PyKeePass(f, password=p)
print "Valid password found for %s : %s" % (f,p)
found = 1
if found == 1:
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.