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.

Chapter 21 n A Web Application Hacker’s Methodology 819<br />

5.7.2 Check whe<strong>the</strong>r session expiration is implemented on <strong>the</strong> server:<br />

n Log in to <strong>the</strong> <strong>application</strong> to obtain a valid session token.<br />

n Wait for a period without using this token, and <strong>the</strong>n submit a request<br />

for a protected page (such as My Details) using <strong>the</strong> token.<br />

n If <strong>the</strong> page is displayed normally, <strong>the</strong> token is still active.<br />

n Use trial and error to determine how long any session expiration<br />

timeout is, or whe<strong>the</strong>r a token can still be used days after <strong>the</strong> previous<br />

request that used it. Burp Intruder can be configured to increment<br />

<strong>the</strong> time interval between successive requests to automate this task.<br />

5.7.3 Check whe<strong>the</strong>r a logout function exists. If it does, test whe<strong>the</strong>r it effectively<br />

invalidates <strong>the</strong> user’s session on <strong>the</strong> server. After logging out,<br />

attempt to reuse <strong>the</strong> old token, and determine whe<strong>the</strong>r it is still valid by<br />

requesting a protected page using <strong>the</strong> token. If <strong>the</strong> session is still active,<br />

users remain vulnerable to some session hijacking attacks even after<br />

<strong>the</strong>y have “logged out.” You can use Burp Repeater to keep sending a<br />

specific request from <strong>the</strong> proxy history to see whe<strong>the</strong>r <strong>the</strong> <strong>application</strong><br />

responds differently after you log out.<br />

5.8 Check for Session Fixation<br />

5.8.1 If <strong>the</strong> <strong>application</strong> issues session tokens to unau<strong>the</strong>nticated users, obtain<br />

a token and perform a login. If <strong>the</strong> <strong>application</strong> does not issue a fresh<br />

token following a successful login, it is vulnerable to session fixation.<br />

5.8.2 Even if <strong>the</strong> <strong>application</strong> does not issue session tokens to unau<strong>the</strong>nticated<br />

users, obtain a token by logging in, and <strong>the</strong>n return to <strong>the</strong> login page. If<br />

<strong>the</strong> <strong>application</strong> is willing to return this page even though you are already<br />

au<strong>the</strong>nticated, submit ano<strong>the</strong>r login as a different user using <strong>the</strong> same<br />

token. If <strong>the</strong> <strong>application</strong> does not issue a fresh token after <strong>the</strong> second<br />

login, it is vulnerable to session fixation.<br />

5.8.3 Identify <strong>the</strong> format of session tokens that <strong>the</strong> <strong>application</strong> uses. Modify<br />

your token to an invented value that is validly formed, and attempt to<br />

log in. If <strong>the</strong> <strong>application</strong> allows you to create an au<strong>the</strong>nticated session<br />

using an invented token, it is vulnerable to session fixation.<br />

5.8.4 If <strong>the</strong> <strong>application</strong> does not support login, but processes sensitive user<br />

information (such as personal and payment details) and allows this to<br />

be displayed after submission (such as on a Verify My Order page),<br />

carry out <strong>the</strong> preceding three tests in relation to <strong>the</strong> pages displaying<br />

sensitive data. If a token set during anonymous usage of <strong>the</strong> <strong>application</strong><br />

can later be used to retrieve sensitive user information, <strong>the</strong> <strong>application</strong><br />

is vulnerable to session fixation.

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

Saved successfully!

Ooh no, something went wrong!