Courseiva
Web Application and Injection AttacksmediumMultiple ChoiceObjective-mapped

CEH Web Application and Injection Attacks Practice Question

A web application uses a URL parameter to fetch a file from the server, e.g., 'download.php?file=report.pdf'. An attacker changes the parameter to '../../etc/passwd' and retrieves the password file. This attack is known as:

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

Directory traversal

Directory traversal (also known as path traversal) allows an attacker to access files outside the intended directory by using '../' sequences.

Answer analysis

Option-by-option breakdown

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

  • Command injection

    Why it's wrong here

    Command injection is a vulnerability where an attacker executes arbitrary operating system commands on the host server by injecting them into an application's input that is then passed to a system shell. Unlike directory traversal, which focuses on navigating and reading files, command injection aims to achieve remote code execution by directly invoking system utilities or scripts. This typically involves manipulating parameters that are used in functions like exec() or system().

  • Local File Inclusion (LFI)

    Why it's wrong here

    Local File Inclusion (LFI) occurs when a web application includes a file from the local server's file system based on user-supplied input without proper validation. While directory traversal is often used as a technique to reach arbitrary files, LFI specifically refers to the application's inclusion and processing of that file, potentially leading to information disclosure, arbitrary code execution (if the included file is executable code), or denial of service. The core distinction is the inclusion and interpretation of the file's content by the application, rather than just fetching its raw contents.

  • Directory traversal

    Why this is correct

    Directory traversal, also known as path traversal, is a web security vulnerability that allows an attacker to read arbitrary files on the server's file system. This is achieved by manipulating file paths in user-supplied input, typically using sequences like "../" (dot-dot-slash) to move up in the directory hierarchy, or its encoded forms. The objective is to access files and directories stored outside the intended web root directory, such as configuration files, source code, or system files like /etc/passwd.

  • Server-Side Request Forgery (SSRF)

    Why it's wrong here

    Server-Side Request Forgery (SSRF) is a vulnerability where a web application is tricked into making requests to an arbitrary domain specified by the attacker. This allows the attacker to coerce the server into sending requests to internal network resources (e.g., internal APIs, cloud metadata services) or external systems, often bypassing firewall rules and network segmentation. The key mechanism involves the server initiating an outbound HTTP request to a different system, rather than navigating its local file system to access files.

About these practice questions

One of 870 original CEH practice questions on Courseiva, each with a full explanation and wrong-answer analysis — not exam dumps or protected exam content. 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.