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.

References • Chapter 10 451<br />

Informix Cheat Sheet<br />

The Informix database server is distributed by IBM <strong>and</strong> is not commonly encountered<br />

when compared to other database platforms. The following reference should help if you<br />

encounter an Informix server in the wild.<br />

Enumerating Database<br />

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

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

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

Table 10.27 Extracting Informix Database Configuration Information<br />

Data<br />

Version<br />

Query<br />

SELECT DBINFO('version', 'full') FROM systables WHERE<br />

tabid = 1;<br />

Current user SELECT USER FROM systables WHERE tabid = 1;<br />

List users<br />

Current user<br />

privileges<br />

Database server<br />

host name<br />

select usertype,username, password from sysusers;<br />

select tabname, tabauth, grantor, grantee FROM<br />

systabauth join systables on systables.tabid =<br />

systabauth.tabid<br />

SELECT DBINFO('dbhostname') FROM systables WHERE<br />

tabid=1;<br />

Table 10.28 Extracting Informix Database Schema<br />

Data<br />

Query<br />

Current database SELECT DBSERVERNAME FROM systables WHERE tabid = 1;<br />

List databases<br />

List tables<br />

SELECT name, owner FROM sysdatabases;<br />

SELECT tabname FROM systables;<br />

List columns<br />

SELECT tabname, viewtext FROM sysviews join systables<br />

on systables.tabid = sysviews.tabid;<br />

SELECT tabname, colname, coltype FROM<br />

syscolumns join systables on syscolumns.tabid =<br />

systables.tabid;

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

Saved successfully!

Ooh no, something went wrong!