Last active
October 16, 2017 08:19
-
-
Save narbehaj/607940c6fa61a8f455c9d68074037667 to your computer and use it in GitHub Desktop.
Simple Python Bruteforce
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from hashlib import md5 | |
import random | |
from itertools import chain, product | |
def bruteforce(charset, maxlength): | |
return (''.join(candidate) | |
for candidate in chain.from_iterable(product(charset, repeat=i) | |
for i in range(2, maxlength + 1))) | |
m = md5() | |
with open('md5.txt', 'w') as file_: | |
for i in bruteforce('abcdefghijklmnopqrstuvwxyz_0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ*!@#$%^&()-=][}{;/.,', 10): | |
m.update(str(i).encode('utf-8')) | |
file_.writelines('{}\t{}\n'.format(m.hexdigest(), i)) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment