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

details (for example, checking whe<strong>the</strong>r <strong>the</strong> account is expired), and <strong>the</strong>n validate<br />

<strong>the</strong> password (which may involve a resource-intensive hash algorithm) before<br />

returning a generic message if <strong>the</strong> password is incorrect. The timing difference<br />

between <strong>the</strong> two responses may be too subtle to detect when working with only<br />

a browser, but an automated tool may be able to discriminate between <strong>the</strong>m.<br />

Even if <strong>the</strong> results of such an exercise contain a large ratio of false positives, it<br />

is still better to have a list of 100 usernames, approximately 50% of which are<br />

valid, than a list of 10,000 usernames, approximately 0.5% of which are valid.<br />

See Chapter 15 for a detailed explanation of how to detect and exploit this type<br />

of timing difference to extract information from <strong>the</strong> <strong>application</strong>.<br />

TIP In addition to <strong>the</strong> login functionality itself, <strong>the</strong>re may be o<strong>the</strong>r sources of<br />

information where you can obtain valid usernames. Review all <strong>the</strong> source code<br />

comments discovered during <strong>application</strong> mapping (see Chapter 4) to identify<br />

any apparent usernames. Any e-mail addresses of developers or o<strong>the</strong>r personnel<br />

within <strong>the</strong> organization may be valid usernames, ei<strong>the</strong>r in full or just <strong>the</strong> userspecific<br />

prefix. Any accessible logging functionality may disclose usernames.<br />

TRY IT!<br />

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

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

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

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

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

Vulnerable Transmission of Credentials<br />

If an <strong>application</strong> uses an unencrypted HTTP connection to transmit login credentials,<br />

an eavesdropper who is suitably positioned on <strong>the</strong> network can, of<br />

course, intercept <strong>the</strong>m. Depending on <strong>the</strong> user’s location, potential eavesdroppers<br />

may reside:<br />

n On <strong>the</strong> user’s local network<br />

n Within <strong>the</strong> user’s IT department<br />

n Within <strong>the</strong> user’s ISP<br />

n On <strong>the</strong> Internet backbone<br />

n Within <strong>the</strong> ISP hosting <strong>the</strong> <strong>application</strong><br />

n Within <strong>the</strong> IT department managing <strong>the</strong> <strong>application</strong>

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

Saved successfully!

Ooh no, something went wrong!