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 165<br />

3. If <strong>the</strong> account is locked out, try repeating <strong>the</strong> exercise using a different<br />

account. This time, if <strong>the</strong> <strong>application</strong> issues any cookies, use each cookie<br />

for only a single login attempt, and obtain a new cookie for each subsequent<br />

login attempt.<br />

4. Also, if <strong>the</strong> account is locked out, see whe<strong>the</strong>r submitting <strong>the</strong> valid password<br />

causes any difference in <strong>the</strong> <strong>application</strong>’s behavior compared to an<br />

invalid password. If so, you can continue a password-guessing attack even<br />

if <strong>the</strong> account is locked out.<br />

5. If you do not control any accounts, attempt to enumerate a valid username<br />

(see <strong>the</strong> next section) and make several bad logins using this.<br />

Monitor for any error messages about account lockout.<br />

6. To mount a brute-force attack, first identify a difference in <strong>the</strong> <strong>application</strong>’s<br />

behavior in response to successful and failed logins. You can use<br />

this fact to discriminate between success and failure during <strong>the</strong> course of<br />

<strong>the</strong> automated attack.<br />

7. Obtain a list of enumerated or common usernames and a list of common<br />

passwords. Use any information obtained about password quality rules to<br />

tailor <strong>the</strong> password list so as to avoid superfluous test cases.<br />

8. Use a suitable tool or a custom script to quickly generate login requests<br />

using all permutations of <strong>the</strong>se usernames and passwords. Monitor<br />

<strong>the</strong> server’s responses to identify successful login attempts. Chapter 14<br />

describes in detail various techniques and tools for performing customized<br />

attacks using automation.<br />

9. If you are targeting several usernames at once, it is usually preferable<br />

to perform this kind of brute-force attack in a breadth-first ra<strong>the</strong>r than<br />

depth-first manner. This involves iterating through a list of passwords<br />

(starting with <strong>the</strong> most common) and attempting each password in turn<br />

on every username. This approach has two benefits. First, you discover<br />

accounts with common passwords more quickly. Second, you are less<br />

likely to trigger any account lockout defenses, because <strong>the</strong>re is a time<br />

delay between successive attempts using each individual account.<br />

TRY IT!<br />

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

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

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

http://mdsec.net/auth/49/

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

Saved successfully!

Ooh no, something went wrong!