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
What is the main purpose of a session token in a web application?
- To encrypt the traffic between browser and server
- To link successive stateless HTTP requests to one authenticated user
- To store the user's password on the client
- 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.
Which activities are typical of ACTIVE session hijacking?
- Taking over a live session and sending requests as the user
- Only recording packets for later analysis
- Forcing the legitimate user's connection to drop
- Reading tokens from a capture without interacting
- 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: 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.
