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 14 n Automating Customized Attacks 583<br />

{<br />

}<br />

new JAttack().doAttack();<br />

That’s it! To compile and run this code, you need to download <strong>the</strong> Java SDK<br />

and JRE from Sun and <strong>the</strong>n execute <strong>the</strong> following:<br />

> javac JAttack.java<br />

> java JAttack<br />

In our sample configuration, <strong>the</strong> tool’s output is as follows:<br />

param payload status length<br />

PageNo 10060 500 3154<br />

PageNo 10061 500 3154<br />

PageNo 10062 200 1083<br />

PageNo 10063 200 1080<br />

PageNo 10064 500 3154<br />

...<br />

Assuming a normal network connection and amount of processing power,<br />

JAttack can issue hundreds of individual requests per minute and output <strong>the</strong><br />

pertinent details. This lets you quickly find valid document identifiers for fur<strong>the</strong>r<br />

investigation.<br />

TRY IT!<br />

http://mdsec.net/app/<br />

It may appear that <strong>the</strong> attack just illustrated is no more sophisticated than <strong>the</strong><br />

original bash script example, which required only a few lines of code. However,<br />

because of how JAttack is engineered, it is easy to modify it to deliver much<br />

more sophisticated attacks, incorporating multiple request parameters, a variety<br />

of payload sources, and arbitrarily complex processing of responses. In <strong>the</strong><br />

following sections, we will make some minor additions to JAttack’s code that<br />

will make it considerably more powerful.<br />

Harvesting Useful Data<br />

The second main use of customized automation when attacking an <strong>application</strong><br />

is to extract useful or sensitive data by using specific crafted requests to retrieve<br />

<strong>the</strong> information one item at a time. This situation most commonly arises when<br />

you have identified an exploitable vulnerability, such as an access control flaw,<br />

that enables you to access an unauthorized resource by specifying an identifier<br />

for it. However, it may also arise when <strong>the</strong> <strong>application</strong> is functioning entirely as

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

Saved successfully!

Ooh no, something went wrong!