From 3313885734dc95076548c7e46f4f16da562c699d Mon Sep 17 00:00:00 2001 From: kirat pal singh lamba <32259407+skirat@users.noreply.github.com> Date: Sun, 3 Oct 2021 06:46:29 +0530 Subject: [PATCH 1/2] Create crack-password --- EthicalHackingScripts/crack-password | 45 ++++++++++++++++++++++++++++ 1 file changed, 45 insertions(+) create mode 100644 EthicalHackingScripts/crack-password diff --git a/EthicalHackingScripts/crack-password b/EthicalHackingScripts/crack-password new file mode 100644 index 000000000..480142640 --- /dev/null +++ b/EthicalHackingScripts/crack-password @@ -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 **********************") From b390b71b9b8864e79623cada281dd897831a2735 Mon Sep 17 00:00:00 2001 From: kirat pal singh lamba <32259407+skirat@users.noreply.github.com> Date: Sun, 3 Oct 2021 14:46:56 +0530 Subject: [PATCH 2/2] Delete crack-password --- EthicalHackingScripts/crack-password | 45 ---------------------------- 1 file changed, 45 deletions(-) delete mode 100644 EthicalHackingScripts/crack-password diff --git a/EthicalHackingScripts/crack-password b/EthicalHackingScripts/crack-password deleted file mode 100644 index 480142640..000000000 --- a/EthicalHackingScripts/crack-password +++ /dev/null @@ -1,45 +0,0 @@ -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 **********************")