Advertisement
cyborgs_txt

md5_random_bruteforcer.py

Oct 30th, 2014
333
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 3.34 KB | None | 0 0
  1. """made by cyborgs.txt
  2.   26.10.2014(updated later)
  3.   python 2.7
  4.   description:random bruteforcer
  5.   long passwords that are made of random characters(let's say: "3a7\@ssdm4%)ScfgdsgzfdR/DDSiaf")
  6.   are often impossible to crack in reasonable amount of time
  7.   so I made this random bruteforcer that tries random combinations
  8.   and compares it with value of the hash.
  9.   ADVICE:use this as your last option AFTER you try searching
  10.   online databases,wordlist attack,and bruteforce up to 8
  11.   characters.
  12.   IMPORTANT:WHAT EVER YOU DO WITH THIS IS YOUR OWN RESPONSIBILITY(I know I'm boring with that but I want to
  13.   be sure that if you do something illegal it's NOT my fault)
  14.   NOTE:I think I'll update this,maybe add some support for other algorithams
  15.   I used range of characters from ascii table in range 32(space) to 126(~) however you can change it by changing values
  16.   at line i putted comment on.Alternatievly you can change code and use list of characters remember that for some
  17.   characters you'll need to put escape characters(like:' or " character)
  18.   STOP SCRIPT AND MAKE WORDLIST WITH CTRL+C
  19.  
  20.  
  21.   """
  22. import hashlib
  23. import random
  24. def hashCracker():
  25.     yourHash=raw_input("Enter your hash here:")
  26.     minimum=raw_input("Minimum lenght of password:")
  27.     maximum=raw_input("Maximum length of password:")
  28.     minimum=int(minimum)
  29.     maximum=int(maximum)
  30.    
  31.     hashLen=len(yourHash)
  32.    
  33.     if hashLen !=32:
  34.         print "error: your hash is invalid please submit valid MD5 hash"
  35.         hashCracker()
  36.     try:
  37.         checkHash=int(yourHash,16)
  38.  
  39.     except ValueError:
  40.         print "error: your hash is invalid please submit valid MD5 hash"
  41.         hashCracker()
  42.    
  43.        
  44.        
  45.    
  46.     yourHash=yourHash.lower()
  47.    
  48.     password=""
  49.     listOfTriedPasswords=[]#append tried passwords here
  50.     loop=True
  51.     subloop=True
  52.     passwordsTried=0
  53.     try:
  54.         while loop:
  55.             while subloop:
  56.            
  57.            
  58.                passLenght=random.randint(minimum,maximum)
  59.                for i in range(passLenght):
  60.                    x=random.randint(97,122) #change this values to change charset(characters) used just look at ascii-table and change it
  61.                    password+=chr(x)
  62.                break
  63.            
  64.        
  65.         #check if password is already tried if yes try again
  66.             checkPassword=password in listOfTriedPasswords
  67.             if checkPassword==False:  
  68.                 hashedPassword=hashlib.md5(password.encode())
  69.                 if yourHash==hashedPassword.hexdigest():
  70.                    print "hash cracked password is: "
  71.                    print password
  72.                    break
  73.                 print "not cracked yet" #you may remove this
  74.            
  75.                 print "current password:",password#,this
  76.                 listOfTriedPasswords.append(password)
  77.                 ListLen=len(listOfTriedPasswords)
  78.                 strListLen=str(ListLen)
  79.                 print "currently tried",strListLen
  80.                 password=""
  81.            
  82.              
  83.            
  84.            
  85.        
  86.          
  87.     except KeyboardInterrupt:
  88.         wordlist=open("wordlist.txt","w")
  89.         for i in listOfTriedPasswords:
  90.             wordlist.write(i)
  91.             wordlist.write("\n")
  92.            
  93.    
  94.        
  95.            
  96. hashCracker()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement