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.

Chapter 4 n Mapping <strong>the</strong> Application 85<br />

regardless of au<strong>the</strong>ntication status or privilege level. It often occurs when<br />

directories are requested, and you may infer that <strong>the</strong> directory exists.<br />

n 500 Internal Server Error — During content discovery, this usually<br />

indicates that <strong>the</strong> <strong>application</strong> expects certain parameters to be submitted<br />

when requesting <strong>the</strong> resource.<br />

The various possible responses that may indicate <strong>the</strong> presence of interesting<br />

content mean that is difficult to write a fully automated script to output a listing<br />

of valid resources. The best approach is to capture as much information as<br />

possible about <strong>the</strong> <strong>application</strong>’s responses during <strong>the</strong> brute-force exercise and<br />

manually review it.<br />

HACK STEPS<br />

1. Make some manual requests for known valid and invalid resources, and<br />

identify how <strong>the</strong> server handles <strong>the</strong> latter.<br />

2. Use <strong>the</strong> site map generated through user-directed spidering as a basis for<br />

automated discovery of hidden content.<br />

3. Make automated requests for common filenames and directories within<br />

each directory or path known to exist within <strong>the</strong> <strong>application</strong>. Use Burp<br />

Intruder or a custom script, toge<strong>the</strong>r with wordlists of common files and<br />

directories, to quickly generate large numbers of requests. If you have identified<br />

a particular way in which <strong>the</strong> <strong>application</strong> handles requests for invalid<br />

resources (such as a customized “file not found” page), configure Intruder<br />

or your script to highlight <strong>the</strong>se results so that <strong>the</strong>y can be ignored.<br />

4. Capture <strong>the</strong> responses received from <strong>the</strong> server, and manually review<br />

<strong>the</strong>m to identify valid resources.<br />

5. Perform <strong>the</strong> exercise recursively as new content is discovered.<br />

Inference from Published Content<br />

Most <strong>application</strong>s employ some kind of naming scheme for <strong>the</strong>ir content and<br />

functionality. By inferring from <strong>the</strong> resources already identified within <strong>the</strong><br />

<strong>application</strong>, it is possible to fine-tune your automated enumeration exercise to<br />

increase <strong>the</strong> likelihood of discovering fur<strong>the</strong>r hidden content.<br />

In <strong>the</strong> EIS <strong>application</strong>, note that all resources in /auth start with a capital letter.<br />

This is why <strong>the</strong> wordlist used in <strong>the</strong> file brute forcing in <strong>the</strong> previous section<br />

was deliberately capitalized. Fur<strong>the</strong>rmore, since we have already identified a<br />

page called ForgotPassword in <strong>the</strong> /auth directory, we can search for similarly<br />

named items, such as <strong>the</strong> following:<br />

http://eis/auth/ResetPassword

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

Saved successfully!

Ooh no, something went wrong!