19.09.2017 Views

the-web-application-hackers-handbook

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

Chapter 14 n Automating Customized Attacks 579<br />

In <strong>the</strong> document enumeration example, <strong>the</strong> parameter we want to vary contains<br />

a numeric value, so our first implementation of <strong>the</strong> PayloadSource interface is<br />

a class to generate numeric payloads. This class allows us to specify <strong>the</strong> range<br />

of numbers we want to test:<br />

class PSNumbers implements PayloadSource<br />

{<br />

int from, to, step, current;<br />

PSNumbers(int from, int to, int step)<br />

{<br />

this.from = from;<br />

this.to = to;<br />

this.step = step;<br />

reset();<br />

}<br />

public boolean nextPayload()<br />

{<br />

current += step;<br />

return current

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

Saved successfully!

Ooh no, something went wrong!