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 21 n A Web Application Hacker’s Methodology 835<br />

7.5.9 If you succeed in gaining write access to arbitrary files on <strong>the</strong> server,<br />

examine whe<strong>the</strong>r any of <strong>the</strong> following attacks are feasible in order to<br />

escalate your attack:<br />

n Creating scripts in users’ startup folders<br />

n Modifying files such as in.ftpd to execute arbitrary commands when<br />

a user next connects<br />

n Writing scripts to a <strong>web</strong> directory with execute permissions and calling<br />

<strong>the</strong>m from your browser<br />

7.6 Test for Script Injection<br />

7.6.1 For each fuzz test you have performed, review <strong>the</strong> results for <strong>the</strong> string<br />

111111 on its own (that is, not preceded by <strong>the</strong> rest of <strong>the</strong> test string).<br />

You can quickly identify <strong>the</strong>se in Burp Intruder by Shift-clicking <strong>the</strong><br />

heading for <strong>the</strong> 111111 Grep string to group all <strong>the</strong> results containing<br />

this string. Look for any that do not have a check in <strong>the</strong> Payload Grep<br />

column. Any cases identified are likely to be vulnerable to injection of<br />

scripting commands.<br />

7.6.2 Review all <strong>the</strong> test cases that used script injection strings, and identify<br />

any containing scripting error messages that may indicate that your input<br />

is being executed but caused an error. These may need to be fine-tuned<br />

to perform successful script injection.<br />

7.6.3 If <strong>the</strong> <strong>application</strong> appears to be vulnerable, verify this by injecting fur<strong>the</strong>r<br />

commands specific to <strong>the</strong> scripting platform in use. For example,<br />

you can use attack payloads similar to those used when fuzzing for OS<br />

command injection:<br />

system(‘ping%20127.0.0.1’)<br />

7.7 Test for File Inclusion<br />

7.7.1 If you received any incoming HTTP connections from <strong>the</strong> target <strong>application</strong>’s<br />

infrastructure during your fuzzing, <strong>the</strong> <strong>application</strong> is almost<br />

certainly vulnerable to remote file inclusion. Repeat <strong>the</strong> relevant tests<br />

in a single-threaded and time-throttled way to determine exactly which<br />

parameters are causing <strong>the</strong> <strong>application</strong> to issue <strong>the</strong> HTTP requests.<br />

7.7.2 Review <strong>the</strong> results of <strong>the</strong> file inclusion test cases, and identify any that<br />

caused an anomalous delay in <strong>the</strong> <strong>application</strong>’s response. In <strong>the</strong>se cases,<br />

it may be that <strong>the</strong> <strong>application</strong> itself is vulnerable but that <strong>the</strong> resulting<br />

HTTP requests are timing out due to network-level filters.

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

Saved successfully!

Ooh no, something went wrong!