Skip to content

Instantly share code, notes, and snippets.

@lowk3v
Created November 24, 2018 08:33
Show Gist options
  • Save lowk3v/a7e5f0c753c7dab5210a6725693e7844 to your computer and use it in GitHub Desktop.
Save lowk3v/a7e5f0c753c7dab5210a6725693e7844 to your computer and use it in GitHub Desktop.
create dictionary for bruteforce in python
from itertools import chain, product
import string
def dict_all_size(charset, minlength, maxlength):
return (''.join(candidate)
for candidate in chain.from_iterable(product(charset, repeat=i)
for i in range(minlength, maxlength + 1)))
print([i for i in dict_all_size(string.hexdigits[:16], 2, 2)])
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment