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.

276 Chapter 6 • Exploiting the Operating System<br />

Now, since the focus of this book is <strong>SQL</strong> injection, it would probably make sense to<br />

observe this within an injected <strong>SQL</strong> statement. To test this, consider the fictitious <strong>and</strong><br />

vulnerable intranet site (shown in Figure 6.1) that allows a user to search for customers.<br />

Figure 6.1 Sample Vulnerable Intranet Application<br />

The site is vulnerable to injection, <strong>and</strong> since it returns output directly to your browser it<br />

is a prime c<strong>and</strong>idate for a union statement. For purposes of illustration, this site also displays<br />

the actual generated <strong>SQL</strong> query as a DEBUG message. The results of a simple search for “a”<br />

appear in Figure 6.2.

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

Saved successfully!

Ooh no, something went wrong!