top of page
Search

Cracking forgotten passwords with brute force in python




In a lifetime we can most certainly agree that we have forgotten the passwords of some accounts that we created on the web. Let's make up a story, you had an account on a website about 5 years ago and slowly you forgot about the account and its password. Unfortunately this story is true for some people who use the Internet for work. Even support for that account goes down by the years if it is not used for a while.


Luckily in some cases you remember some of the password but forget some other parts like a number/s or sign/s or a character/s or a word.


If you remember some part of the password, please keep reading as I have created a nifty little piece of code to help you with just the problem you're having.


I have made a piece of code for cracking *forgotten* passwords with brute force. You do have to do some things manually to get your hands back on your account though, which I will discuss later down in this post.



So basically the code is written in python and all it does, is that it takes the broken down values stored in it (which will be our password's parts we remember) and takes some assumption values (which will be our forgotten part, you have to assume some and fill in) and joins a bunch of them in random order and creates a pleasant list of infinite passwords. Note: You have to stop the program to stop the list of passwords.


Post is helpful?

Consider subscribing to my youtube channel for a related video on this topic soon.


NHbinaaa111

This also supports me and encourages new ideas to pop out. Not mandatory but much appreciated!

Having trouble understanding?

No problem, I am here to help. Ask any related questions on my channel:

I will be uploading a related video on this topic soon, so be sure to check that out to clear your doubts.



Okay, now that you have a brief understanding about my program, let's get to work.


Step 1: Download and installations

Download and install python on your computer(tutorials are available on the web). Next install an application that can help you edit the code. Visual Studio Code is a good and free option (tutorials for download and install on the web).

Set up Visual Studio Code and explore a little.


Note: This step is not required if you already have python installed and Visual studio Code/ or any other software installed.


Step 2: Copy the code and make a file

This step is super simple, all you need to do here is to copy the code I have provided and make a .py file and open it in your code editor by right clicking on it.


Code :


#coded by nhbinaaa111

while True: import random # forgotten characters/numbers forgot1 = "12" + "-" forgot2 = "12" + "/" forgot3 = "12" + "_" forgot4 = "12" + "%" # length of the password #the numbers 12 counts as one and one sign counts as one and the word hacked counts as one so length = 3 length = 3 # password join variables (no need to change) password1 ="".join(random.sample(forgot1,length)) password2 ="".join(random.sample(forgot2,length)) password3 ="".join(random.sample(forgot3,length)) password4 = "".join(random.sample(forgot4,length)) #display output with the remembered parts of the password. print("Hacked"+password1) print("hacked"+password1) print("Hacked"+password2) print("hacked"+password2) print("Hacked"+password3) print("hacked"+password3) print("Hacked"+password4) print("hacked"+password4)


Step 3: Edit the code

This step is a little bit confusing for a normal person but for a programmer who has worked with python for even a day will able to edit it.


You just paste the provided code into your code editor after opening your .py file.

All you need to change is the forgot variables (they contain the part of the password that you forgot Eg:-signs/numbers)

For example you forgot a sign, so you assume "$" sign ">" sign and "~" sign, so you change this:

forgot1 = "12" + "-"

forgot2 = "12" + "/"

forgot3 = "12" + "_"

forgot4 = "12" + "%"



To this:


forgot1 = "12" + ">" forgot2 = "12" + "$" forgot3 = "12" + "~" #forgot4 = "12" + "%" If you have less signs to deal with, just comment out the other forgot variable/s using a #


Note: You do also have to comment out the other parts of the code depending on the variables we commented out. For example we commented out forgot4, so the last two lines of the code have to be commented too. So this has to be changed:

print("Hacked"+password4) print("hacked"+password4)

To this:

#print("Hacked"+password4) #print("hacked"+password4)


Also note that you can change the numbers in the forgot variable too, but if you don't have any numbers, just remove the numbers and change length = 3 to length = 2


Okay, so after changing the forgot variables, you have to change a bit more things to get it all set up.


Notice the print statements at the last? They contain the parts of the password that you remember, so let's have a look.


So if you remember a part of the password, just change the value in quotes and you're set. Suppose that you remember the word "mypass" , you have to change this:


print("Hacked"+password1) print("hacked"+password1) print("Hacked"+password2) print("hacked"+password2) ep print("Hacked"+password3) print("hacked"+password3) print("Hacked"+password4) print("hacked"+password4)

To this:


print("mypass"+password1) print("mypass"+password2) print("mypass"+password3)

print("mypass"+password4) *note that the print statements are repeated two times before and after its only one. It's because that it prints the remembered parts in both upper case and lower case but after our change, it only prints in lower case.


And we are done setting up!

Step 4: Run and copy the output

All you need to do now is to run the code and you will be getting a code output like this:


Just copy one of the outputs and try logging in with that in your account. It will take a lot of tries, but eventually you will be able to get access.




Thanks for reading this article!

Contact me for any questions, subscribe to my channel and see you next time!


8 views0 comments

Recent Posts

See All

Raspberry pi is a monster

Did you know there is a computer in the world that is so cheap and powerful at the same time which can be used for light games and coding, most of the coding can be done. The computer is called a rasp

Windows 11 IS LEAKED!

Today windows 11 is LEAKED and is usable and you can install the OS on your 64 bit computer. This is great news and a new competitor for Mac os! You can download it by searching on the web, but I reco

Post: Blog2_Post

Subscribe Form

Thanks for submitting!

  • YouTube

©2021 by NHBINAAA

bottom of page