28.10.2014 Views

SQL Injection Attacks and Defense - 2009

SQL Injection Attacks and Defense - 2009

SQL Injection Attacks and Defense - 2009

SHOW MORE
SHOW LESS

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

Advanced Topics • Chapter 7 339<br />

˛˛ Look for logic flaws in multistep filters, such as the failure to strip expressions<br />

recursively, or unsafe truncation of input.<br />

˛˛ If effective applicationwide filters are in place, look for non-st<strong>and</strong>ard entry points<br />

which the filters may overlook, such as parameter names <strong>and</strong> HTTP request<br />

headers.<br />

Exploiting Second-Order <strong>SQL</strong> <strong>Injection</strong><br />

˛˛ Review the application’s functionality, looking for cases where user-supplied data is<br />

stored <strong>and</strong> reused.<br />

˛˛ Submit a single quotation mark in each item of data. If your input is blocked or<br />

sanitized, use the filter evasion techniques described in this chapter to attempt to<br />

defeat the filters.<br />

˛˛ Walk through the relevant functionality where the data is used, looking for<br />

anomalous behavior.<br />

˛˛ For each anomaly detected, try to develop a proof-of-concept attack to prove that<br />

the application is in fact vulnerable to <strong>SQL</strong> injection. If no error information is<br />

returned, try using time delay strings to induce a noticeable delay in the relevant<br />

responses.<br />

Using Hybrid <strong>Attacks</strong><br />

˛˛ Anytime you discover an <strong>SQL</strong> injection vulnerability, think about how you can<br />

combine it with other bugs <strong>and</strong> techniques to deliver a more sophisticated<br />

compromise of the application.<br />

˛˛ Always look for ways to use data retrieved via <strong>SQL</strong> injection, such as usernames<br />

<strong>and</strong> passwords, to escalate your attack against the application.<br />

˛˛ You can often use <strong>SQL</strong> injection to perform cross-site scripting attacks within an<br />

application, most significantly persistent attacks which will compromise other users<br />

who are accessing the application in the normal way.<br />

˛˛ If you discover <strong>SQL</strong> injection vulnerabilities in privileged authenticated application<br />

functions, examine whether you can use cross-site request forgery to deliver<br />

a successful attack as a low-privileged user.

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

Saved successfully!

Ooh no, something went wrong!