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.

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

to cause <strong>the</strong> browser to resolve <strong>the</strong> attacker’s domain a second time, and<br />

this time <strong>the</strong> domain name resolves to <strong>the</strong> IP address of a third-party<br />

<strong>application</strong>, which <strong>the</strong> attacker is targeting.<br />

n Subsequent requests to <strong>the</strong> attacker’s domain name are sent to <strong>the</strong> targeted<br />

<strong>application</strong>. Since <strong>the</strong>se are on <strong>the</strong> same domain as <strong>the</strong> attacker’s<br />

original page, <strong>the</strong> same-origin policy allows <strong>the</strong> attacker’s script to<br />

retrieve <strong>the</strong> contents of <strong>the</strong> responses from <strong>the</strong> targeted <strong>application</strong><br />

and send <strong>the</strong>se back to <strong>the</strong> attacker, possibly on a different attackercontrolled<br />

domain.<br />

This attack faces various obstacles, including mechanisms in some browsers<br />

to continue using a previously resolved IP address, even if <strong>the</strong> domain has been<br />

rebound to a different address. Fur<strong>the</strong>rmore, <strong>the</strong> Host header sent by <strong>the</strong> browser<br />

usually still refers to <strong>the</strong> attacker’s domain, not that of <strong>the</strong> target <strong>application</strong>,<br />

which may cause problems. Historically, methods have existed by which <strong>the</strong>se<br />

obstacles can be circumvented on different browsers. In addition to <strong>the</strong> browser,<br />

DNS rebinding attacks may be performed against browser extensions and <strong>web</strong><br />

proxies, all of which may behave in different ways.<br />

Note that in DNS rebinding attacks, requests to <strong>the</strong> targeted <strong>application</strong> are<br />

still made in <strong>the</strong> context of <strong>the</strong> attacker’s domain, as far as <strong>the</strong> browser is concerned.<br />

Hence, any cookies for <strong>the</strong> actual domain of <strong>the</strong> target <strong>application</strong> are<br />

not included in <strong>the</strong>se requests. For this reason, <strong>the</strong> content that can be retrieved<br />

from <strong>the</strong> target via DNS rebinding is <strong>the</strong> same as could be retrieved by anyone<br />

who can make direct requests to <strong>the</strong> target. The technique is primarily of interest,<br />

<strong>the</strong>refore, where o<strong>the</strong>r controls are in place to prevent an attacker from directly<br />

interacting with <strong>the</strong> target. For example, a user residing on an organization’s<br />

internal networks, which cannot be reached directly from <strong>the</strong> Internet, can be<br />

made to retrieve content from o<strong>the</strong>r systems on those networks and transit this<br />

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

Browser Exploitation Frameworks<br />

Various frameworks have been developed to demonstrate and exploit <strong>the</strong> variety<br />

of possible attacks that may be carried out against end users on <strong>the</strong> Internet.<br />

These typically require a JavaScript hook to be placed into <strong>the</strong> victim’s browser<br />

via some vulnerability such as XSS. Once <strong>the</strong> hook is in place, <strong>the</strong> browser<br />

contacts a server controlled by <strong>the</strong> attacker. It may poll this server periodically,<br />

submitting data back to <strong>the</strong> attacker and providing a control channel for receiving<br />

commands from <strong>the</strong> attacker.

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

Saved successfully!

Ooh no, something went wrong!