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 15 n Exploiting Information Disclosure 627<br />

computationally intensive operations to validate <strong>the</strong> supplied password<br />

against a stored hash. If an attacker can detect this timing difference, he<br />

may be able to exploit it to enumerate valid usernames.<br />

n Some <strong>application</strong> functions may perform an action on <strong>the</strong> basis of user<br />

input that times out if an item of submitted data is invalid. For example,<br />

an <strong>application</strong> may use a cookie to store <strong>the</strong> address of a host located<br />

behind a front-end load balancer. An attacker may be able to manipulate<br />

this address to scan for <strong>web</strong> servers inside <strong>the</strong> organization’s internal<br />

network. If <strong>the</strong> address of an actual server that is not part of <strong>the</strong> <strong>application</strong><br />

infrastructure is supplied, <strong>the</strong> <strong>application</strong> may immediately return<br />

an error. If a nonexistent address is supplied, <strong>the</strong> <strong>application</strong> may time<br />

out attempting to contact this address before returning <strong>the</strong> same generic<br />

error. You can use <strong>the</strong> response timers within Burp Intruder’s results table<br />

to facilitate this testing. Note that <strong>the</strong>se columns are hidden by default,<br />

but can be shown via <strong>the</strong> Columns menu.<br />

HACK STEPS<br />

1. Differences in <strong>the</strong> timing of <strong>application</strong> responses may be subtle and difficult<br />

to detect. In a typical situation, it is worth probing <strong>the</strong> <strong>application</strong> for<br />

this behavior only in selected key areas where a crucial item of interesting<br />

data is submitted and where <strong>the</strong> kind of processing being performed is<br />

likely to result in time differences.<br />

2. To test a particular function, compile one list containing several items that<br />

are known to be valid (or that have been accessed recently) and a second<br />

list containing items that are known to be invalid (or dormant). Make<br />

requests containing each item on <strong>the</strong>se lists in a controlled way, issuing<br />

only one request at a time, and monitoring <strong>the</strong> time taken for <strong>the</strong> <strong>application</strong><br />

to respond to each request. Determine whe<strong>the</strong>r <strong>the</strong>re is any correlation<br />

between <strong>the</strong> item’s status and <strong>the</strong> time taken to respond.<br />

3. You can use Burp Intruder to automate this task. For every request it generates,<br />

Intruder automatically records <strong>the</strong> time taken before <strong>the</strong> <strong>application</strong><br />

responds and <strong>the</strong> time taken to complete <strong>the</strong> response. You can sort<br />

a table of results by ei<strong>the</strong>r of <strong>the</strong>se attributes to quickly identify any obvious<br />

correlations.<br />

Preventing Information Leakage<br />

Although it may not be feasible or desirable to prevent <strong>the</strong> disclosure of absolutely<br />

any information that an attacker may find useful, various relatively<br />

straightforward measures can be taken to reduce information leakage to a

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

Saved successfully!

Ooh no, something went wrong!