Navigation Menu

Skip to content

Instantly share code, notes, and snippets.

@burner1024
Created February 4, 2018 05:59
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save burner1024/99d0ee19d170268430902a3a5a4fc4bb to your computer and use it in GitHub Desktop.
Save burner1024/99d0ee19d170268430902a3a5a4fc4bb to your computer and use it in GitHub Desktop.
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