Courseiva
Malware, Social Engineering and Network AttackshardMultiple ChoiceObjective-mapped

CEH Practice Question: Malware, Social Engineering and Network Attacks

During a penetration test, you capture the following output: 'HTTP/1.1 200 OK ... Set-Cookie: sessionid=abc123; path=/'. You then send a request with a modified cookie value 'sessionid=abc124' and receive a valid session. Which type of vulnerability has been exploited?

⚠ Common exam trap

Candidates often confuse session hijacking via cookie prediction with a man-in-the-middle attack, but MITM requires active interception of traffic, whereas cookie prediction relies solely on guessing or enumerating session IDs from observed patterns.

Answer choices

Why each option matters

Answer the question above first, then reveal the full breakdown to understand why each option is right or wrong.

Correct answer & explanation

Session hijacking via cookie prediction

The attacker successfully predicted or guessed a valid session identifier (sessionid=abc124) after observing the pattern of the original session cookie (sessionid=abc123). This is a classic session hijacking via cookie prediction attack, where weak or sequential session IDs allow an attacker to impersonate another user's session without needing to intercept traffic or inject code.

Answer analysis

Option-by-option breakdown

For each option: why learners choose it and why it is or isn't the right answer here.

  • Cross-site scripting

    Why it's wrong here

    Cross-site scripting (XSS) involves injecting malicious client-side scripts, typically JavaScript, into web pages viewed by other users. This vulnerability arises from improper input validation and output encoding, allowing the script to execute within the victim's browser context. While XSS can be leveraged to steal session cookies, the direct manipulation of a cookie, as implied by the question, is not the primary mechanism or defining characteristic of an XSS attack itself.

  • SQL injection

    Why it's wrong here

    SQL injection exploits vulnerabilities in an application's database queries, enabling an attacker to insert malicious SQL code into input fields. This can lead to unauthorized access, modification, or deletion of database contents, or even execution of arbitrary commands on the database server. The scenario described focuses on directly altering a session cookie, which is a client-side or application-level state manipulation, not a direct attack on the backend database query logic.

  • Man-in-the-middle attack

    Why it's wrong here

    A Man-in-the-Middle (MitM) attack involves an attacker intercepting and potentially altering communications between two parties who believe they are directly communicating. This requires the attacker to position themselves between the client and server, often using techniques like ARP spoofing or DNS poisoning, to capture and manipulate data, including session cookies, as it traverses the network. The described action of directly modifying a cookie does not inherently involve network interception.

  • Session hijacking via cookie prediction

    Why this is correct

    Session hijacking via cookie prediction occurs when an attacker successfully guesses or calculates a valid session identifier (Session ID) that an application uses to maintain a user's authenticated state. By setting their own browser's cookie to this predicted, valid Session ID, the attacker can bypass the login process and assume the identity of the legitimate user, gaining unauthorized access to their active session. This method specifically exploits weak or predictable session ID generation algorithms.

About these practice questions

Courseiva writes every CEH question from scratch — 870 in total, each with an explanation and a wrong-answer breakdown. None are copied from real exams or dumps. Learn why practice questions differ from exam dumps →

How Courseiva writes practice questions · Editorial policy

JA

Written by Johnson Ajibi, MSc IT Security

Senior Network & Security Engineer · founder of Courseiva

This CEH practice question is part of Courseiva's free EC-Council certification practice question bank. Courseiva provides original exam-style practice questions with explanations, topic-based practice, mock exams, readiness tracking, and study analytics to help learners prepare for the CEH exam.