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.

672 Chapter 18 n Attacking <strong>the</strong> Application Server<br />

Figure 18-1 shows <strong>the</strong> default page phpinfo.php, which exists on many Apache<br />

installations. This page simply executes <strong>the</strong> PHP function phpinfo() and returns<br />

<strong>the</strong> output. It contains a wealth of information about <strong>the</strong> PHP environment,<br />

configuration settings, <strong>web</strong> server modules, and file paths.<br />

Figure 18-1: The default page phpinfo.php<br />

Sample Functionality<br />

By default many servers include various sample scripts and pages designed to<br />

demonstrate how certain <strong>application</strong> server functions and APIs can be used.<br />

Typically, <strong>the</strong>se are intended to be innocuous and to provide no opportunities<br />

for an attacker. However, in practice this has not been <strong>the</strong> case, for two reasons:<br />

n Many sample scripts contain security vulnerabilities that can be exploited<br />

to perform actions not intended by <strong>the</strong> scripts’ authors.<br />

n Many sample scripts actually implement functionality that is of direct<br />

use to an attacker.<br />

An example of <strong>the</strong> first problem is <strong>the</strong> Dump Servlet included in Jetty version<br />

7.0.0. This servlet can be accessed from a URL such as /test/jsp/dump<br />

.jsp. When it is accessed, it prints various details of <strong>the</strong> Jetty installation and<br />

<strong>the</strong> current request, including <strong>the</strong> request query string. This allows for simple

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

Saved successfully!

Ooh no, something went wrong!