19.04.2013 Views

2KKUU7ita

2KKUU7ita

2KKUU7ita

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.

Figure 14-7:<br />

Script code<br />

reflected to<br />

the browser.<br />

Chapter 14: Websites and Applications<br />

If your budget is limited, you may consider using a free SQL injection tool such<br />

as SQL Power Injector (www.sqlpowerinjector.com) or the Firefox Addon,<br />

SQL Inject Me (https://addons.mozilla.org/en-us/firefox/<br />

addon/sql-inject-me).<br />

I cover database security in depth in Chapter 15.<br />

Cross-site scripting<br />

Cross-site scripting (XSS) is perhaps the most well-known web vulnerability<br />

that occurs when a web page displays user input — typically via JavaScript—<br />

that isn’t properly validated. A criminal hacker can take advantage of the<br />

absence of input filtering and cause a web page to execute malicious code on<br />

any user’s computer that views the page.<br />

For example, an XSS attack can display the user ID and password login page<br />

from another rogue website. If users unknowingly enter their user IDs and<br />

passwords in the login page, the user IDs and passwords are entered into the<br />

hacker’s web server log file. Other malicious code can be sent to a victim’s<br />

computer and run with the same security privileges as the web browser or<br />

e-mail application that’s viewing it on the system; the malicious code could<br />

provide a hacker with full Read/Write access to browser cookies, browser<br />

history files, or even permit the download/installation of malware.<br />

A simple test shows whether your web application is vulnerable to XSS. Look<br />

for any fields in the application that accept user input (such as on a login or<br />

search form), and enter the following JavaScript statement:<br />

alert(‘XSS’)<br />

If a window pops up that reads XSS, as shown in Figure 14-7, the application<br />

is vulnerable.<br />

There are many more iterations for exploiting XSS, such as those requiring<br />

user interaction via the JavaScript onmouseover function. As with SQL injection,<br />

you really need to use an automated scanner to check for XSS. Both<br />

WebInspect and Acunetix Web Vulnerability Scanner do a great job of finding<br />

XSS. However, they often tend to find different XSS issues, a detail that highlights<br />

the importance of using multiple scanners when you can. Figure 14-8<br />

shows some sample XSS findings in Acunetix Web Vulnerability Scanner.<br />

291

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

Saved successfully!

Ooh no, something went wrong!