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.

44 Chapter 3 n Web Application Technologies<br />

Many o<strong>the</strong>r HTTP methods exist that are not directly relevant to attacking<br />

<strong>web</strong> <strong>application</strong>s. However, a <strong>web</strong> server may expose itself to attack if certain<br />

dangerous methods are available. See Chapter 18 for fur<strong>the</strong>r details on <strong>the</strong>se<br />

methods and examples of using <strong>the</strong>m in an attack.<br />

URLs<br />

A uniform resource locator (URL) is a unique identifier for a <strong>web</strong> resource through<br />

which that resource can be retrieved. The format of most URLs is as follows:<br />

protocol://hostname[:port]/[path/]file[?param=value]<br />

Several components in this scheme are optional. The port number usually is<br />

included only if it differs from <strong>the</strong> default used by <strong>the</strong> relevant protocol. The<br />

URL used to generate <strong>the</strong> HTTP request shown earlier is as follows:<br />

https://mdsec.net/auth/488/YourDetails.ashx?uid=129<br />

In addition to this absolute form, URLs may be specified relative to a particular<br />

host, or relative to a particular path on that host. For example:<br />

/auth/488/YourDetails.ashx?uid=129<br />

YourDetails.ashx?uid=129<br />

These relative forms are often used in <strong>web</strong> pages to describe navigation within<br />

<strong>the</strong> <strong>web</strong>site or <strong>application</strong> itself.<br />

NOTE You may encounter <strong>the</strong> term URI (or uniform resource identifier)<br />

being used instead of URL, but it is really only used in formal specifications<br />

and by those who want to exhibit <strong>the</strong>ir pedantry.<br />

REST<br />

Representational state transfer (REST) is a style of architecture for distributed<br />

systems in which requests and responses contain representations of <strong>the</strong> current<br />

state of <strong>the</strong> system’s resources. The core technologies employed in <strong>the</strong> World<br />

Wide Web, including <strong>the</strong> HTTP protocol and <strong>the</strong> format of URLs, conform to<br />

<strong>the</strong> REST architectural style.<br />

Although URLs containing parameters within <strong>the</strong> query string do <strong>the</strong>mselves<br />

conform to REST constraints, <strong>the</strong> term “REST-style URL” is often used to signify<br />

a URL that contains its parameters within <strong>the</strong> URL file path, ra<strong>the</strong>r than <strong>the</strong><br />

query string. For example, <strong>the</strong> following URL containing a query string:<br />

http://wahh-app.com/search?make=ford&model=pinto<br />

corresponds to <strong>the</strong> following URL containing “REST-style” parameters:<br />

http://wahh-app.com/search/ford/pinto

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

Saved successfully!

Ooh no, something went wrong!