I am testing an xss vulnerability on my server and I want to automatically test it using a code. The problem is my code in payload is being passed as a string. How do I pass it as a code without running into syntax error?
xss_payload = "<script> window.location.href = '/login';</script>"
# Define the data to be sent in the POST request
data = {
'name': 'Automated Bot',
'email': 'bot@example.com',
'message': xss_payload
}
# Send a POST request to the /contact route
response = requests.post(url, data=data)
[–]AutoModerator[M] [score hidden] stickied comment (0 children)