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.

Testing for <strong>SQL</strong> <strong>Injection</strong> • Chapter 2 33<br />

The values sent to the Web server have the same format explained for the GET request,<br />

but are now located at the bottom of the request.<br />

No t e<br />

Keep one thing in mind: It doesn’t matter how this data is presented to you<br />

in the browser. Some of the values might be hidden fields within the form,<br />

<strong>and</strong> others might be drop-down fields with a set of choices; you may have<br />

size limits, or even disabled fields.<br />

Remember that all of this is just client-side functionality, <strong>and</strong> you have<br />

full control of what you send to the server. Do not think of client-side<br />

interface mechanisms as security functionality.<br />

You may be wondering how you modify data if the browser is not allowing you to do<br />

so. There are a couple of ways to do this:<br />

■■<br />

■■<br />

Browser modification extensions<br />

Proxy servers<br />

Browser modification extensions are plug-ins that run on your browser <strong>and</strong> allow you to<br />

perform some additional functionality. For example, the Web Developer (https://addons.mozilla.<br />

org/en-US/firefox/addon/60) extension for Mozilla Firefox allows you to visualize hidden<br />

fields, remove size limitations, <strong>and</strong> convert select fields into input fields, among other tasks.<br />

This can be very useful when trying to manipulate data sent to the server. Tamper Data<br />

(https://addons.mozilla.org/en-US/firefox/addon/966) is another interesting extension available<br />

for Firefox. You can use Tamper Data to view <strong>and</strong> modify headers <strong>and</strong> POST parameters in<br />

HTTP <strong>and</strong> HTTPS requests. Another option is <strong>SQL</strong> Inject Me (https://addons.mozilla.org/<br />

en-US/firefox/addon/7597). This tool sends database escape strings through the form fields<br />

found in the HTML page.<br />

The second solution is the use of a local proxy. A local proxy is a piece of software that<br />

sits between your browser <strong>and</strong> the server, as shown in Figure 2.1. The software runs locally<br />

on your computer; however, the figure shows a logical representation of a local proxy setup.

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

Saved successfully!

Ooh no, something went wrong!