Skip to content

Instantly share code, notes, and snippets.

@ericjster
Last active April 20, 2023 03:27
Show Gist options
  • Save ericjster/619d65e6ec011bc47f844aa6a331acdd to your computer and use it in GitHub Desktop.
Save ericjster/619d65e6ec011bc47f844aa6a331acdd to your computer and use it in GitHub Desktop.
keepass python
import pykeepass # pip install pykeepass
import construct
prefixes = [
"abc",
"def",
]
mids = [
"1",
"2",
"3",
]
postfixes = [
"x",
"y",
]
f = "test.kdbx"
for prefix in prefixes:
for mid in mids:
for postfix in postfixes:
pwd = f"{prefix}{mid}{postfix}"
print(pwd, end=' ', flush=True)
try:
kp = pykeepass.PyKeePass(f, password=pwd)
print(f"***** SUCCESS: {pwd}")
except construct.core.ChecksumError:
pass
except pykeepass.exceptions.CredentialsError:
pass
print()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment