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 3 n Web Application Technologies 45<br />

Chapter 4 describes how you need to consider <strong>the</strong>se different parameter styles<br />

when mapping an <strong>application</strong>’s content and functionality and identifying its<br />

key attack surface.<br />

HTTP Headers<br />

HTTP supports a large number of headers, some of which are designed for<br />

specific unusual purposes. Some headers can be used for both requests and<br />

responses, and o<strong>the</strong>rs are specific to one of <strong>the</strong>se message types. The following<br />

sections describe <strong>the</strong> headers you are likely to encounter when attacking <strong>web</strong><br />

<strong>application</strong>s.<br />

General Headers<br />

n Connection tells <strong>the</strong> o<strong>the</strong>r end of <strong>the</strong> communication whe<strong>the</strong>r it should<br />

close <strong>the</strong> TCP connection after <strong>the</strong> HTTP transmission has completed or<br />

keep it open for fur<strong>the</strong>r messages.<br />

n Content-Encoding specifies what kind of encoding is being used for <strong>the</strong><br />

content contained in <strong>the</strong> message body, such as gzip, which is used by<br />

some <strong>application</strong>s to compress responses for faster transmission.<br />

n Content-Length specifies <strong>the</strong> length of <strong>the</strong> message body, in bytes (except<br />

in <strong>the</strong> case of responses to HEAD requests, when it indicates <strong>the</strong> length of<br />

<strong>the</strong> body in <strong>the</strong> response to <strong>the</strong> corresponding GET request).<br />

n Content-Type specifies <strong>the</strong> type of content contained in <strong>the</strong> message body,<br />

such as text/html for HTML documents.<br />

n Transfer-Encoding specifies any encoding that was performed on <strong>the</strong><br />

message body to facilitate its transfer over HTTP. It is normally used to<br />

specify chunked encoding when this is employed.<br />

Request Headers<br />

n Accept tells <strong>the</strong> server what kinds of content <strong>the</strong> client is willing to accept,<br />

such as image types, office document formats, and so on.<br />

n Accept-Encoding tells <strong>the</strong> server what kinds of content encoding <strong>the</strong> client<br />

is willing to accept.<br />

n Authorization submits credentials to <strong>the</strong> server for one of <strong>the</strong> built-in<br />

HTTP au<strong>the</strong>ntication types.<br />

n Cookie submits cookies to <strong>the</strong> server that <strong>the</strong> server previously issued.<br />

n Host specifies <strong>the</strong> hostname that appeared in <strong>the</strong> full URL being requested.

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

Saved successfully!

Ooh no, something went wrong!