I have a HTTP demonstration website with a login page that I need to write a script to find the correct password for the login which is located within a dictionary file I created of 500 words.
So far I just have the script where it opens my dictionary file and reads each line and have implemented a request.get also to if it matches the password it will print the word to the console basically saying I found the password
I need it to go through each word in the dictionary that has a single string on each line until it matches with the correct password that will return a string that contains 'Login' in, instead of it returning 'Wrong Username/password' which it has done when executing
import requests
with open("dictionary_500_words", 'r') as f:
words = f.readlines()
for word in words:
output = requests.get(f'http://p2.ditdemo.net/checklogin.php?myusername=usr&mypassword=${words }&Submit=Login')
if "Login" in output.text:
break
print(word)
print(output.text)
mypassword
to – DeepSpace