19.09.2017 Views

the-web-application-hackers-handbook

Create successful ePaper yourself

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

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

had nearly one million friend requests. As a result, MySpace had to take <strong>the</strong><br />

<strong>application</strong> offline, remove <strong>the</strong> malicious script from <strong>the</strong> profiles of all its users,<br />

and fix <strong>the</strong> defect in its anti-XSS filters.<br />

For more details on this attack, see this URL:<br />

http://namb.la/popular/tech.html<br />

Web mail <strong>application</strong>s are inherently at risk of stored XSS attacks because<br />

of how <strong>the</strong>y render e-mail messages in-browser when viewed by <strong>the</strong> recipient.<br />

E-mails may contain HTML-formatted content, so <strong>the</strong> <strong>application</strong> effectively<br />

copies third-party HTML into <strong>the</strong> pages it displays to users. In 2009, a <strong>web</strong> mail<br />

provider called StrongWebmail offered a $10,000 reward to anyone who could<br />

break into <strong>the</strong> CEO’s e-mail. Hackers identified a stored XSS vulnerability within<br />

<strong>the</strong> <strong>web</strong> mail <strong>application</strong> that allowed arbitrary JavaScript to be executed when<br />

<strong>the</strong> recipient viewed a malicious e-mail. They sent a suitable e-mail to <strong>the</strong> CEO,<br />

compromised his session on <strong>the</strong> <strong>application</strong>, and claimed <strong>the</strong> reward.<br />

For more details on this attack, see this URL:<br />

http://blogs.zdnet.com/security/?p=3514<br />

In 2009, Twitter fell victim to two XSS worms that exploited stored XSS vulnerabilities<br />

to spread between users and post updates promoting <strong>the</strong> <strong>web</strong>site of <strong>the</strong><br />

worms’ author. Various DOM-based XSS vulnerabilities have also been identified<br />

in Twitter, arising from its extensive use of Ajax-like code on <strong>the</strong> client side.<br />

For more details on <strong>the</strong>se vulnerabilities, see <strong>the</strong> following URLs:<br />

www.cgisecurity.com/2009/04/two-xss-worms-slam-twitter.html<br />

http://blog.mindedsecurity.com/2010/09/twitter-domxss-wrong-fix-andsomething.html<br />

Payloads for XSS Attacks<br />

So far, we have focused on <strong>the</strong> classic XSS attack payload. It involves capturing<br />

a victim’s session token, hijacking her session, and <strong>the</strong>reby making use of <strong>the</strong><br />

<strong>application</strong> “as” <strong>the</strong> victim, performing arbitrary actions and potentially taking<br />

ownership of that user’s account. In fact, numerous o<strong>the</strong>r attack payloads may<br />

be delivered via any type of XSS vulnerability.<br />

Virtual Defacement<br />

This attack involves injecting malicious data into a page of a <strong>web</strong> <strong>application</strong> to<br />

feed misleading information to users of <strong>the</strong> <strong>application</strong>. It may simply involve<br />

injecting HTML markup into <strong>the</strong> site, or it may use scripts (sometimes hosted<br />

on an external server) to inject elaborate content and navigation into <strong>the</strong> site.

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

Saved successfully!

Ooh no, something went wrong!