Skip to content

Instantly share code, notes, and snippets.

@GanbaruTobi
Last active January 3, 2020 12:22
Show Gist options
  • Save GanbaruTobi/87bd96e7810859cbba685744363fa322 to your computer and use it in GitHub Desktop.
Save GanbaruTobi/87bd96e7810859cbba685744363fa322 to your computer and use it in GitHub Desktop.
keepass unsupported version slow bruteforce
#!/usr/bin/env python3
import pexpect
with open('Passwords.txt') as passwords:
for password in passwords:
p = pexpect.spawn('/bin/bash -c "keepassxc-cli open test.kdbx"')
p.expect("Enter password to unlock")
p.sendline(password)
p.timeout = 2
try:
p.expect("Error while")
p.close()
except :
print(password + " is correct")
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment