import requests
target_url = "http://127.0.0.1/dvwa/login.php"
data_dict = {"csrfmiddlewaretoken": "bbbfeed6e1aea50f14a51a331054022c", "username": "admin", "password": "password", "Login": "Submit"}
response = requests.post(target_url, data=data_dict)
print(response.content.decode(errors="ignore"))
I am using the code above to log in into here: http://127.0.0.1/dvwa/login.php After doing some reading, I saw it was because it failed at the CSRF check, so I implemented it to my data_dict.
Here's the problem: now, even with the CSRF check added it's giving me the same
invalid CRSF token
problem as before.
Whats happening? Thanks in advanced.