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 19 n Finding Vulnerabilities in Source Code 725<br />

Table 19-7: Variables Used to Acquire User-Supplied Data on <strong>the</strong> PHP Platform<br />

VARIABLE<br />

$_GET<br />

$HTTP_GET_VARS<br />

DESCRIPTION<br />

Contains <strong>the</strong> parameters submitted in<br />

<strong>the</strong> query string. These are accessed<br />

by name. For example, in <strong>the</strong> following<br />

URL:<br />

https://wahh-app.com/search<br />

.php?query=foo<br />

<strong>the</strong> value of <strong>the</strong> query parameter is<br />

accessed using:<br />

$_GET[‘query’]<br />

$_POST<br />

$HTTP_POST_VARS<br />

$_COOKIE<br />

$HTTP_COOKIE_VARS<br />

$_REQUEST<br />

$_FILES<br />

$HTTP_POST_FILES<br />

$_SERVER[‘REQUEST_METHOD’]<br />

$_SERVER[‘QUERY_STRING’]<br />

$_SERVER[‘REQUEST_URI’]<br />

$_SERVER[‘HTTP_ACCEPT’]<br />

$_SERVER[‘HTTP_ACCEPT_CHARSET’]<br />

$_SERVER[‘HTTP_ACCEPT_<br />

ENCODING’]<br />

$_SERVER[‘HTTP_ACCEPT_<br />

LANGUAGE’]<br />

$_SERVER[‘HTTP_CONNECTION’]<br />

$_SERVER[‘HTTP_HOST’]<br />

Contains <strong>the</strong> parameters submitted in<br />

<strong>the</strong> request body.<br />

Contains <strong>the</strong> cookies submitted in <strong>the</strong><br />

request.<br />

Contains all <strong>the</strong> items in <strong>the</strong> $_GET, $_<br />

POST, and $_COOKIE arrays.<br />

Contains <strong>the</strong> files uploaded in <strong>the</strong><br />

request.<br />

Contains <strong>the</strong> method used in <strong>the</strong> HTTP<br />

request.<br />

Contains <strong>the</strong> full query string submitted<br />

in <strong>the</strong> request.<br />

Contains <strong>the</strong> full URL contained in <strong>the</strong><br />

request.<br />

Contains <strong>the</strong> contents of <strong>the</strong> HTTP<br />

Accept header.<br />

Contains <strong>the</strong> contents of <strong>the</strong> HTTP<br />

Accept-charset header.<br />

Contains <strong>the</strong> contents of <strong>the</strong> HTTP<br />

Accept-encoding header.<br />

Contains <strong>the</strong> contents of <strong>the</strong> HTTP<br />

Accept-language header.<br />

Contains <strong>the</strong> contents of <strong>the</strong> HTTP<br />

Connection header.<br />

Contains <strong>the</strong> contents of <strong>the</strong> HTTP Host<br />

header.<br />

Continued

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

Saved successfully!

Ooh no, something went wrong!