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 7 n Attacking Session Management 229<br />

Figure 7-6: Configuring Burp Intruder to modify an encrypted session token<br />

Figure 7-7 shows <strong>the</strong> required payload configuration. It tells Burp to operate<br />

on <strong>the</strong> token’s original value, treating it as ASCII-encoded hex, and to flip<br />

each bit at each character position. This approach is ideal because it requires a<br />

relatively small number of requests (eight requests per byte of data in <strong>the</strong> token)<br />

and almost always identifies whe<strong>the</strong>r <strong>the</strong> <strong>application</strong> is vulnerable. This allows<br />

you to use a more focused attack to perform actual exploitation.<br />

When <strong>the</strong> attack is executed, <strong>the</strong> initial requests do not cause any noticeable<br />

change in <strong>the</strong> <strong>application</strong>’s responses, and <strong>the</strong> user’s session is still intact. This<br />

is interesting in itself, because it indicates that <strong>the</strong> first part of <strong>the</strong> token is not<br />

being used to identify <strong>the</strong> logged-in user. Many of <strong>the</strong> requests later in <strong>the</strong> attack<br />

cause a redirection to <strong>the</strong> login page, indicating that modification has invalidated<br />

<strong>the</strong> token in some way. Crucially, <strong>the</strong>re is also a run of requests where<br />

<strong>the</strong> response appears to be part of a valid session but is not associated with <strong>the</strong><br />

original user identity. This corresponds to <strong>the</strong> block of <strong>the</strong> token that contains<br />

<strong>the</strong> uid value. In some cases, <strong>the</strong> <strong>application</strong> simply displays “unknown user,”<br />

indicating that <strong>the</strong> modified uid did not correspond to an actual user, and so <strong>the</strong><br />

attack failed. In o<strong>the</strong>r cases, it shows <strong>the</strong> name of a different registered user of<br />

<strong>the</strong> <strong>application</strong>, proving conclusively that <strong>the</strong> attack has succeeded. Figure 7-8<br />

shows <strong>the</strong> results of <strong>the</strong> attack. Here we have defined an extract grep column<br />

to display <strong>the</strong> identity of <strong>the</strong> logged-in user and have set a filter to hide <strong>the</strong><br />

responses that are redirections to <strong>the</strong> login page.

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

Saved successfully!

Ooh no, something went wrong!