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.

436 Chapter 10 • References<br />

Table 10.15 Extracting Oracle Database Schema<br />

Data<br />

Database name<br />

List schema/users<br />

List table names <strong>and</strong> their schema<br />

List columns<br />

Query<br />

SELECT global_name FROM global_name;<br />

SELECT username FROM all_users;<br />

SELECT owner,table_name FROM all_tables;<br />

SELECT owner, table_name, column_name<br />

FROM all_tab_columns WHERE table_name =<br />

'tblUsers';<br />

Table 10.16 Encryption in the Database<br />

Data<br />

Encrypted<br />

tables<br />

List objects<br />

using crypto<br />

libraries<br />

List PL/<strong>SQL</strong><br />

functions<br />

containing the<br />

string ‘crypt’<br />

Query<br />

SELECT table_name, column_name, encryption_alg, salt FROM dba_<br />

encrypted_columns;<br />

Since Oracle 10g, you can use transparent encryption for<br />

tables. For performance reasons, only the most important<br />

columns are encrypted.<br />

SELECT owner, name, type, referenced_name FROM all_dependencies;<br />

--show objects using database encryption (e.g. for passwords<br />

in 'DBMS_CRYPTO'<strong>and</strong> 'DBMS_OBFUSCATION_TOOLKIT')<br />

SELECT owner,object_name,procedure_name FROM all_procedures<br />

where (lower(object_name) LIKE '%crypt%' or<br />

lower(procedure_name) like '%crypt%') AND object_name not<br />

in ('DBMS_OBFUSCATION_TOOLKIT','DBMS_CRYPTO_TOOLKIT')<br />

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

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

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

Data<br />

String length<br />

Extract substring<br />

from a given string<br />

Query<br />

LENGTH()<br />

SELECT SUBSTR(string, offset, length) FROM dual;<br />

Continued

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

Saved successfully!

Ooh no, something went wrong!