Bitzu

312-50 ยท Session hijacking

What is session hijacking?

Session lifecycle, session tokens, active vs passive hijacking, spoofing vs hijacking, and attack phases.

Key points

  • Taking over a user's already authenticated session by stealing or predicting its session token, so the attacker is treated by the server as that user.
  • It works because HTTP is stateless and the token alone proves identity.
  • Passive hijacking only observes traffic; active hijacking takes over the session and may knock the real user out.
  • Typical phases: find a session, harvest or guess the token, take it over, then perform actions.

Source: https://developer.mozilla.org/en-US/docs/Web/HTTP/Guides/Cookies

Practice questions

Single choice

What is the main purpose of a session token in a web application?

  1. To encrypt the traffic between browser and server
  2. To link successive stateless HTTP requests to one authenticated user
  3. To store the user's password on the client
  4. To prove that the server's certificate is valid
Show answer

Answer: B. To link successive stateless HTTP requests to one authenticated user

HTTP is stateless, so the token ties each later request to an authenticated session. It is not a password store or an encryption key, which is why stealing it is enough to impersonate the user.

Select all that apply

Which activities are typical of ACTIVE session hijacking?

  1. Taking over a live session and sending requests as the user
  2. Only recording packets for later analysis
  3. Forcing the legitimate user's connection to drop
  4. Reading tokens from a capture without interacting
  5. Injecting requests into an established session
Show answer

Answer: A. Taking over a live session and sending requests as the user, C. Forcing the legitimate user's connection to drop, E. Injecting requests into an established session

Active hijacking interferes: it takes over the live session, may disconnect the real user and sends the attacker's own requests. Merely watching traffic or reading logs is passive.

True or false

True or false: session spoofing and session hijacking are the same thing, because both take over a user's currently active session.

Show answer

Answer: False

False. Hijacking takes over an existing, live session. Spoofing means impersonating a user by creating a new session with stolen or guessed credentials, with no live session being taken.

Practice 8 questions on this topic in Bitzu

Short lessons, instant explanations and spaced review of what you get wrong. Free on iOS and Android.

Download on the App StoreGet it on Google Play

More 312-50 topics in this module