Password-Cracking-Dictionary-

In a general sense, password cracking is the process of using an application program to identify and recover passwords from a computer or network resource. Let's make our own password md5 cracker.

View on GitHub

Password-Cracking-Tutorial

What is Password cracking?

In a general sense, password cracking is the process of using an application program to identify and recover passwords from a computer or network resource.

What does this mean?

With this information, malicious actors can undertake a range of criminal activities where they can gain unauthorised access to restricted resources for identity theft and fraud.

What makes a strong password?

Password crackers can decipher passwords in a matter of days or hours, depending on how weak or strong the password is. To make a password stronger and more difficult to uncover, a plaintext password should adhere to the following 6 rules!

1. Be at least 12 characters long:

2. Combine letters and a variety of characters.

3. Avoid reusing a password.

4. Pay attention to password strength indicators.

5. Avoid easy-to-guess phrases and common passwords.

6. Use encryption (2FA).

Password cracking attacks

You might have two choices either a dictionary attack or brute force attack.

So whats faster?

Well, a dictionary attack is much faster than a brute force attack where success is determined by the password list size.

Password dictionaries + leaked passwords by skullsecurity.org

Resource can be found here Wiki(2021).https://wiki.skullsecurity.org/index.php/Passwords#Password_dictionaries. Date Accessed:11/12/21

Resources (Password creation tools + managers)

DashLane(2021). https://www.dashlane.com/features/password-generator . Date Accessed: 11/12/21 Howsecureismypasssword(2021). https://howsecureismypassword.net/ . Date Accessed: 11/12/21 Diceware(2021). https://diceware.dmuth.org/ . Date Accessed: 11/12/21

Lets Build our own || I/O + Testing

First, follow the installation instruction at the bottom of the page and grab the starting files!

Input

"""
Method 1: Provide a input and output the hexadecimal equivalent of the encoded value.

"""
# initializing string
str2hash = "qwerty"
  
# encoding qwerty using encode()
# then sending to md5()
result = hashlib.md5(str2hash.encode())
  
# printing the equivalent hexadecimal value.
print("The hexadecimal equivalent of hash is : ", end ="")
print(result.hexdigest())

Output

Heres what the example output should look like

Input

"""
# Method 2: Simple MD5 hash cracker

Tested on passwrd= '011584wb'
passwrd_hash= '5378a9d21949ae0ef0956ef7f5284e9d'
"""
HASH = '5378a9d21949ae0ef0956ef7f5284e9d'
PASSLIST = [
        '011584wb',
        '0148068885',
        '040191flo',
        'password',
        '0508rabbit88'
        '10393Ravens52'
        '1234567Ks123'
        '12qwaszx'
        '12qwaszx'
        '3634819zhang'
        '804139aq'
]

def main():
        for word in PASSLIST:
                guess = hashlib.md5(word.encode('utf-8')).hexdigest()
                if guess.upper() == HASH or guess.lower() == HASH:
                        print(f'[+] Password has been found: {word}')
                        exit(0)
                else:
                        print(f'[-] Guess: {word} incorrect... {guess}')
        print(f'Password not found in wordlist...')
if __name__ == '__main__':
        main()

Output

Heres what the example output should look like

Input

"""
Method 3: WordList 
Check to see if the hash is included in md5, sha1, sha224, sha256, sha384, sha512.
"""
def passCrack(inputPass):
    
    #file=open(filename,errors="ignore")
    try:
        passFile = open("wordlist.txt", "r", encoding="utf-8")
    except:
        print(" Oh oh... We could not find the file. Is it the end?")

    for password in passFile:
        
        enc_Passwrd = password.encode("utf-8")
       
        digest = hashlib.md5(enc_Passwrd.strip()).hexdigest().lower()
##        digest = hashlib.sha1(enc_Passwrd.strip()).hexdigest().lower()
##        digest = hashlib.sha512(enc_Passwrd.strip()).hexdigest().lower()
##        digest = hashlib.sha384(enc_Passwrd.strip()).hexdigest().lower()
##        digest = hashlib.sha224(enc_Passwrd.strip()).hexdigest().lower()
        
        if digest == inputPass:
            print("Password has been found: " + password)
            
if __name__ == '__main__':
    #md5 hash
    passCrack("3c9b1a779c22025e758dc0d187517ccd")

Output

Heres what the example output should look like

Installation

Git clone repo from my github page.

Capture