19.09.2017 Views

the-web-application-hackers-handbook

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

96 Chapter 4 n Mapping <strong>the</strong> Application<br />

HACK STEPS<br />

1. Identify any instances where <strong>application</strong> functionality is accessed not by<br />

requesting a specific page for that function (such as /admin/editUser.jsp)<br />

but by passing <strong>the</strong> name of a function in a parameter (such as<br />

/admin.jsp?action=editUser).<br />

2. Modify <strong>the</strong> automated techniques described for discovering URL-specified<br />

content to work on <strong>the</strong> content-access mechanisms in use within <strong>the</strong><br />

<strong>application</strong>. For example, if <strong>the</strong> <strong>application</strong> uses parameters that specify<br />

servlet and method names, first determine its behavior when an<br />

invalid servlet and/or method is requested, and when a valid method is<br />

requested with o<strong>the</strong>r invalid parameters. Try to identify attributes of <strong>the</strong><br />

server’s responses that indicate “hits” — valid servlets and methods. If<br />

possible, find a way of attacking <strong>the</strong> problem in two stages, first enumerating<br />

servlets and <strong>the</strong>n methods within <strong>the</strong>se. Using a method similar to<br />

<strong>the</strong> one used for URL-specified content, compile lists of common items,<br />

add to <strong>the</strong>se by inferring from <strong>the</strong> names actually observed, and generate<br />

large numbers of requests based on <strong>the</strong>se.<br />

3. If applicable, compile a map of <strong>application</strong> content based on functional<br />

paths, showing all <strong>the</strong> enumerated functions and <strong>the</strong> logical paths and<br />

dependencies between <strong>the</strong>m.<br />

Discovering Hidden Parameters<br />

A variation on <strong>the</strong> situation where an <strong>application</strong> uses request parameters to<br />

specify which function should be performed arises where o<strong>the</strong>r parameters<br />

are used to control <strong>the</strong> <strong>application</strong>’s logic in significant ways. For example, an<br />

<strong>application</strong> may behave differently if <strong>the</strong> parameter debug=true is added to <strong>the</strong><br />

query string of any URL. It might turn off certain input validation checks, allow<br />

<strong>the</strong> user to bypass certain access controls, or display verbose debug information<br />

in its response. In many cases, <strong>the</strong> fact that <strong>the</strong> <strong>application</strong> handles this<br />

parameter cannot be directly inferred from any of its content (for example, it<br />

does not include debug=false in <strong>the</strong> URLs it publishes as hyperlinks). The effect<br />

of <strong>the</strong> parameter can only be detected by guessing a range of values until <strong>the</strong><br />

correct one is submitted.

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

Saved successfully!

Ooh no, something went wrong!