Advertisement
Guest User

Untitled

a guest
Feb 2nd, 2017
192
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.48 KB | None | 0 0
  1. # @Author: yoavmmn
  2. # @Date: 01-02-2017 22:58
  3. # @Last modified by: yoavmmn
  4. # @Last modified time: 01-02-2017 23:21
  5. # solving riddle.website login
  6.  
  7. import threading, time, random, sys
  8. import hashlib
  9. from string import letters, digits
  10. from itertools import product
  11.  
  12. strs = digits + letters
  13.  
  14. if len(sys.argv) !=1:
  15. print "Usage: ./md5brute.py"
  16. sys.exit(1)
  17.  
  18.  
  19. final_md5 = "8e16941e6d51be408459221a1c905eda"
  20. username = "PoliC3"
  21. const = "allwa7"
  22. expression = username + const
  23. flag = False
  24.  
  25. print "\n\t MD5 Bruteforce finder"
  26. print "\t--------------------------------------------------\n"
  27. print "[+] User:",username
  28.  
  29. class Worker(threading.Thread):
  30. def run(self):
  31. global success
  32. flag = False
  33. try:
  34. for i in range(10):
  35. for per in product(strs, repeat = i):
  36. md5 = hashlib.md5()
  37. value = ''.join(per)
  38. current = md5.update(expression+value)
  39. print "-"*12
  40. print "Tested string: %s" % ("PoliC3allwa7"+value)
  41. print "current MD5:", md5.hexdigest()
  42.  
  43. if md5.hexdigest() == final_md5:
  44. success = value
  45. flag = True
  46. time.sleep(2)
  47. try:
  48. print "\n\n\t[+] Found hash: %s md5(%s): %s" % (expression, expression, fixed_md5)
  49. print "\t[+] Found Password"
  50. print "\t[+] User:",username," Password:",success
  51. except(NameError):
  52. print "\n\t[+] Couldn't find correct password"
  53. pass
  54. print "\n\t[+] Done\n"
  55. sys.exit(1)
  56.  
  57.  
  58. except(RuntimeError), msg:
  59. pass
  60.  
  61. for i in range(1):
  62. work = Worker()
  63. work.start()
  64. time.sleep(1)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement