19.09.2017 Views

the-web-application-hackers-handbook

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

Chapter 17 n Attacking Application Architecture 661<br />

<br />

<br />

apache<br />

<br />

<br />

Because <strong>the</strong> malicious customer’s commands are executing as <strong>the</strong> Apache<br />

user, it is likely that this will allow access to <strong>the</strong> scripts and data belonging to<br />

o<strong>the</strong>r customers of <strong>the</strong> shared hosting service.<br />

This kind of threat also exists in <strong>the</strong> context of an ASP-managed shared <strong>application</strong>.<br />

Although <strong>the</strong> core <strong>application</strong> functionality is owned and updated by<br />

<strong>the</strong> ASP, individual customers typically can modify this functionality in certain<br />

defined ways. A malicious customer may introduce subtle backdoors into code<br />

that he controls, enabling him to compromise <strong>the</strong> shared <strong>application</strong> and gain<br />

access to o<strong>the</strong>r customers’ data.<br />

TIP Backdoor scripts can be created in most <strong>web</strong> scripting languages. For<br />

more examples of scripts in o<strong>the</strong>r languages, see http://net-square.com/<br />

papers/one_way/one_way.html#4.0.<br />

Attacks Between Vulnerable Applications<br />

Even if all customers in a shared environment are benign, and upload only<br />

legitimate scripts that are validated by <strong>the</strong> environment’s owner, attacks between<br />

<strong>application</strong>s will, of course, be possible if vulnerabilities unwittingly exist within<br />

<strong>the</strong> <strong>application</strong>s of individual customers. In this situation, one vulnerability<br />

within a single <strong>application</strong> may enable a malicious user to compromise both<br />

that <strong>application</strong> and all o<strong>the</strong>rs hosted within <strong>the</strong> shared environment. Many<br />

types of common vulnerability fall into this category. For example:<br />

n A SQL injection flaw in one <strong>application</strong> may enable an attacker to perform<br />

arbitrary SQL queries on <strong>the</strong> shared database. If database access is<br />

inadequately segregated between different customers, an attacker may<br />

be able to read and modify <strong>the</strong> data used by all <strong>application</strong>s.<br />

n A path traversal vulnerability in one <strong>application</strong> may enable an attacker<br />

to read or write arbitrary files anywhere on <strong>the</strong> server filesystem, including<br />

those belonging to o<strong>the</strong>r <strong>application</strong>s.<br />

n A command injection flaw in one <strong>application</strong> may enable an attacker to<br />

compromise <strong>the</strong> server and, <strong>the</strong>refore, <strong>the</strong> o<strong>the</strong>r <strong>application</strong>s hosted on<br />

it, in <strong>the</strong> same way as described for a malicious customer.<br />

Attacks Between ASP Application Components<br />

The possible attacks described previously may all arise in <strong>the</strong> context of a<br />

shared ASP <strong>application</strong>. Because customers typically can perform <strong>the</strong>ir own

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

Saved successfully!

Ooh no, something went wrong!