Public paste
fg
By: s | Date: Dec 19 2007 18:04 | Format: None | Expires: never | Size: 1.14 KB | Hits: 790

  1. # MD0A Crack
  2. # Cracks MD5 Hashes
  3. # using wordlists
  4. # has the option to use
  5. # salts.
  6. # Created By: [fazed]
  7. import md5
  8.  
  9. class md5_salt():
  10.   def new(self, salt, hash, user):
  11.     global xsalt
  12.     global xhash
  13.     global xuser
  14.     xsalt = salt
  15.     xhash = hash
  16.     xuser = user
  17.   def crack(self, wordlist):
  18.     fh = open(wordlist, 'r')
  19.     list = fh.read()
  20.     fh.close()
  21.     list.split('n')
  22.     x = len(list)
  23.     i = 0
  24.     while i < x:
  25.       m = md5.new()
  26.       m.update(xuser + list[i] + xsalt)
  27.       h = m.hexdigest()
  28.       if h == xhash:
  29.         # returns hash if cracked
  30.         return(list[i])
  31.       i += 1
  32.     # returns 0 if not cracked.
  33.     return(0)
  34.  
  35. class md5_plain():
  36.   def new(self, hash):
  37.     global xhash
  38.     xhash = hash
  39.   def crack(self, wordlist):
  40.     fh = open(wordlist, 'r')
  41.     words = fh.read()
  42.     fh.close()
  43.     words = words.split('n')
  44.     i = len(words)
  45.     j = 0
  46.     while j < i:
  47.       m = md5.new()
  48.       m.update(words[j])
  49.       h = m.hexdigest()
  50.       if h == xhash:
  51.         # returns the hash if cracked
  52.         return(list[i])
  53.       j += 1
  54.     # returns 0 if hash not cracked
  55.     return(0)