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.

Platform-Level <strong>Defense</strong>s • Chapter 9 403<br />

Table 9.1 Determining <strong>SQL</strong> Server/Oracle Database Server Versions<br />

Database Comm<strong>and</strong> Version Reference<br />

<strong>SQL</strong> Server select @@version www.sqlsecurity.com/FAQs/<br />

<strong>SQL</strong>Server<br />

VersionDatabase/tabid/63/<br />

Default.aspx<br />

Oracle<br />

-- show database version www.oracle.com/technology/<br />

support/patches.htm<br />

select * from v$version;<br />

-- show version of<br />

installed components<br />

select * from dba_registry;<br />

- show patchlevel<br />

select * from<br />

dba_registry_history;<br />

Additional Deployment Considerations<br />

This section covers additional security measures to help you secure deployed applications.<br />

These are primarily configuration enhancements to the Web server <strong>and</strong> network infrastructure<br />

to help slow the identification of applications that are potentially vulnerable to <strong>SQL</strong> injection.<br />

These techniques can be useful as a first layer to prevent detection by automated <strong>SQL</strong> injection<br />

worms that are becoming increasingly prevalent <strong>and</strong> dangerous. Additionally, we’ll look<br />

at techniques to slow <strong>and</strong>/or mitigate exploitation once <strong>SQL</strong> injection has been identified.<br />

Minimize Unnecessary Information Leakage<br />

In general, leaking unnecessary information about software behavior significantly aides an<br />

attacker in finding weaknesses within your application. Examples include software version<br />

information that can be used to footprint a potentially vulnerable version of an application,<br />

<strong>and</strong> error details related to an application failure, such as an <strong>SQL</strong> syntax error that occurs on<br />

the database server. We’re going to look at ways to suppress this information declaratively<br />

within application deployment descriptor files <strong>and</strong> hardening the Web server configuration.<br />

Suppress Error Messages<br />

Error messages that include information detailing why a database server failed are<br />

extremely useful in the identification <strong>and</strong> subsequent exploitation of <strong>SQL</strong> injection.<br />

H<strong>and</strong>ling exceptions <strong>and</strong> suppression of error messages is most effective when done with<br />

application-level error h<strong>and</strong>lers. However, inevitably there is always the possibility of an

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

Saved successfully!

Ooh no, something went wrong!