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.

256 Chapter 7 n Attacking Session Management<br />

(e) http://foo.wahh-app.com/logintest/login.php<br />

(f) https://foo.wahh-app.com/logout<br />

(g) https://wahh-app.com/login/<br />

(h) https://xfoo.wahh-app.com/login/myaccount.php<br />

4. The <strong>application</strong> you are targeting uses per-page tokens in addition to <strong>the</strong><br />

primary session token. If a per-page token is received out of sequence, <strong>the</strong><br />

entire session is invalidated. Suppose that you discover some defect that<br />

enables you to predict or capture <strong>the</strong> tokens issued to o<strong>the</strong>r users who are<br />

currently accessing <strong>the</strong> <strong>application</strong>. Can you hijack <strong>the</strong>ir sessions?<br />

5. You log in to an <strong>application</strong>, and <strong>the</strong> server sets <strong>the</strong> following cookie:<br />

Set-cookie: sess=ab11298f7eg14;<br />

When you click <strong>the</strong> logout button, this causes <strong>the</strong> following client-side<br />

script to execute:<br />

document.cookie=”sess=”;<br />

document.location=”/”;<br />

What conclusion would you draw from this behavior?

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

Saved successfully!

Ooh no, something went wrong!