#coding: utf-8
from colorama import init, Fore, Back, Style
import hashlib
import string
from urllib.request import urlopen
# )\ ) )\ )\()) ) ( /(
# (((_) ( /( ((_) ( ((_)\ ( /( ( )\())
# )\___ )(_)) _ )\ _((_) )(_)) )\ ((_)\
#((/ __|((_)_ | | ((_) | || |((_)_ ((_)| |(_)
# | (__ / _` || |/ _| | __ |/ _` |(_-<| ' \
# \___|\__,_||_|\__| |_||_|\__,_|/__/|_||_|
#81dc9bdb52d04dc20036dbd8313ed055
init()#iniciar el colorama
def art_ascii():
print(Fore.BLUE+"#-"*50+"#")
print(Fore.YELLOW+" )\ ) )\ )\()) ) ( /( ")
print(" (((_) ( /( ((_) ( ((_)\ ( /( ( )\()) ")
print(" )\___ )(_)) _ )\ _((_) )(_)) )\ ((_)\ ")
print("((/ __|((_)_ | | ((_) | || |((_)_ ((_)| |(_) ")
print(Fore.RED+"((/ __|((_)_ | | ((_) | || |((_)_ ((_)| |(_) ")
print(" | (__ / _` || |/ _| | __ |/ _` |(_-<| ' \ ")
print(" \___|\__,_||_|\__| |_||_|\__,_|/__/|_||_| ")
print(Fore.WHITE+"---| "+Fore.GREEN+".$$."+Fore.WHITE+"Bad4m_cod3"+Fore.GREEN+".$$."+Fore.WHITE+"|---")
print(Fore.MAGENTA+"\"a28ed83f69647d8f2a1046b9fa0e7c2c\""+Fore.GREEN+" H.P.Lovecraft")
print(Fore.BLUE+"#-"*50+"#"+Fore.WHITE)
def consol_prin(strdata):
print(Fore.BLUE+"--["+Fore.WHITE+"+"+Fore.BLUE+"]:"+Fore.WHITE+strdata)
def consol_input():
return str(input(Fore.BLUE+"--["+Fore.GREEN+"$.input.$"+Fore.BLUE+"]:"+Fore.WHITE))
def consol_error(errtext):
print(Fore.WHITE+"--["+Fore.RED+"Error!!"+Fore.WHITE+"]"+Fore.RED+":: "+errtext+Fore.WHITE)
def hash_text(strdata,typee):
if typee==0:
hashtxt = hashlib.md5(strdata).hexdigest()
elif typee==1:
hashtxt = hashlib.sha256(strdata).hexdigest()
elif typee==2:
hashtxt = hashlib.sha512(strdata).hexdigest()
else:
raise ValueError("Invalid Type Hash")
return hashtxt
def ishash(strhash,typee):
if all(inxx in string.hexdigits for inxx in strhash):
if typee==0:#md5
return len(strhash)==32
elif typpe==1:#sha256
return len(strhash)==64
elif typee==2:#sha512
return len(strhash)==128
else:
raise ValueError("Invalid Type Hash")
else:
return False
def return_case_hash(tphsh):
if tphsh=="md5": return 0
elif tphsh=="sha256": return 1
elif tphsh=="sha512": return 2
else: return 99
def download_url(link):
return urlopen(link).read()
def main():
art_ascii()
global tp_hash
global hash_to_crack
consol_prin("Crackeadora de hashes")
while True:
consol_prin("Seleccione el tipo de hash {md5,sha256,sha512}")
tipehash = consol_input()
tp_hash = return_case_hash(tipehash)
if tp_hash == 99:
consol_error("Tipo de Hash invalido")
else:
break
consol_prin("Tipo de hash selecionado [{}]".format(tipehash))
while True:
consol_prin("Introduzca el HASH tipo {} que desea Crackear".format((tipehash)))
hash_to_crack = consol_input()
if ishash(hash_to_crack,tp_hash):
consol_prin("Iniciando Cracking de HASH: {} ...".format(hash_to_crack))
break
else:
consol_error("Hash {} invalida".format(hash_to_crack))
consol_prin("Descangando Diccionario")
dicc = download_url("https://raw.githubusercontent.com/danielmiessler/SecLists/master/Passwords/Common-Credentials/10-million-password-list-top-1000000.txt")
consol_prin("Diccionario descargado")
consol_prin("Iniciando Ataque de diccionario "+Fore.RED+"[ATTACK INI]::::"+Fore.WHITE)
for inxx in dicc.split("\n".encode('utf-8')):
z = hash_text(inxx,tp_hash)
consol_prin("HASH:: {} texto plano:: {}".format(z,inxx))
if z == hash_to_crack:
consol_prin("Password: {} HASH: {}".format(inxx,z))
break
main()