19.09.2017 Views

the-web-application-hackers-handbook

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

608 Chapter 14 n Automating Customized Attacks<br />

By creating multiple rules with different scopes and actions, you can define<br />

a hierarchy of behavior that Burp will apply to different URLs and parameters.<br />

For example, suppose you are testing an <strong>application</strong> that frequently terminates<br />

your session in response to unexpected requests and also makes liberal use of<br />

an anti-CSRF token called __csrftoken. In this situation you could define <strong>the</strong><br />

following rules, as shown in Figure 14-15:<br />

n For all requests, add cookies from Burp’s cookie jar.<br />

n For requests to <strong>the</strong> <strong>application</strong>’s domain, validate that <strong>the</strong> current session<br />

with <strong>the</strong> <strong>application</strong> is still active. If it isn’t, run a macro to log back in to<br />

<strong>the</strong> <strong>application</strong>, and update <strong>the</strong> cookie jar with <strong>the</strong> resulting session token.<br />

n For requests to <strong>the</strong> <strong>application</strong> containing <strong>the</strong> __csrftoken parameter,<br />

first run a macro to obtain a valid __csrftoken value, and use this when<br />

making <strong>the</strong> request.<br />

Figure 14-15: A set of session-handling rules to handle session termination and<br />

anti-CSRF tokens used by an <strong>application</strong>

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!