Skip to content

Instantly share code, notes, and snippets.

@GanbaruTobi
Created January 3, 2020 12:22
Show Gist options
  • Save GanbaruTobi/af962e3018c20148307286ecc9588254 to your computer and use it in GitHub Desktop.
Save GanbaruTobi/af962e3018c20148307286ecc9588254 to your computer and use it in GitHub Desktop.
keepass unsupported versions bruteforce
#!/usr/bin/env python3
import pexpect
import threading
import time
class bruteThread (threading.Thread):
def __init__(self, password):
threading.Thread.__init__(self)
self.password = password
def run(self):
p = pexpect.spawn('/bin/bash -c "keepassxc-cli open test.kdbx"')
p.expect("Enter password to unlock")
p.sendline(self.password)
p.timeout = 2
try:
p.expect("Error while")
p.close()
except :
print(self.password + " is correct")
with open('Passwords.txt') as passwords:
for password in passwords:
thread = bruteThread(password)
thread.start()
time.sleep(0.1)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment