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.

566 Chapter 13 n Attacking Users: O<strong>the</strong>r Techniques<br />

Figure 13-9 shows BeEF performing a port scan of <strong>the</strong> victim user’s own<br />

computer.<br />

Figure 13-9: BeEF performing a port scan of a compromised user’s computer<br />

Ano<strong>the</strong>r highly functional browser exploitation framework is XSS Shell, produced<br />

by Ferruh Mavituna. It provides a wide range of functions for manipulating<br />

zombie hosts compromised via XSS, including capturing keystrokes, clipboard<br />

contents, mouse movements, screenshots, and URL history, as well as <strong>the</strong> injection<br />

of arbitrary JavaScript commands. It also remains resident within <strong>the</strong> user’s<br />

browser if she navigates to o<strong>the</strong>r pages within <strong>the</strong> <strong>application</strong>.<br />

Man-in-<strong>the</strong>-Middle Attacks<br />

Earlier chapters described how a suitably positioned attacker can intercept<br />

sensitive data, such as passwords and session tokens, if an <strong>application</strong> uses<br />

unencrypted HTTP communications. What is more surprising is that some<br />

serious attacks can still be performed even if an <strong>application</strong> uses HTTPS for<br />

all sensitive data and <strong>the</strong> target user always verifies that HTTPS is being used<br />

properly.<br />

These attacks involve an “active” man in <strong>the</strong> middle. Instead of just passively<br />

monitoring ano<strong>the</strong>r user’s traffic, this type of attacker also changes some of that<br />

traffic on <strong>the</strong> fly. Such an attack is more sophisticated, but it can certainly be<br />

delivered in numerous common situations, including public wireless hotspots<br />

and shared office networks, and by suitably minded governments.<br />

Many <strong>application</strong>s use HTTP for nonsensitive content, such as product descriptions<br />

and help pages. If such content makes any script includes using absolute<br />

URLs, an active man-in-<strong>the</strong>-middle attack can be used to compromise HTTPSprotected<br />

requests on <strong>the</strong> same domain. For example, an <strong>application</strong>’s help page<br />

may contain <strong>the</strong> following:<br />

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

Saved successfully!

Ooh no, something went wrong!