January 2019
Intermediate to advanced
502 pages
12h 19m
English
Here, we will look at an approach that we will use to automatically detect CSRF in web applications using Python, Beautifulsoup, Selenium, and Phantomjs. Before automating the detection, however, let's discuss the approach that we shall take. We know that CSRF attacks can be mitigated by implementing anti-CSRF tokens.
Any form that would be served from the server, which will potentially modify the state at the server, should have a hidden field that contains a random cryptic value called a CSRF token. The principle behind most CSRF tokens is that this form and a cookie must also be set with a cryptic value that translates to the same value of the token served in the hidden field. When the form is posted ...
Read now
Unlock full access