Home Session hijacking -> Predictable session token
Post
Cancel

Session hijacking -> Predictable session token

Session hijacking : Predictable session token

Session prediction attack focuses on predicting session ID values that permit an attacker to bypass the authentication schema of an application. By analyzing and understanding the session ID generation process, an attacker can predict a valid session ID value and get access to the application.

Exploitation

bsc

This webapp uses predictable session token, If we can predict a session token of a user, we will be able to login to his/her account without authentication.

Let’s first login to user account with the following credentials user:user.

bsc

We have logged in as user. Let’s analyse the cookies.

bsc

As you can see, session id 23 has been assigned to the user. What if we can change the session id to something else, let’s say 1, we can login to an account of other user. Let’s try

bsc

We will refresh the page and see what will happen.

bsc

We have logged in as admin.

Mitigations

  • Implement unpredictable session id (random enough).

References

This post is licensed under CC BY 4.0 by the author.