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.

224 Chapter 5 • Blind <strong>SQL</strong> <strong>Injection</strong> Exploitation<br />

Wa r n in g<br />

Logical operators, although useable, are not suitable for numeric parameters<br />

as they depend on the value of .<br />

Table 5.1 Split <strong>and</strong> Balanced Strings with Subquery Placeholders<br />

Database Numeric Parameter String Parameters Date Parameters<br />

My<strong>SQL</strong><br />

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

Oracle<br />

<br />

(…)<br />

is<br />

one of:<br />

+ – * /<br />

& | ^ xor<br />

<br />

(…)<br />

is<br />

one of:<br />

+ – * /<br />

& | ^<br />

<br />

(…)<br />

is<br />

one of:<br />

+ – * / ||<br />

Not possible to split<br />

<strong>and</strong> balance without<br />

side effects. Subqueries<br />

can be easily executed,<br />

but this would change<br />

the result of the<br />

query.<br />

If the My<strong>SQL</strong><br />

database was<br />

started in ANSI<br />

mode, the || operator<br />

is available for string<br />

concatenation in<br />

subqueries:<br />

'<br />

|| (…) ||<br />

'<br />

'<br />

+ (…) + '<br />

'<br />

|| (…) ||<br />

'<br />

must be<br />

rewritten to<br />

remove non-numeric<br />

characters; e.g.,<br />

2008-12-30 becomes<br />

20081230.<br />

Where the date is<br />

treated as a string<br />

in the <strong>SQL</strong> query:<br />

'<br />

<br />

(…)<br />

Where the date is<br />

treated as a number<br />

in the <strong>SQL</strong> query:<br />

<br />

<br />

(…)<br />

is<br />

one of:<br />

+ – |<br />

|| ^ xor<br />

'<br />

+ (…) +<br />

'<br />

'<br />

|| (…)<br />

|| '

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

Saved successfully!

Ooh no, something went wrong!