Skip to content

Instantly share code, notes, and snippets.

@hc0d3r
Last active September 17, 2021 20:36
Show Gist options
  • Save hc0d3r/6045071 to your computer and use it in GitHub Desktop.
Save hc0d3r/6045071 to your computer and use it in GitHub Desktop.
Gerador de Wordlist
#!/usr/bin/env python
# -*- coding: UTF-8 -*-
from getopt import getopt
from itertools import product
from sys import argv,exit
def banner():
print '''[*] Gerador de wordlist | feito por MMxM
Opçoes: 
-c <caracteres que serao usados>
-m <minimo de caracteres>
-x <maximo de caracteres>
-o <arquivo de saida>
Exemplo:
%s -c abcdefghijklmnopqrstuvwxyz -m 1 -x 5 -o /tmp/minha-wordlist.txt
'''%argv[0]
try:
min = 0
max = 0
file = None
caracteres = None
opts,args = getopt(argv[1:],"m: x: o: c:")
for opt, a in opts:
if opt == "-m": min = a
if opt == "-x": max = a
if opt == "-o": file = a
if opt == "-c": caracteres = a
if min > max: banner();exit(1)
if caracteres == None: banner();exit(1)
if file == None: banner();exit(1)
arq = open(file,"w")
caracteres = list(str(caracteres))
print '\n[*] Gerando wordlist ...\n'
for n in range(int(min),int(max)+1):
for w in product(caracteres,repeat=n):
word = ''.join(w)
arq.write("%s\n"%word)
print '[+] Wordlist gerada !!!\n[+] Arquivo => %s\n'%file
arq.close()
except:
exit(1)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment