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.

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

TIP Even if <strong>the</strong> <strong>application</strong> does not provide an on-screen field for you to provide<br />

an e-mail address to receive <strong>the</strong> recovery URL, <strong>the</strong> <strong>application</strong> may transmit<br />

<strong>the</strong> address via a hidden form field or cookie. This presents a double opportunity:<br />

you can discover <strong>the</strong> e-mail address of <strong>the</strong> user you have compromised, and you<br />

can modify its value to receive <strong>the</strong> recovery URL at an address of your choosing.<br />

n Some <strong>application</strong>s allow users to reset <strong>the</strong>ir password’s value directly<br />

after successful completion of a challenge and do not send any e-mail<br />

notification to <strong>the</strong> user. This means that <strong>the</strong> compromising of an account<br />

by an attacker will not be noticed until <strong>the</strong> owner attempts to log in<br />

again. It may even remain unnoticed if <strong>the</strong> owner assumes that she<br />

must have forgotten her password and <strong>the</strong>refore resets it in <strong>the</strong> same<br />

way. An attacker who simply desires some access to <strong>the</strong> <strong>application</strong> can<br />

<strong>the</strong>n compromise a different user’s account for a period of time and<br />

<strong>the</strong>refore can continue using <strong>the</strong> <strong>application</strong> indefinitely.<br />

HACK STEPS<br />

1. Identify any forgotten password functionality within <strong>the</strong> <strong>application</strong>. If<br />

this is not explicitly linked from published content, it may still be implemented<br />

(see Chapter 4).<br />

2. Understand how <strong>the</strong> forgotten password function works by doing a<br />

complete walk-through using an account you control.<br />

3. If <strong>the</strong> mechanism uses a challenge, determine whe<strong>the</strong>r users can set or<br />

select <strong>the</strong>ir own challenge and response. If so, use a list of enumerated or<br />

common usernames to harvest a list of challenges, and review this for any<br />

that appear easily guessable.<br />

4. If <strong>the</strong> mechanism uses a password “hint,” do <strong>the</strong> same exercise to harvest<br />

a list of password hints, and target any that are easily guessable.<br />

5. Try to identify any behavior in <strong>the</strong> forgotten password mechanism that<br />

can be exploited as <strong>the</strong> basis for username enumeration or brute-force<br />

attacks (see <strong>the</strong> previous details).<br />

6. If <strong>the</strong> <strong>application</strong> generates an e-mail containing a recovery URL in<br />

response to a forgotten password request, obtain a number of <strong>the</strong>se URLs,<br />

and attempt to identify any patterns that may enable you to predict <strong>the</strong><br />

URLs issued to o<strong>the</strong>r users. Employ <strong>the</strong> same techniques as are relevant to<br />

analyzing session tokens for predictability (see Chapter 7).<br />

TRY IT!<br />

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

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

http://mdsec.net/auth/151/

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

Saved successfully!

Ooh no, something went wrong!