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.

Chapter 5 n Bypassing Client-Side Controls 127<br />

TRY IT!<br />

http://mdsec.net/shop/76/<br />

HACK STEPS<br />

1. If you are attacking an ASP.NET <strong>application</strong>, verify whe<strong>the</strong>r MAC protection<br />

is enabled for <strong>the</strong> ViewState. This is indicated by <strong>the</strong> presence of a<br />

20-byte hash at <strong>the</strong> end of <strong>the</strong> ViewState structure, and you can use <strong>the</strong><br />

ViewState parser in Burp Suite to confirm whe<strong>the</strong>r this is present.<br />

2. Even if <strong>the</strong> ViewState is protected, use Burp to decode <strong>the</strong> ViewState<br />

on various <strong>application</strong> pages to discover whe<strong>the</strong>r <strong>the</strong> <strong>application</strong> is using<br />

<strong>the</strong> ViewState to transmit any sensitive data via <strong>the</strong> client.<br />

3. Try to modify <strong>the</strong> value of a specific parameter within <strong>the</strong> ViewState<br />

without interfering with its structure, and see whe<strong>the</strong>r an error message<br />

results.<br />

4. If you can modify <strong>the</strong> ViewState without causing errors, you should<br />

review <strong>the</strong> function of each parameter within <strong>the</strong> ViewState and<br />

see whe<strong>the</strong>r <strong>the</strong> <strong>application</strong> uses it to store any custom data. Try to<br />

submit crafted values as each parameter to probe for common vulnerabilities,<br />

as you would for any o<strong>the</strong>r item of data being transmitted<br />

via <strong>the</strong> client.<br />

5. Note that MAC protection may be enabled or disabled on a per-page<br />

basis, so it may be necessary to test each significant page of <strong>the</strong> <strong>application</strong><br />

for ViewState hacking vulnerabilities. If you are using Burp Scanner<br />

with passive scanning enabled, Burp automatically reports any pages that<br />

use <strong>the</strong> ViewState without MAC protection enabled.<br />

Capturing User Data: HTML Forms<br />

The o<strong>the</strong>r principal way in which <strong>application</strong>s use client-side controls to restrict<br />

data submitted by clients occurs with data that was not originally specified by<br />

<strong>the</strong> server but that was ga<strong>the</strong>red on <strong>the</strong> client computer itself.<br />

HTML forms are <strong>the</strong> simplest and most common way to capture input from<br />

<strong>the</strong> user and submit it to <strong>the</strong> server. With <strong>the</strong> most basic uses of this method,<br />

users type data into named text fields, which are submitted to <strong>the</strong> server as<br />

name/value pairs. However, forms can be used in o<strong>the</strong>r ways; <strong>the</strong>y can impose<br />

restrictions or perform validation checks on <strong>the</strong> user-supplied data. When an

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

Saved successfully!

Ooh no, something went wrong!