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.

392 Chapter 10 n Attacking Back-End Components<br />

n An attacker may be able to use <strong>the</strong> proxy to connect back to o<strong>the</strong>r services<br />

running on <strong>the</strong> <strong>application</strong> server itself, circumventing firewall restrictions<br />

and potentially exploiting trust relationships to bypass au<strong>the</strong>ntication.<br />

n Finally, <strong>the</strong> proxy functionality could be used to deliver attacks such as<br />

cross-site scripting by causing <strong>the</strong> <strong>application</strong> to include attacker-controlled<br />

content within its responses (see Chapter 12 for more details).<br />

HACK STEPS<br />

1. Identify any request parameters that appear to contain hostnames, IP<br />

addresses, or full URLs.<br />

2. For each parameter, modify its value to specify an alternative resource,<br />

similar to <strong>the</strong> one being requested, and see if that resource appears in <strong>the</strong><br />

server’s response.<br />

3. Try specifying a URL targeting a server on <strong>the</strong> Internet that you control,<br />

and monitor that server for incoming connections from <strong>the</strong> <strong>application</strong><br />

you are testing.<br />

4. If no incoming connection is received, monitor <strong>the</strong> time taken for <strong>the</strong><br />

<strong>application</strong> to respond. If <strong>the</strong>re is a delay, <strong>the</strong> <strong>application</strong>’s back-end<br />

requests may be timing out due to network restrictions on outbound<br />

connections.<br />

5. If you are successful in using <strong>the</strong> functionality to connect to arbitrary<br />

URLs, try to perform <strong>the</strong> following attacks:<br />

a. Determine whe<strong>the</strong>r <strong>the</strong> port number can be specified. For example,<br />

you might supply http://mdattacker.net:22.<br />

b. If successful, attempt to port-scan <strong>the</strong> internal network by using a tool<br />

such as Burp Intruder to connect to a range of IP addresses and ports<br />

in sequence (see Chapter 14).<br />

c. Attempt to connect to o<strong>the</strong>r services on <strong>the</strong> loopback address of <strong>the</strong><br />

<strong>application</strong> server.<br />

d. Attempt to load a <strong>web</strong> page that you control into <strong>the</strong> <strong>application</strong>’s<br />

response to deliver a cross-site scripting attack.<br />

NOTE Some server-side redirection APIs, such as Server.Transfer()<br />

and Server.Execute() in ASP.NET, allow redirection only to relative URLs<br />

on <strong>the</strong> same host. Functionality that passes user-supplied input to one of<br />

<strong>the</strong>se methods can still potentially be exploited to exploit trust relationships<br />

and access resources on <strong>the</strong> server that are protected by platform-level<br />

au<strong>the</strong>ntication.

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

Saved successfully!

Ooh no, something went wrong!