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 6 n Attacking Au<strong>the</strong>ntication 171<br />

HACK STEPS<br />

1. Carry out a successful login while monitoring all traffic in both directions<br />

between <strong>the</strong> client and server.<br />

2. Identify every case in which <strong>the</strong> credentials are transmitted in ei<strong>the</strong>r<br />

direction. You can set interception rules in your intercepting proxy to flag<br />

messages containing specific strings (see Chapter 20).<br />

3. If any instances are found in which credentials are submitted in a URL<br />

query string or as a cookie, or are transmitted back from <strong>the</strong> server to <strong>the</strong><br />

client, understand what is happening, and try to ascertain what purpose<br />

<strong>the</strong> <strong>application</strong> developers were attempting to achieve. Try to find every<br />

means by which an attacker might interfere with <strong>the</strong> <strong>application</strong>’s logic to<br />

compromise o<strong>the</strong>r users’ credentials.<br />

4. If any sensitive information is transmitted over an unencrypted channel,<br />

this is, of course, vulnerable to interception.<br />

5. If no cases of actual credentials being transmitted insecurely are identified,<br />

pay close attention to any data that appears to be encoded or<br />

obfuscated. If this includes sensitive data, it may be possible to reverseengineer<br />

<strong>the</strong> obfuscation algorithm.<br />

6. If credentials are submitted using HTTPS but <strong>the</strong> login form is loaded<br />

using HTTP, <strong>the</strong> <strong>application</strong> is vulnerable to a man-in-<strong>the</strong>-middle attack,<br />

which may be used to capture credentials.<br />

TRY IT!<br />

http://mdsec.net/auth/88/<br />

http://mdsec.net/auth/90/<br />

http://mdsec.net/auth/97/<br />

Password Change Functionality<br />

Surprisingly, many <strong>web</strong> <strong>application</strong>s do not provide any way for users to change<br />

<strong>the</strong>ir password. However, this functionality is necessary for a well-designed<br />

au<strong>the</strong>ntication mechanism for two reasons:<br />

n Periodic enforced password change mitigates <strong>the</strong> threat of password compromise.<br />

It reduces <strong>the</strong> window in which a given password can be targeted<br />

in a guessing attack. It also reduces <strong>the</strong> window in which a compromised<br />

password can be used without detection by <strong>the</strong> attacker.<br />

n Users who suspect that <strong>the</strong>ir passwords may have been compromised<br />

need to be able to quickly change <strong>the</strong>ir password to reduce <strong>the</strong> threat of<br />

unauthorized use.

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

Saved successfully!

Ooh no, something went wrong!