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.

140 Chapter 4 • Exploiting <strong>SQL</strong> <strong>Injection</strong><br />

For our examples, we’ll introduce the companion that will be with us throughout most<br />

of the examples in this chapter: a vulnerable e-commerce application belonging to our usual<br />

victim.com friends. This application has a page that allows a user to browse the different<br />

products. The URL is as follows:<br />

■■<br />

http://www.victim.com/products.asp?id=12<br />

When this URL is requested, the application returns a page with the details of the product<br />

with an id value of 12 (say, a nice Syngress book on <strong>SQL</strong> injection), as shown in Figure 4.1.<br />

Figure 4.1 The Product Description Page of a Sample E-Commerce Site<br />

Let’s say the id parameter is vulnerable to <strong>SQL</strong> injection. It’s a numeric parameter, <strong>and</strong><br />

therefore in our examples we will not need to use single quotes to terminate any strings.<br />

But the same concepts that we will explore along the way are obviously valid for other<br />

types of data. We will also assume that victim.com uses Microsoft <strong>SQL</strong> Server as its backend<br />

database (even though the chapter will also contain several examples for other

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

Saved successfully!

Ooh no, something went wrong!