jeudi 31 décembre 2020

Brute Force with random and requests Library | python

I want to login with my mail address, but the password, I want to find out with my brute force python script here:

import requests
import random

s = requests.session()

here is my form data except the password:

payload = {
    "username": "maixr_p4ter@web.de",
}
password = payload["password"] = ""

here are some chars, that I converted to a list and I want that my script tries all possibilities:

chars="AaBbCcDdEeFfGgHhIiJjKkLlMmNnOoPpQqRrSsTtUuVvWwXxYyZz01234567890"
chars_list = list(chars)
response = s.post("https://login.web.de/login",data=payload)

and here is my while-loop, I declared that if the password does not equal to result.status_code == 200, he should play the loop over and over. (As you know status_code returned a 200 , which means the request was successful and the server responded with the data I was requesting)

while(password != (result.status_code == 200)):

    password = random.choices(chars_list)
    print("<=="+str(guess_password)+"==>")

    if(password == list(password)):
        print("Your password is: "+ "".join(password))

but it gives me in the end: IndentationError: unexpected indent maybe you can help me to fix my problem.

all code:

import requests
import random

s = requests.session()

payload = {
    "username": "meier_peter8@web.de",
}


password = payload["password"] = "" 

chars="AaBbCcDdEeFfGgHhIiJjKkLlMmNnOoPpQqRrSsTtUuVvWwXxYyZz01234567890"
chars_list = list(chars)
response = s.post("https://login.web.de/login",data=payload)

    while(password != (result.status_code == 200)):

        password = random.choices(chars_list)
        print("<=="+str(guess_password)+"==>")

        if(password == list(password)):
            print("Your password is: "+ "".join(password))



Aucun commentaire:

Enregistrer un commentaire