Python Forum
Brute Force Password Cracker
Thread Rating:
  • 1 Vote(s) - 5 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Brute Force Password Cracker
#1
This is a brute force password cracker. Input your (fake) password, and watch the computer go! Funnily enough, abc123 takes a very long time.
import itertools
import time
import string
import sys
import getpass
# Please do not do all numbers. 
 
#
pas = getpass.getpass(prompt='What is your password?(For security,(and added effect), the password is not shown) ')
 
def guess_password(real):
   chars = string.ascii_lowercase + string.digits + string.ascii_uppercase
   attempts = 0
   for password_length in range(1, 9):
     for guess in itertools.product(chars, repeat = password_length):
           attempts += 1
           guess = ''.join(guess)
           if guess == real:
               return 'password is {}. found in {} guesses.'.format(guess, attempts)
           print(guess, attempts)
 
 
print(guess_password(pas))
Reply
#2
This is pretty cool and could be very useful for testing to see how easy it is for your password to be cracked
~~ UwU
Reply


Possibly Related Threads…
Thread Author Replies Views Last Post
  Hash cracker Milan 1 1,875 Apr-03-2023, 12:44 PM
Last Post: rob101

Forum Jump:

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020