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.

186 Chapter 6 n Attacking Au<strong>the</strong>ntication<br />

are made, in which many potential errors may arise and be handled in different<br />

places, and where <strong>the</strong> more complicated validation logic may involve maintaining<br />

significant state about <strong>the</strong> login’s progress.<br />

HACK STEPS<br />

1. Perform a complete, valid login using an account you control. Record<br />

every piece of data submitted to <strong>the</strong> <strong>application</strong>, and every response<br />

received, using your intercepting proxy.<br />

2. Repeat <strong>the</strong> login process numerous times, modifying pieces of <strong>the</strong> data<br />

submitted in unexpected ways. For example, for each request parameter<br />

or cookie sent by <strong>the</strong> client, do <strong>the</strong> following:<br />

a. Submit an empty string as <strong>the</strong> value.<br />

b. Remove <strong>the</strong> name/value pair altoge<strong>the</strong>r.<br />

c. Submit very long and very short values.<br />

d. Submit strings instead of numbers and vice versa.<br />

e. Submit <strong>the</strong> same item multiple times, with <strong>the</strong> same and different<br />

values.<br />

3. For each malformed request submitted, review closely <strong>the</strong> <strong>application</strong>’s<br />

response to identify any divergences from <strong>the</strong> base case.<br />

4. Feed <strong>the</strong>se observations back into framing your test cases. When one<br />

modification causes a change in behavior, try to combine this with o<strong>the</strong>r<br />

changes to push <strong>the</strong> <strong>application</strong>’s logic to its limits.<br />

TRY IT!<br />

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

Defects in Multistage Login Mechanisms<br />

Some <strong>application</strong>s use elaborate login mechanisms involving multiple stages,<br />

such as <strong>the</strong> following:<br />

n Entry of a username and password<br />

n A challenge for specific digits from a PIN or a memorable word<br />

n The submission of a value displayed on a changing physical token<br />

Multistage login mechanisms are designed to provide enhanced security over<br />

<strong>the</strong> simple model based on username and password. Typically, <strong>the</strong> first stage<br />

requires <strong>the</strong> users to identify <strong>the</strong>mselves with a username or similar item, and<br />

subsequent stages perform various au<strong>the</strong>ntication checks. Such mechanisms

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

Saved successfully!

Ooh no, something went wrong!