Concepts / Network attacks

Network attacks

Session hijacking

Also called cookie theft, session theft, session-cookie reuse, sidejacking

Stealing a live session's identifier — a cookie read off the wire — and presenting it to the server to act as that user, without ever knowing their password.

The cookie is the identity
The cookie is the identity

After login the server knows the user only by the session cookie. Anyone who reads it off plain HTTP and sends it is served as that user, with no password.

Session hijacking steals the session identifier a server put in a cookie at login and sends it back as the victim. Until the session ends the cookie is the identity, so no password is needed. On plain HTTP an attacker in a [[man-in-the-middle]] position, often by [[arp-spoofing|ARP spoofing]], reads it. The fix: [[tls|TLS]] everywhere with HSTS, the Secure and HttpOnly cookie flags, and a new id at each privilege change.

See it on real machines

Read next

Learn it on real machines.

Every lab is a small network of real Linux machines in your browser. Sign in with Google or email to start.

Start this lab