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.

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

made and to help you spot <strong>the</strong> subtle logic flaw that can be exploited to walk<br />

right through <strong>the</strong> door.<br />

The most important lesson when attacking au<strong>the</strong>ntication functionality is to<br />

look everywhere. In addition to <strong>the</strong> main login form, <strong>the</strong>re may be functions to<br />

register new accounts, change passwords, remember passwords, recover forgotten<br />

passwords, and impersonate o<strong>the</strong>r users. Each of <strong>the</strong>se presents a rich target of<br />

potential defects, and problems that have been consciously eliminated within<br />

one function often reemerge within o<strong>the</strong>rs. Invest <strong>the</strong> time to scrutinize and<br />

probe every inch of attack surface you can find, and your rewards may be great.<br />

Questions<br />

Answers can be found at http://mdsec.net/wahh.<br />

1. While testing a <strong>web</strong> <strong>application</strong>, you log in using your credentials of joe<br />

and pass. During <strong>the</strong> login process, you see a request for <strong>the</strong> following<br />

URL appear in your intercepting proxy:<br />

http://www.wahh-app.com/app?action=login&uname=joe&password=pass<br />

What three vulnerabilities can you diagnose without probing any fur<strong>the</strong>r?<br />

2. How can self-registration functions introduce username enumeration<br />

vulnerabilities? How can <strong>the</strong>se vulnerabilities be prevented?<br />

3. A login mechanism involves <strong>the</strong> following steps:<br />

(a) The <strong>application</strong> requests <strong>the</strong> user’s username and passcode.<br />

(b) The <strong>application</strong> requests two randomly chosen letters from <strong>the</strong> user’s<br />

memorable word.<br />

Why is <strong>the</strong> required information requested in two separate steps? What<br />

defect would <strong>the</strong> mechanism contain if this were not <strong>the</strong> case?<br />

4. A multistage login mechanism first requests <strong>the</strong> user’s username and<br />

<strong>the</strong>n various o<strong>the</strong>r items across successive stages. If any supplied item is<br />

invalid, <strong>the</strong> user is immediately returned to <strong>the</strong> first stage.<br />

What is wrong with this mechanism, and how can <strong>the</strong> vulnerability be<br />

corrected?<br />

5. An <strong>application</strong> incorporates an antiphishing mechanism into its login<br />

functionality. During registration, each user selects a specific image from<br />

a large bank of memorable images that <strong>the</strong> <strong>application</strong> presents to her.<br />

The login function involves <strong>the</strong> following steps:<br />

(a) The user enters her username and date of birth.

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

Saved successfully!

Ooh no, something went wrong!