Pastebin

ID: 23da2a0ae632 Never expires
import itertools
import string

# Target password to guess
target_password = "dog"

# Characters to use in brute-force
charset = string.ascii_lowercase  # 'abcdefghijklmnopqrstuvwxyz'

# Maximum length of password to try
max_length = 4

def brute_force(target):
    for length in range(1, max_length + 1):
        for attempt in itertools.product(charset, repeat=length):
            guess = ''.join(attempt)
            print(f"Trying: {guess}")
            if guess == target:
                print(f"Password found: {guess}")
                return guess
    print("Password not found.")
    return None

brute_force(target_password)
Link: https://fencott.ca/p/23da2a0ae632