Module 11: Session Hijacking Flashcards

1
Q

How is a session ID assigned and used?

A
  • When you log into a website, like your bank or email, the server authenticates your username and password.
  • Once authenticated, the server generates a session ID and sends it to your browser. The session ID is then stored in a cookie, which is a small piece of data that the browser saves.
  • Each time you make a new request (like loading a new page), the session ID is sent along with it. This allows the server to recognize you without needing you to re-enter your credentials.
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
2
Q

What is a session ID?

A
  • A session ID is a unique identifier assigned to a user when they start a session with a website or application. Think of it as a temporary “pass” that lets the server know who the user is and keeps track of their activity without requiring them to log in again for every action.
  • It’s often a random, complex string (like ABC123XYZ789) that uniquely identifies the user’s session on the server.

TLDR: They provide a way to identify and authenticate users across multiple interactions without requiring continuous re-authentication.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
3
Q

Why are session IDs important?

A
  • Security: Session IDs help maintain the user’s login state securely. Once you log out, the session ID is invalidated, and you need to log in again to get a new one.
  • Convenience: Session IDs allow you to move through different pages and actions within a site (like checking multiple sections in your bank account) without needing to log in again each time.
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
4
Q

How are session IDs generated?

A
  • Session IDs are typically randomized and unique to each session. Good security practices mean they should be difficult to guess and long enough to prevent brute-force attacks.
  • Most session IDs are generated by web servers (like Apache or Nginx) or backend frameworks (such as Django, Express, or ASP.NET) and are designed to be unique for each session.
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
5
Q

Where are session IDs used?

A
  • Internet Sessions: Session IDs are most commonly used on the internet for websites and online applications where you log in, such as email, bank accounts, social media, and online shopping.
  • Local Applications: Session IDs can also be used in local network applications, such as internal company portals or databases, where users authenticate to access resources within a corporate network.
  • APIs and Mobile Apps: Session IDs are also used by mobile apps and APIs to manage and verify authenticated sessions.
  • Gaming and real time systems: Many online games and real-time applications (like video conferencing or chat services) use session IDs to keep track of users during sessions, allowing them to remain connected and authenticated throughout gameplay or the call.

-VPNs and remote access services: VPNs and remote access services also use session IDs to manage authenticated sessions, ensuring users maintain access to the VPN or remote system without needing constant re-authentication. The session ID in these cases helps manage the encrypted connection and permissions while the user is logged in.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
6
Q

What is session hijacking?

A

Session hijacking is when an attacker steals a session ID and impersonates a user or takes over their active session.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
7
Q

What are some ways in which session IDs are vulnerable to theft?

A
  • Network sniffing (if using http and not https)
  • XSS (cross site scripting)
  • Malware
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
8
Q

What is a cookie?

A

A cookie is a small text file that a website saves on your computer or device to store information about your visit. Cookies help websites remember you, your preferences, and your activities. They’re essential for things like keeping you logged in, remembering items in your shopping cart, and personalizing your browsing experience.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
9
Q

What is rate limiting?

A

Rate limiting is a control mechanism used by websites, APIs and servers to limit the number of requests a user or system can make within a specific time frame, which helps prevent abuse, overload and DDoS attacks.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
10
Q

What is the difference between a cookie and a session ID?

A

A cookie is the storage mechanism that holds data. Cookies can store various types of information, including session IDs, login data, preferences, and tracking information.

A session ID is a unique identifier that’s often stored inside a cookie to manage a user’s session. The session ID itself isn’t a file—it’s simply a piece of data that helps the server identify your current session.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
11
Q

What are some features of session IDs that make session hijacking successful?

A
  1. Absence of a lockout for invalid session IDs (general design flaw)
    Since a session ID is not permanently tied to a given account you cannot penalize for invalid attempts. They are only allocated after you successfully log in, so an attacker could send random session IDs without getting locked out since they’re not tied to an account permanently.
  2. Indefinite session timeout (config error)
    If a session timeout is not configured, this leaves you vulnerable to a replay attack since attacks like XSS do not happen in real time and are often executed after the fact.
  3. Weak session-ID generation algorithm or small session IDs.
  4. Insecure handling of session IDs (sent in clear text or in url instead of cookie)
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
12
Q

List the sequence of steps in the session hijacking process

A
  1. Sniff. Place yourself between the victim and the target
  2. Monitor the flow of packets. Can try to predict the sequence number if network based, on web app that might not make a difference
  3. Session Desynchronization: break the connection to the victim’s machine. can do a secondary session or replay the session ID if the application allows it
  4. Session ID prediction: present it, take over the session
  5. Command Injection: start injecting packets to the target server.
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
13
Q

What is passive vs. active session hijacking?

A

Passive: not modifying traffic, just recording it
Active: modifying traffic.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
14
Q

What is network vs. application based session hijacking?

A

Network level: taking over TCP sockets and sequence numbers
Application level: gaining control over user session by obtaining session ID

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
15
Q
A
How well did you know this?
1
Not at all
2
3
4
5
Perfectly