19.09.2017 Views

the-web-application-hackers-handbook

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

236 Chapter 7 n Attacking Session Management<br />

service on <strong>the</strong> same server if one is running or to http://server:443/<br />

o<strong>the</strong>rwise), his token may be submitted. Means by which <strong>the</strong> attacker<br />

may attempt this include sending <strong>the</strong> user a URL in an e-mail or instant<br />

message, placing autoloading links into a <strong>web</strong>site <strong>the</strong> attacker controls,<br />

or using clickable banner ads. (See Chapters 12 and 13 for more details<br />

about techniques of this kind for delivering attacks against o<strong>the</strong>r users.)<br />

HACK STEPS<br />

1. Walk through <strong>the</strong> <strong>application</strong> in <strong>the</strong> normal way from first access (<strong>the</strong><br />

“start” URL), through <strong>the</strong> login process, and <strong>the</strong>n through all of <strong>the</strong> <strong>application</strong>’s<br />

functionality. Keep a record of every URL visited, and note every<br />

instance in which a new session token is received. Pay particular attention<br />

to login functions and transitions between HTTP and HTTPS communications.<br />

This can be achieved manually using a network sniffer such<br />

as Wireshark or partially automated using <strong>the</strong> logging functions of your<br />

intercepting proxy, as shown in Figure 7-10.<br />

Figure 7-10: Walking through an <strong>application</strong> to identify locations where new<br />

session tokens are received.<br />

2. If HTTP cookies are being used as <strong>the</strong> transmission mechanism for session<br />

tokens, verify whe<strong>the</strong>r <strong>the</strong> secure flag is set, preventing <strong>the</strong>m from ever<br />

being transmitted over unencrypted connections.<br />

3. Determine whe<strong>the</strong>r, in <strong>the</strong> normal use of <strong>the</strong> <strong>application</strong>, session tokens<br />

are ever transmitted over an unencrypted connection. If so, <strong>the</strong>y should be<br />

regarded as vulnerable to interception.<br />

4. Where <strong>the</strong> start page uses HTTP, and <strong>the</strong> <strong>application</strong> switches to HTTPS<br />

for <strong>the</strong> login and au<strong>the</strong>nticated areas of <strong>the</strong> site, verify whe<strong>the</strong>r a new<br />

token is issued following login, or whe<strong>the</strong>r a token transmitted during <strong>the</strong><br />

HTTP stage is still being used to track <strong>the</strong> user’s au<strong>the</strong>nticated session.<br />

Also verify whe<strong>the</strong>r <strong>the</strong> <strong>application</strong> will accept login over HTTP if <strong>the</strong> login<br />

URL is modified accordingly.

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

Saved successfully!

Ooh no, something went wrong!