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 141<br />

from within Burp. The most reliable way to do this is to select <strong>the</strong> Headers tab<br />

within <strong>the</strong> response viewer, right-click <strong>the</strong> lower pane containing <strong>the</strong> response<br />

body, and select Copy to File from <strong>the</strong> context menu.<br />

Decompiling <strong>the</strong> Bytecode<br />

Bytecode usually is distributed in a single-file package, which may need to be<br />

unpacked to obtain <strong>the</strong> individual bytecode files for decompilation into source<br />

code.<br />

Java applets normally are packaged as .jar (Java archive) files, and Silverlight<br />

objects are packaged as .xap files. Both of <strong>the</strong>se file types use <strong>the</strong> zip archive<br />

format, so you can easily unpack <strong>the</strong>m by renaming <strong>the</strong> files with <strong>the</strong> .zip<br />

extension and <strong>the</strong>n using any zip reader to unpack <strong>the</strong>m into <strong>the</strong> individual files<br />

<strong>the</strong>y contain. The Java bytecode is contained in .class files, and <strong>the</strong> Silverlight<br />

bytecode is contained in .dll files. After unpacking <strong>the</strong> relevant file package,<br />

you need to decompile <strong>the</strong>se files to obtain source code.<br />

Flash objects are packaged as .swf files and don’t require any unpacking<br />

before you use a decompiler.<br />

To perform <strong>the</strong> actual bytecode decompilation, you need to use some specific<br />

tools, depending on <strong>the</strong> type of browser extension technology that is being used,<br />

as described in <strong>the</strong> following sections.<br />

Java Tools<br />

Java bytecode can be decompiled to into Java source code using a tool called<br />

Jad (<strong>the</strong> Java decompiler), which is available from:<br />

www.varaneckas.com/jad<br />

Flash Tools<br />

Flash bytecode can be decompiled into ActionScript source code. An alternative<br />

approach, which is often more effective, is to disassemble <strong>the</strong> bytecode into a<br />

human-readable form, without actually fully decompiling it into source code.<br />

To decompile and disassemble Flash, you can use <strong>the</strong> following tools:<br />

n Flasm — www.nowrap.de/flasm<br />

n Flare — www.nowrap.de/flare<br />

n SWFScan — www.hp.com/go/swfscan (this works for Actionscript 2 and 3)<br />

Silverlight Tools<br />

Silverlight bytecode can be decompiled into source code using a tool called<br />

.NET Reflector, which is available from:<br />

www.red-gate.com/products/dotnet-development/reflector/

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

Saved successfully!

Ooh no, something went wrong!