Courseiva
Network and Web Application AttacksmediumMultiple ChoiceObjective-mapped

CEH Network and Web Application Attacks Practice Question

During a penetration test, you notice that a web application accepts user input and displays it directly in the browser without sanitization. Which attack is most likely to succeed?

⚠ Common exam trap

EC-Council often tests the distinction between reflected XSS and stored XSS; the trap here is that candidates may assume any unsanitized input is SQL injection, but the key clue is direct display in the browser without server-side processing like database queries or command execution.

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

Cross-Site Scripting (XSS)

The scenario describes a classic reflected Cross-Site Scripting (XSS) vulnerability. The application accepts user input and displays it directly in the browser without sanitization, allowing an attacker to inject malicious JavaScript that executes in the victim's browser. This is the defining characteristic of XSS, not SQL injection or command injection, which target server-side interpreters.

Answer analysis

Option-by-option breakdown

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

  • SQL Injection

    Why it's wrong here

    SQL Injection exploits vulnerabilities in an application's database queries, allowing an attacker to insert or manipulate SQL commands. This typically affects the backend database server, enabling data exfiltration, modification, or even complete database compromise, rather than directly manipulating content displayed in the user's browser. The attack targets the data layer, not the client-side rendering.

  • Cross-Site Request Forgery (CSRF)

    Why it's wrong here

    Cross-Site Request Forgery (CSRF) tricks a victim's browser into sending an authenticated request to a vulnerable web application, leveraging the victim's existing session. The attack does not involve injecting malicious scripts into the application's output; instead, it exploits trust in the user's browser to perform unauthorized actions on their behalf, such as changing passwords or transferring funds, without the user's explicit consent.

  • Cross-Site Scripting (XSS)

    Why this is correct

    Cross-Site Scripting (XSS) occurs when a web application incorporates untrusted data into a web page without proper validation or encoding, allowing attackers to inject client-side scripts. In the case of reflected XSS, the malicious script is immediately returned by the web server in its response and executed by the user's browser, directly impacting the content displayed to the user. This vulnerability directly manifests as unsanitized input being rendered in the browser.

  • Command Injection

    Why it's wrong here

    Command Injection vulnerabilities arise when an application executes user-supplied input as part of an operating system command without sufficient sanitization. This allows an attacker to inject arbitrary shell commands, which are then executed on the server hosting the web application. The impact is server-side command execution, not client-side manipulation of browser output or user interface elements.

About these practice questions

This CEH question is part of Courseiva's 870-question bank — original exam-style content with full explanations and wrong-answer analysis, never real exam questions or exam 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.