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.

590 Chapter 14 n Automating Customized Attacks<br />

SessionId ../../../../../../etc/passwd 302 502<br />

SessionId xsstest 302 502<br />

uid ‘ 200 2941 exception quotation<br />

uid ;/bin/ls 200 2895 exception<br />

uid ../../../../../../etc/passwd 200 2915 exception<br />

uid xsstest 200 2898 exception xsstest<br />

In requests that modify <strong>the</strong> SessionId parameter, <strong>the</strong> <strong>application</strong> responds<br />

with a redirection response that always has <strong>the</strong> same length. This behavior does<br />

not indicate any vulnerability. This is unsurprising, since modifying <strong>the</strong> session<br />

token while logged in typically invalidates <strong>the</strong> current session and causes<br />

a redirection to <strong>the</strong> login.<br />

The uid parameter is more interesting. All <strong>the</strong> modifications to this parameter<br />

cause a response containing <strong>the</strong> string exception. The responses are variable<br />

in length, indicating that <strong>the</strong> different payloads result in different responses, so<br />

this is probably not just a generic error message. Going fur<strong>the</strong>r, we can see that<br />

when a single quotation mark is submitted, <strong>the</strong> <strong>application</strong>’s response contains<br />

<strong>the</strong> string quotation, which is likely to be part of a SQL error message. This<br />

could be a SQL injection flaw, and we should manually investigate to confirm<br />

this (see Chapter 9). In addition, we can see that <strong>the</strong> payload xsstest is being<br />

echoed in <strong>the</strong> <strong>application</strong>’s response. We should probe this behavior fur<strong>the</strong>r to<br />

determine whe<strong>the</strong>r <strong>the</strong> error message can be leveraged to perform a cross-site<br />

scripting attack (see Chapter 12).<br />

TRY IT!<br />

http://mdsec.net/auth/498/<br />

Putting It All Toge<strong>the</strong>r: Burp Intruder<br />

The JAttack tool consists of fewer than 250 lines of simple code, yet in a few<br />

seconds, it uncovered at least two potentially serious security vulnerabilities<br />

while fuzzing a single request to an <strong>application</strong>.<br />

Never<strong>the</strong>less, despite its power, as soon as you start to use a tool such as<br />

JAttack to deliver automated customized attacks, you will quickly identify<br />

additional functionality that would make it even more helpful. As it stands, you<br />

need to configure every targeted request within <strong>the</strong> tool’s source code and <strong>the</strong>n<br />

recompile it. It would be better to read this information from a configuration<br />

file and dynamically construct <strong>the</strong> attack at runtime. In fact, it would be much

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

Saved successfully!

Ooh no, something went wrong!