OWASP A2 Broken Authentication and Session Management
bypass authentication via cookies
Tools: Burp Suiteweb app: mutillidae
To achieve this hack I do the following
- setup our proxy
- register 2 brand new usernames HelenC & SamF
- login as HelenC then logout
- login as SamF then logout
- next (in burp) under proxy > http history > pick out the 2 requests that authenticated both users (they have a response code of 302 AND the method is POST
- right click on the first post message and select send to comparer (request)
- right click on the second post message and select send to comparer (request)
- next click on the comparer tab and select words
Set-Cookie: uid=24
for Sam this value has increment in value by 1, therefore SamF recieved the following header
Set-Cookie: uid=25
This tells me that server (potentially) increments the value of the set-cookie: uid by 1 each time a user registers. Now I will attempt to exploit this behavior by modifying the value of
Set-Cookie: uid=24
to
Set-Cookie: uid=1
lets see what happens