19.09.2017 Views

the-web-application-hackers-handbook

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

444 Chapter 12 n Attacking Users: Cross-Site Scripting<br />

This kind of attack is known as virtual defacement because <strong>the</strong> actual content<br />

hosted on <strong>the</strong> target’s <strong>web</strong> server is not modified. The defacement is generated<br />

solely because of how <strong>the</strong> <strong>application</strong> processes and renders user-supplied input.<br />

In addition to frivolous mischief, this kind of attack could be used for serious<br />

criminal purposes. A professionally crafted defacement, delivered to <strong>the</strong><br />

right recipients in a convincing manner, could be picked up by <strong>the</strong> news media<br />

and have real-world effects on people’s behavior, stock prices, and so on, to <strong>the</strong><br />

attacker’s financial benefit, as illustrated in Figure 12-6.<br />

Figure 12-6: A virtual defacement attack exploiting an XSS flaw<br />

Injecting Trojan Functionality<br />

This attack goes beyond virtual defacement and injects actual working functionality<br />

into <strong>the</strong> vulnerable <strong>application</strong>. The intent is to deceive end users into<br />

performing some undesirable action, such as entering sensitive data that is <strong>the</strong>n<br />

transmitted to <strong>the</strong> attacker.<br />

As was described in <strong>the</strong> attack against Apache, an obvious attack involving<br />

injected functionality is to present users with a Trojan login form that submits<br />

<strong>the</strong>ir credentials to a server controlled by <strong>the</strong> attacker. If skillfully executed,<br />

<strong>the</strong> attack may also seamlessly log in <strong>the</strong> user to <strong>the</strong> real <strong>application</strong> so that she<br />

does not detect any anomaly in her experience. The attacker is <strong>the</strong>n free to use<br />

<strong>the</strong> victim’s credentials for his own purposes. This type of payload lends itself<br />

well to a phishing-style attack, in which users are fed a crafted URL within <strong>the</strong><br />

actual au<strong>the</strong>ntic <strong>application</strong> and are advised that <strong>the</strong>y need to log in as normal<br />

to access it.<br />

Ano<strong>the</strong>r obvious attack is to ask users to enter <strong>the</strong>ir credit card details, usually<br />

with <strong>the</strong> inducement of some attractive offer. For example, Figure 12-7 shows a<br />

proof-of-concept attack created by Jim Ley, exploiting a reflected XSS vulnerability<br />

found in Google in 2004.

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

Saved successfully!

Ooh no, something went wrong!