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.

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

TIP When you attempt to decode what appears to be a Base64-encoded<br />

string, a common mistake is to begin decoding at <strong>the</strong> wrong position within <strong>the</strong><br />

string. Because of how Base64 encoding works, if you start at <strong>the</strong> wrong position,<br />

<strong>the</strong> decoded string will contain gibberish. Base64 is a block-based format<br />

in which every 4 bytes of encoded data translates into 3 bytes of decoded data.<br />

Hence, if your attempts to decode a Base64 string do not uncover anything<br />

meaningful, try starting from four adjacent offsets into <strong>the</strong> encoded string.<br />

By default, <strong>the</strong> ASP.NET platform protects <strong>the</strong> ViewState from tampering by<br />

adding a keyed hash to it (known as MAC protection). However, some <strong>application</strong>s<br />

disable this default protection, meaning that you can modify <strong>the</strong> ViewState’s value<br />

to determine whe<strong>the</strong>r it has an effect on <strong>the</strong> <strong>application</strong>’s server-side processing.<br />

Burp Suite includes a ViewState parser that indicates whe<strong>the</strong>r <strong>the</strong> ViewState<br />

is MAC protected, as shown in Figure 5-3. If it is not protected, you can edit <strong>the</strong><br />

contents of <strong>the</strong> ViewState within Burp using <strong>the</strong> hex editor below <strong>the</strong> ViewState<br />

tree. When you send <strong>the</strong> message to <strong>the</strong> server or client, Burp sends your updated<br />

ViewState, and, in <strong>the</strong> present example, enables you to change <strong>the</strong> price of <strong>the</strong><br />

item being purchased.<br />

Figure 5-3: Burp Proxy can decode and render <strong>the</strong> ViewState, allowing you to<br />

review its contents and edit <strong>the</strong>se if <strong>the</strong> EnableViewStateMac option is not set

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

Saved successfully!

Ooh no, something went wrong!