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.

774 Chapter 20 n A Web Application Hacker’s Toolkit<br />

Vulnerabilities Detected by Scanners<br />

Several categories of common vulnerabilities can be detected by scanners with<br />

a degree of reliability. These are vulnerabilities with a fairly standard signature.<br />

In some cases, <strong>the</strong> signature exists within <strong>the</strong> <strong>application</strong>’s normal requests and<br />

responses. In o<strong>the</strong>r cases, <strong>the</strong> scanner sends a crafted request designed to trigger<br />

<strong>the</strong> signature if <strong>the</strong> vulnerability is present. If <strong>the</strong> signature appears in <strong>the</strong><br />

<strong>application</strong>’s response to <strong>the</strong> request, <strong>the</strong> scanner infers that <strong>the</strong> vulnerability<br />

is present.<br />

Here are some examples of vulnerabilities that can be detected in this way:<br />

n Reflected cross-site scripting vulnerabilities arise when user-supplied input<br />

is echoed in <strong>the</strong> <strong>application</strong>’s responses without appropriate sanitization.<br />

Automated scanners typically send test strings containing HTML markup<br />

and search <strong>the</strong> responses for <strong>the</strong>se strings, enabling <strong>the</strong>m to detect many<br />

of <strong>the</strong>se flaws.<br />

n Some SQL injection vulnerabilities can be detected via a signature. For<br />

example, submitting a single quotation mark may result in an ODBC error<br />

message, or submitting <strong>the</strong> string ‘; waitfor delay ‘0:0:30’-- may<br />

result in a time delay.<br />

n Some path traversal vulnerabilities can be detected by submitting a traversal<br />

sequence targeting a known file such as win.ini or /etc/passwd<br />

and searching <strong>the</strong> response for <strong>the</strong> appearance of this file.<br />

n Some command injection vulnerabilities can be detected by injecting a<br />

command that causes a time delay or echoes a specific string into <strong>the</strong><br />

<strong>application</strong>’s response.<br />

n Straightforward directory listings can be identified by requesting <strong>the</strong><br />

directory path and looking for a response containing text that looks like<br />

a directory listing.<br />

n Vulnerabilities such as cleartext password submission, liberally scoped<br />

cookies, and forms with autocomplete enabled can be reliably detected<br />

by reviewing <strong>the</strong> normal requests and responses <strong>the</strong> <strong>application</strong> makes.<br />

n Items not linked from <strong>the</strong> main published content, such as backup files<br />

and source files, can often be discovered by requesting each enumerated<br />

resource with a different file extension.<br />

In many of <strong>the</strong>se cases, some instances of <strong>the</strong> same category of vulnerability<br />

cannot be reliably detected using a standard attack string and signature. For<br />

example, with many input-based vulnerabilities, <strong>the</strong> <strong>application</strong> implements some<br />

rudimentary input validation that can be circumvented using crafted input. The<br />

usual attack strings may be blocked or sanitized; however, a skilled attacker can<br />

probe <strong>the</strong> input validation in place and discover a bypass to it. In o<strong>the</strong>r cases,

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

Saved successfully!

Ooh no, something went wrong!