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 10 n Attacking Back-End Components 383<br />

HACK STEPS<br />

To test for remote file inclusion flaws, follow <strong>the</strong>se steps:<br />

1. Submit in each targeted parameter a URL for a resource on a <strong>web</strong> server<br />

that you control, and determine whe<strong>the</strong>r any requests are received from<br />

<strong>the</strong> server hosting <strong>the</strong> target <strong>application</strong>.<br />

2. If <strong>the</strong> first test fails, try submitting a URL containing a nonexistent IP<br />

address, and determine whe<strong>the</strong>r a timeout occurs while <strong>the</strong> server<br />

attempts to connect.<br />

3. If <strong>the</strong> <strong>application</strong> is found to be vulnerable to remote file inclusion, construct<br />

a malicious script using <strong>the</strong> available APIs in <strong>the</strong> relevant language,<br />

as described for dynamic execution attacks.<br />

Local file inclusion vulnerabilities can potentially exist in a much wider<br />

range of scripting environments than those that support remote file inclusion.<br />

To test for local file inclusion vulnerabilities, follow <strong>the</strong>se steps:<br />

1. Submit <strong>the</strong> name of a known executable resource on <strong>the</strong> server, and<br />

determine whe<strong>the</strong>r any change occurs in <strong>the</strong> <strong>application</strong>’s behavior.<br />

2. Submit <strong>the</strong> name of a known static resource on <strong>the</strong> server, and determine<br />

whe<strong>the</strong>r its contents are copied into <strong>the</strong> <strong>application</strong>’s response.<br />

3. If <strong>the</strong> <strong>application</strong> is vulnerable to local file inclusion, attempt to access<br />

any sensitive functionality or resources that you cannot reach directly via<br />

<strong>the</strong> <strong>web</strong> server.<br />

4. Test to see if you can access files in o<strong>the</strong>r directories using <strong>the</strong> traversal<br />

techniques described previously.<br />

Injecting into XML Interpreters<br />

XML is used extensively in today’s <strong>web</strong> <strong>application</strong>s, both in requests and<br />

responses between <strong>the</strong> browser and front-end <strong>application</strong> server and in messages<br />

between back-end <strong>application</strong> components such as SOAP services. Both<br />

of <strong>the</strong>se locations are susceptible to attacks whereby crafted input is used to<br />

interfere with <strong>the</strong> operation of <strong>the</strong> <strong>application</strong> and normally perform some<br />

unauthorized action.

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

Saved successfully!

Ooh no, something went wrong!