Advertisement
Lucifer_Gaming

BLACKHAT Tool [Hasher]

Apr 10th, 2024 (edited)
31
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 5.01 KB | None | 0 0
  1. def hash_password(password, hash_type):
  2. if hash_type == '1':
  3. return hashlib.md5(password.encode()).hexdigest()
  4. elif hash_type == '2':
  5. return hashlib.sha1(password.encode()).hexdigest()
  6. elif hash_type == '3':
  7. # We need to change this part to bcrypt
  8. hashed = bcrypt.hashpw(password.encode(), bcrypt.gensalt())
  9. return hashed.decode()
  10. elif hash_type == '4':
  11. # Use binascii.crc32 directly without conversion
  12. return hex(binascii.crc32(password.encode()) & 0xFFFFFFFF)[2:] # Removing '0x' prefix and ensure it's 32 bits
  13. else:
  14. raise ValueError("Invalid hash type")
  15.  
  16. def animate_password_crack(hash_input, password_list, hash_type):
  17. n = len(hash_input)
  18. box = [[' ' for _ in range(n)] for _ in range(3)]
  19.  
  20. for i, char in enumerate(hash_input):
  21. box[0][i] = char
  22.  
  23. for password in password_list:
  24. hashed_password = hash_password(password, hash_type)
  25. box[1] = list(hashed_password)
  26. box[2] = [random.choice(['✘', '✔']) for _ in range(len(hashed_password))]
  27. sys.stdout.write('\r')
  28. sys.stdout.write('┌' + '-' * (n * 2 - 1) + '┐\n')
  29. sys.stdout.write('|' + '|'.join(box[0]) + '|\n')
  30. sys.stdout.write('├' + '-' * (n * 2 - 1) + '┤\n')
  31. sys.stdout.write('|' + '|'.join(box[1]) + '|\n')
  32. sys.stdout.write('├' + '-' * (n * 2 - 1) + '┤\n')
  33. sys.stdout.write('|' + '|'.join(box[2]) + '|\n')
  34. sys.stdout.write('└' + '-' * (n * 2 - 1) + '┘\n')
  35. sys.stdout.write('\033[F' * 7)
  36. sys.stdout.flush()
  37.  
  38. if hashed_password == hash_input:
  39. box[1] = list(password)
  40. box[2] = ['✔' for _ in range(len(hashed_password))]
  41. sys.stdout.write('\r')
  42. sys.stdout.write('┌' + '-' * (n * 2 - 1) + '┐\n')
  43. sys.stdout.write('|' + '|'.join(box[0]) + '|\n')
  44. sys.stdout.write('├' + '-' * (n * 2 - 1) + '┤\n')
  45. sys.stdout.write('|' + '|'.join(box[1]) + '|\n')
  46. sys.stdout.write('├' + '-' * (n * 2 - 1) + '┤\n')
  47. sys.stdout.write('|' + '|'.join(box[2]) + '|\n')
  48. sys.stdout.write('└' + '-' * (n * 2 - 1) + '┘\n')
  49. print("Matched Password:", password)
  50. with open('Results.txt', 'w') as results_file:
  51. results_file.write(f"{hash_input}:{password}\n")
  52. return password
  53.  
  54. print("No matching password found!")
  55. return None
  56.  
  57. hash_type = input("""
  58.  
  59. ██████╗ ██╗ █████╗ ██████╗██╗ ██╗██╗ ██╗ █████╗ ████████╗ ██████╗ ██████╗ ██████╗ ██╗
  60. ██╔══██╗██║ ██╔══██╗██╔════╝██║ ██╔╝██║ ██║██╔══██╗╚══██╔══╝ ██╔════╝ ██╔═══██╗██╔══██╗ ██╗╚██╗
  61. ██████╔╝██║ ███████║██║ █████╔╝ ███████║███████║ ██║ ██║ ███╗██║ ██║██║ ██║ ╚═╝ ██║
  62. ██╔══██╗██║ ██╔══██║██║ ██╔═██╗ ██╔══██║██╔══██║ ██║ ██║ ██║██║ ██║██║ ██║ ██╗ ██║
  63. ██████╔╝███████╗██║ ██║╚██████╗██║ ██╗██║ ██║██║ ██║ ██║ ╚██████╔╝╚██████╔╝██████╔╝ ╚═╝██╔╝
  64. ╚═════╝ ╚══════╝╚═╝ ╚═╝ ╚═════╝╚═╝ ╚═╝╚═╝ ╚═╝╚═╝ ╚═╝ ╚═╝ ╚═════╝ ╚═════╝ ╚═════╝ ╚═╝
  65.  
  66. ┌-----------------┐
  67. |Select your Mode |
  68. └┘└┘└┘└┘└┘└┘└┘└┘└┘┘
  69. ┌┐ ┌┐ ┌┐ ┌┐ ┌┐ ┌┐
  70. | 1. MD5 |
  71. | 2. SHA-1 |
  72. | 3. BCRYPT |
  73. | 4. CRC32 |
  74. └-----------------┘
  75. Enter the hash type : """)
  76. hash_input = input("Enter your hash: ")
  77. filename = input("Enter the filename containing passwords: ")
  78. with open(filename, 'r', encoding='utf-8', errors='ignore') as file:
  79. password_list = [line.strip() for line in file]
  80.  
  81. print("Cracking...")
  82. matched_password = animate_password_crack(hash_input, password_list, hash_type)
  83. if matched_password:
  84. print("Matched Password:", matched_password)
  85. import os;os.system("pause")
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement