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.

4. The application URL decodes the input as ‘/∗∗/ UNION…<br />

Advanced Topics • Chapter 7 321<br />

5. The application processes the input within an <strong>SQL</strong> query, <strong>and</strong> the attack is<br />

successful.<br />

A further variation on the URL-encoding technique is to use Unicode encodings of<br />

blocked characters. As well as using the % character with a two-digit hexadecimal ASCII<br />

code, URL encoding can employ various Unicode representations of characters. Further,<br />

because of the complexity of the Unicode specification, decoders often tolerate illegal<br />

encodings <strong>and</strong> decode them on a “closest fit” basis. If an application’s input validation checks<br />

for certain literal <strong>and</strong> Unicode-encoded strings, it may be possible to submit illegal encodings<br />

of blocked characters, which will be accepted by the input filter but which will decode<br />

appropriately to deliver a successful attack.<br />

Table 7.1 shows various st<strong>and</strong>ard <strong>and</strong> non-st<strong>and</strong>ard Unicode encodings of characters<br />

that are often useful when performing <strong>SQL</strong> injection attacks.<br />

Table 7.1 St<strong>and</strong>ard <strong>and</strong> Non-St<strong>and</strong>ard<br />

Unicode Encodings of Some Useful Characters<br />

Literal Character<br />

Encoded Equivalent<br />

' %u0027<br />

%u02b9<br />

%u02bc<br />

%u02c8<br />

%u2032<br />

%uff07<br />

%c0%27<br />

%c0%a7<br />

%e0%80%a7<br />

- %u005f<br />

%uff3f<br />

%c0%2d<br />

%c0%ad<br />

%e0%80%ad<br />

/ %u2215<br />

%u2044<br />

%uff0f<br />

%c0%2f<br />

%c0%af<br />

%e0%80%af<br />

Continued

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

Saved successfully!

Ooh no, something went wrong!