19.04.2013 Views

2KKUU7ita

2KKUU7ita

2KKUU7ita

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

288<br />

Part V: Hacking Applications<br />

The web application might respond in a way that gives attackers more information<br />

than they want, such as detailed errors or access into data fields<br />

they’re not authorized to access. The invalid input might also cause the<br />

application or the server to hang. Similar to the case study earlier in the<br />

chapter, hackers can use this information to determine more about the web<br />

application and its inner workings, which can ultimately lead to a serious<br />

system compromise.<br />

If HTTP variables are passed in the URL and are easily accessible, it’s only a<br />

matter of time before someone exploits your web application.<br />

I once used a web application to manage some personal information that did<br />

just this. Because a “name” parameter was part of the URL, anyone could<br />

gain access to other people’s personal information by changing the “name”<br />

value. For example, if the URL included “name=kbeaver”, a simple change<br />

to “name=jsmith” would bring up J. Smith’s home address, Social Security<br />

number, and so on. Ouch. I alerted the system administrator to this vulnerability.<br />

After a few minutes of denial, he agreed that it was indeed a problem<br />

and proceeded to work with the developers to fix it.<br />

Code injection can also be carried out against back-end SQL databases — an<br />

attack known as SQL injection. Malicious attackers insert SQL statements,<br />

such as CONNECT, SELECT, and UNION, into URL requests to attempt to connect<br />

and extract information from the SQL database that the web application<br />

interacts with. SQL injection is made possible by applications not properly<br />

validating input combined with informative errors returned from database<br />

servers and web servers.<br />

Two general types of SQL injection are standard (also called error-based)<br />

and blind. Error-based SQL injection is exploited based on error messages<br />

returned from the application when invalid information is input into the<br />

system. Blind SQL injection happens when error messages are disabled,<br />

requiring the hacker or automated tool to guess what the database is returning<br />

and how it’s responding to injection attacks.<br />

There’s a quick, fairly reliable way to determine whether your web application<br />

is vulnerable to SQL injection. Simply enter a single apostrophe (’) in<br />

your web form fields or at the end of the URL. If a SQL error is returned, odds<br />

are good that SQL injection is present. You’re definitely going to get what you<br />

pay for when it comes to scanning for and uncovering SQL injection with a<br />

web vulnerability scanner. As with URL manipulation, you’re much better off<br />

running a web vulnerability scanner to check for SQL injection. Figure 14-4<br />

shows numerous SQL injection vulnerabilities discovered by the WebInspect<br />

vulnerability scanner.

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

Saved successfully!

Ooh no, something went wrong!