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 18 n Attacking <strong>the</strong> Application Server 673<br />

cross-site scripting if an attacker simply includes script tags in <strong>the</strong> URL, such<br />

as /test/jsp/dump.jsp?%3Cscript%3Ealert(%22xss%22)%3C/script%3E.<br />

An example of <strong>the</strong> second problem is <strong>the</strong> Sessions Example script shipped<br />

with Apache Tomcat. As shown in Figure 18-2, this can be used to get and set<br />

arbitrary session variables. If an <strong>application</strong> running on <strong>the</strong> server stores sensitive<br />

data in a user’s session, an attacker can view this and may be able to interfere<br />

with <strong>the</strong> <strong>application</strong>’s processing by modifying its value.<br />

Figure 18-2: The default Sessions Example script shipped with Apache Tomcat<br />

Powerful Functions<br />

Some <strong>web</strong> server software contains powerful functionality that is not intended<br />

to be used by <strong>the</strong> public but that can be accessed by end users through some<br />

means. In many cases <strong>application</strong> servers actually allow <strong>web</strong> archives (WAR<br />

files) to be deployed over <strong>the</strong> same HTTP port as that used by <strong>the</strong> <strong>application</strong><br />

itself, given <strong>the</strong> correct administrative credentials. This deployment process for<br />

an <strong>application</strong> server is a prime target for <strong>hackers</strong>. Common exploit frameworks<br />

can automate <strong>the</strong> process of scanning for default credentials, uploading a <strong>web</strong><br />

archive containing a backdoor, and executing it to get a command shell on <strong>the</strong><br />

remote system, as shown in Figure 18-3.

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

Saved successfully!

Ooh no, something went wrong!