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

In cases where sensitive information must be disclosed to an authorized user<br />

(for example, where users can update <strong>the</strong>ir own account information), existing<br />

data should not be disclosed where it is not necessary. For example, stored<br />

credit card numbers should be displayed in truncated form, and password fields<br />

should never be prefilled, even if masked on-screen. These defensive measures<br />

help mitigate <strong>the</strong> impact of any serious vulnerabilities that may exist within <strong>the</strong><br />

<strong>application</strong>’s core security mechanisms of au<strong>the</strong>ntication, session management,<br />

and access control.<br />

Minimize Client-Side Information Leakage<br />

Where possible, service banners should be removed or modified to minimize <strong>the</strong><br />

disclosure of specific software versions and so on. The steps needed to implement<br />

this measure depend on <strong>the</strong> technologies in use. For example, in Microsoft<br />

IIS, <strong>the</strong> Server header can be removed using URLScan in <strong>the</strong> IISLockDown<br />

tool. In later versions of Apache, this can be achieved using <strong>the</strong> mod_headers<br />

module. Because this information is subject to change, it is recommended that<br />

you consult your server documentation before carrying out any modifications.<br />

All comments should be removed from client-side code that is deployed to<br />

<strong>the</strong> live production environment, including all HTML and JavaScript.<br />

You should pay particular attention to any browser extension components<br />

such as Java applets and ActiveX controls. No sensitive information should be<br />

hidden within <strong>the</strong>se components. A skilled attacker can decompile or reverseengineer<br />

<strong>the</strong>se components to effectively recover <strong>the</strong>ir source code (see Chapter 5).<br />

Summary<br />

Leakage of unnecessary information frequently does not present any kind of<br />

significant defect in an <strong>application</strong>’s security. Even highly verbose stack traces<br />

and o<strong>the</strong>r debugging messages may sometimes provide you with little leverage<br />

in seeking to attack <strong>the</strong> <strong>application</strong>.<br />

In o<strong>the</strong>r cases, however, you may discover sources of information that are of<br />

great value in developing your attack. For example, you may find lists of usernames,<br />

<strong>the</strong> precise versions of software components, or <strong>the</strong> internal structure<br />

and functionality of <strong>the</strong> server-side <strong>application</strong> logic.<br />

Because of this possibility, any serious assault on an <strong>application</strong> should include<br />

a forensic examination of both <strong>the</strong> <strong>application</strong> itself and publicly available<br />

resources so that you can ga<strong>the</strong>r any information that may be of use in formulating<br />

your attacks against it. On some occasions, information ga<strong>the</strong>red in this<br />

way can provide <strong>the</strong> foundation for a complete compromise of <strong>the</strong> <strong>application</strong><br />

that disclosed it.

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

Saved successfully!

Ooh no, something went wrong!