Skip to content

Instantly share code, notes, and snippets.

@tylerkerr
Created April 11, 2015 20:55
Show Gist options
  • Save tylerkerr/dc33b0608c626c4f32f9 to your computer and use it in GitHub Desktop.
Save tylerkerr/dc33b0608c626c4f32f9 to your computer and use it in GitHub Desktop.
#!/usr/bin/env python
import sys, os
from passlib.hash import bcrypt
f = open('commonpasswords.txt', 'r')
pws = f.readlines()
f.close()
f = open('dbmini.txt', 'r')
users = [{ 'name' : uline[1], 'hash': uline[2]} for uline in [line.rstrip('\n').split('\t', 2) for line in f.readlines()]]
f.close()
for u in users:
count = 0
for pw in pws:
if count % 100 == 0:
print("mini: %s: %s" %(u['name'], count))
if bcrypt.verify(pw, u['hash']):
print("Good!!!\n user: %s pass: %s" %(u['name'], pw))
raise Exception()
count += 1
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment