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.

238 Chapter 7 n Attacking Session Management<br />

When <strong>application</strong>s transmit <strong>the</strong>ir session tokens in this way, it is likely that<br />

<strong>the</strong>ir session tokens will appear in various system logs to which unauthorized<br />

parties may have access:<br />

n Users’ browser logs<br />

n Web server logs<br />

n Logs of corporate or ISP proxy servers<br />

n Logs of any reverse proxies employed within <strong>the</strong> <strong>application</strong>’s hosting<br />

environment<br />

n The Referer logs of any servers that <strong>application</strong> users visit by following<br />

off-site links, as shown in Figure 7-11<br />

Some of <strong>the</strong>se vulnerabilities arise even if HTTPS is used throughout <strong>the</strong><br />

<strong>application</strong>.<br />

Figure 7-11: When session tokens appear in URLs, <strong>the</strong>se are transmitted in <strong>the</strong><br />

Referer header when users follow an off-site link or <strong>the</strong>ir browser loads an offsite<br />

resource.<br />

The final case just described presents an attacker with a highly effective<br />

means of capturing session tokens in some <strong>application</strong>s. For example, if a<br />

<strong>web</strong> mail <strong>application</strong> transmits session tokens within <strong>the</strong> URL, an attacker<br />

can send e-mails to users of <strong>the</strong> <strong>application</strong> containing a link to a <strong>web</strong> server<br />

he controls. If any user accesses <strong>the</strong> link (because she clicks it, or because<br />

her browser loads images contained within HTML-formatted e-mail), <strong>the</strong><br />

attacker receives, in real time, <strong>the</strong> user’s session token. The attacker can run<br />

a simple script on his server to hijack <strong>the</strong> session of every token received and

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

Saved successfully!

Ooh no, something went wrong!