diff --git a/EthicalHackingScripts/password-cracker/README.md b/EthicalHackingScripts/password-cracker/README.md new file mode 100644 index 000000000..2483d10af --- /dev/null +++ b/EthicalHackingScripts/password-cracker/README.md @@ -0,0 +1,3 @@ +Password Cracker + +This script uses hash as an input and bruteforce that hash using a text file to crack the password diff --git a/EthicalHackingScripts/password-cracker/images/Screenshot 2021-10-03 at 3.03.13 PM.png b/EthicalHackingScripts/password-cracker/images/Screenshot 2021-10-03 at 3.03.13 PM.png new file mode 100644 index 000000000..1f04642bb Binary files /dev/null and b/EthicalHackingScripts/password-cracker/images/Screenshot 2021-10-03 at 3.03.13 PM.png differ diff --git a/EthicalHackingScripts/password-cracker/images/image.jpeg b/EthicalHackingScripts/password-cracker/images/image.jpeg new file mode 100644 index 000000000..8b1378917 --- /dev/null +++ b/EthicalHackingScripts/password-cracker/images/image.jpeg @@ -0,0 +1 @@ + diff --git a/EthicalHackingScripts/password-cracker/password-cracker.py b/EthicalHackingScripts/password-cracker/password-cracker.py new file mode 100644 index 000000000..480142640 --- /dev/null +++ b/EthicalHackingScripts/password-cracker/password-cracker.py @@ -0,0 +1,45 @@ +import hashlib +print("**************PASSWORD CRACKER ******************") + +# To check if the password +# found or not. +pass_found = 0 + +input_hash = input("Enter the hashed password:") + +pass_doc = input("\nEnter passwords filename including path(root / home/):") + +try: + # trying to open the password file. + pass_file = open(pass_doc, 'r') +except: + print("Error:") + print(pass_doc, "is not found.\nPlease give the path of file correctly.") + quit() + + +# comparing the input_hash with the hashes +# of the words in password file, +# and finding password. + +for word in pass_file: + # encoding the word into utf-8 format + enc_word = word.encode('utf-8') + + # Hashing a word into md5 hash + hash_word = hashlib.md5(enc_word.strip()) + + # digesting that hash into a hexa decimal value + digest = hash_word.hexdigest() + + if digest == input_hash: + # comparing hashes + print("Password found.\nThe password is:", word) + pass_found = 1 + break + +# if password is not found. +if not pass_found: + print("Password is not found in the", pass_doc, "file") + print('\n') +print("***************** Thank you **********************") diff --git a/EthicalHackingScripts/password-cracker/requirements.txt b/EthicalHackingScripts/password-cracker/requirements.txt new file mode 100644 index 000000000..2dc687a9f --- /dev/null +++ b/EthicalHackingScripts/password-cracker/requirements.txt @@ -0,0 +1,2 @@ +1) installing the 'pynput' module through terminal and then importing notification +2) installing the 'win10toast' module through terminal and then importing notification