Share your repls and programming experiences

← Back to all posts
Brute Force Password Guesser
Zexogon (176)

Enter a number password and have it cracked by force
You can see the guessing happening in real time
See how many passwords it tries before it gets yours
5 digit numbers recommended as anything lager can take a while

Commentshotnewtop
CanadianCaleb (7)

Are you going to try to make one that uses characters?

Zexogon (176)

@CanadianCaleb i want to but i have no idea how to produce a string of random letters at the moment

ChezCoder (27)

@Zexogon you can do this:

import random
import os

randomPassword = ''
alphabetList = ['a','b','c','d','e','f','g','h','i','j','k','l','m','n','o','p','q','r','s','t','u','w','x','y','z']
guess = input('enter string!')
guess = guess.lower()         #set user input to lowercase

while randomPassword != guess:
  randomPassword = ''
  for i in range(random.randint(1,10)):
    randomPassword += random.choice(alphabetList) #this code creates the random string.
  print(randomPassword)
  os.system('clear')
Zexogon (176)

@ChezCoder i hope its ok if i take that code and look at it and mabey make a programme bassed off it <w< >w>

sperd (0)

@Zexogon ChezCoder's example is great and all, but here is a short bruteforcer that can tries numbers and characters (even special characters):

text = ""
message = input("Type a message: ")

for i in range(len(message)):
	char = " "
	while True:
		char = ord(char) + 1
		char = chr(char)
		print(text + char)
		if char == message[i]:
			break

	text = text + char
input()
Zexogon (176)

@sperd while this is cool and all and I’m probably gonna make a new one I can imagine this taking forever to run and find a password due to the overwhelming amount of different factors it has to generate

Like the numbers one only had to generate 1-9 consistently
And the letters one works with 36 letters which is why it was hard to even make it generate random strings in the first place
You my friend, while smart are also insane if you want to open up a python file to run that many factors but insanity in coding is always amazing, I mean look at michal reeves, so I really encourage you to do it on your own or if you want me to I will and I will give you credit for the code but it goes without saying this will probably take a while to crack a 5 digit random password with letters numbers and symbols

sperd (0)

@Zexogon This bruteforces a certain message differently, it takes about 0.3 seconds for 11 digit characters, this does not randomly generate strings, run the code if you wish to see how this works.

While generating random strings constantly would be insane and won't succeed without a supercomputer or something.

Zexogon (176)

@sperd this code is very cool don’t get me wrong but my goal is to do it by generating random passwords

sperd (0)

@Zexogon I see, that wouldn't be very hard, it'll only be hard on the computer and I can imagine this taking a really really long time, since there are lots of possible combinations, but best of luck

CanadianCaleb (7)

@sperd This wouldn't work in any real situation, considering you need to know the characters in the password to be able to guess it.

CanadianCaleb (7)

@Zexogon An easy way to make it use all characters is ord(' ') - ord('~') also known as chr('32') - chr(126)

DJWang (277)

Lol is that seriously too hard

ChezCoder (27)

@Zexogon try making a list of all the letters in the alphabet. Then use:

RANDOMPASSWORD = ''
for i in range(random.randint(1,10)):
-->RANDOMPASSWORD += random.choice(ALPHABETlist)
BenjaminNamika1 (23)

@DJWang if your password is one then, the range is from 1 to 1, so it has to pick one, so 3487 is impossible

Zexogon (176)

@ChezCoder um is that python?
also what is alphabet list, is it 1 variable? or a group of variables?

Zexogon (176)

@DJWang I really liked your dark forest game by the way!!!!
i made a game called onechance i think youd like the post is just called one chance a demo, it sadly never got any attention

DJWang (277)

@Zexogon I can help you get more attention!

Zexogon (176)

@DJWang thjat would be cool im currently working on the full game right now i have it pinned on my account (OCFR) its not finished but you can take a look

BenjaminNamika1 (23)

@DJWang i am sorry i didn't see that @Zexogon re edited the code, next time i will check harder

nithilan4 (62)

really cool idea that it's random, less attempts needed most of the time than going in order

Zexogon (176)

@nithilan4 thanks! i love coding in python and its hard to come up with ideas

nithilan4 (62)

@Zexogon if you want to learn another language really quickly since it looks like you mastered python then you should learn javascript. it's basically the same as python but with a little different syntax and braces.

Zexogon (176)

@nithilan4 just an opinion but i hate java im probobly gonna learn node js so i can keep working on my discord bot

nithilan4 (62)

@Zexogon javascript is not java. nodejs is serverside javascript

mchapy1 (14)

I'm pretty sure 0 is a number only password... Other than that, great job!

Zexogon (176)

made a video on this where i run 12 at once check it out --> https://www.youtube.com/watch?v=WNMLZU-7QIg

BenjaminNamika1 (23)

Cool, most of the time the guesses are less than and non-random brute force algorithm. The program guesses a random integer from 1 to your number, but it the relay world you wouldn't know the length. Also try entering a "0"

mchapy1 (14)

Very nice! I haven't tested it much, but so far the longest time taken for a 5 number combination is "54325" with 56670 passwords guessed.