Advertisement
hammajdidi

Untitled

Dec 22nd, 2017
81
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.62 KB | None | 0 0
  1. #!/usr/bin/env python
  2.  
  3. print """
  4. *--------------------------------------*
  5. | programmed by:Hammajdidi |
  6. | fb.me/hack1lab |
  7. *--------------------------------------*
  8.  
  9. Code 4 Palestine
  10. Love 4 Palestine
  11. ------------------------
  12.  
  13. python hacking
  14. """
  15. import hashlib
  16. from optparse import *
  17.  
  18. def hashing(word, algorithm):
  19. """ algorithms available: ['md4', 'md5', 'sha1', 'sha256' .... etc] """
  20. hash_type = hashlib.new(algorithm)
  21. hash_type.update(word)
  22. return hash_type.hexdigest()
  23.  
  24.  
  25. parser = OptionParser("""
  26.  
  27. #Usage:
  28.  
  29. python cracker.py -w <hash> -t <type> -f <word list file>
  30.  
  31. #Example:
  32.  
  33. python cracker.py -w 7052cad6b415f4272c1986aa9a50a7c3 -t md5 -f wordlist.txt
  34. """)
  35. parser.add_option("-w",dest="ha_sh",type="string",help="enter hash string")
  36. parser.add_option("-t",dest="ty_pe",type="string",help="enter type the hash")
  37. parser.add_option("-f",dest="fi_le",type="string",help="enter file word list")
  38. (options,args) = parser.parse_args()
  39. if options.ha_sh == None or options.ty_pe == None or options.fi_le == None:
  40. print(parser.usage)
  41. exit(0)
  42. else:
  43. ha_sh = str(options.ha_sh)
  44. ty_pe = str(options.ty_pe)
  45. fi_le = str(options.fi_le)
  46.  
  47. read_list = open(fi_le,'r')
  48. for word in read_list:
  49. word = word.strip("\n")
  50. result = hashing(word, ty_pe)
  51. print("Testing: "+word)
  52. if ha_sh == result:
  53. print ("\nHash Found: [ {} ] >> word: [ {} ]".format(result,word))
  54. exit(0)
  55. else:
  56. continue
  57.  
  58. print("\n\thash not found :(\n")
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement