Ask coding questions

← Back to all posts
Brute Force Password Hacker question
HappyLunchBox (51)

In a Brute Force Password Hacker I'm making, I want to let the machine try two letters AFTER one letter words. How would I do this? btw I don't want to import everything Becuase I understand nothing about a package I import

Thanks!

Answered by robowolf (406) [earned 5 cycles]
View Answer
Comments
hotnewtop
robowolf (406)

What I did when I made one of these, I made a while loop with a system to detect when one letter words were done. You can either try

if len(guessed) == len(chars)*number:#*number would make sure that it updates itself dependent on chars already guessed
   number+=1 # make number directly affect the amount of chars guessed

or you can look at this for some help

HappyLunchBox (51)

oh so like do a list in order. k

HappyLunchBox (51)

then what about AFTER the two letter passwords?

robowolf (406)

@HappyLunchBox I updated my explanation so it could be random and progressively update

HappyLunchBox (51)

@robowolf so it works for two letter passwords, three letter passwords etc.?

HappyLunchBox (51)

@robowolf
'''python
def fast():
global guess, attempts, m, n
while (guess != password):
guess = ""
for char in range(len(chars)):

  for i in range(n):
    randomChar = random.choice(chars)
    m.append(randomChar)
if m in guessed:
  n += 1
else:
  
  continue


  
    

for i in range(len(chars)):
  for i in range(n):
    guess+=random.choice(chars)
    if guess not in guessed:
      
      if guess != password:
        guess = ""
        attempts += 1
        guessed.append(guess)
      else:
        guessed.append(guess)
        attempts += 1
        print(f"Password Cracked in {attempts} attempts. Guesses : {guessed} The password is {guess}")
        sys.exit(0)
    else:
      continue

'''

HappyLunchBox (51)

it has a bug for some reason

HappyLunchBox (51)

@robowolf i did the indentations right it's just copy and pasting, but I still have a bug