Courseiva

CEH Web Application and Injection Attacks Practice Question

A penetration tester finds that a web application includes files based on user input without proper validation. The tester supplies 'http://attacker.com/malicious.txt' and the application includes its content. Which vulnerability is this?

⚠ Common exam trap

CEH often tests the confusion between RFI and LFI, where candidates might see 'file inclusion' and pick LFI without noting that the supplied input is a remote URL, which specifically indicates RFI.

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

✓

Remote File Inclusion (RFI)

The scenario describes a web application that includes files based on user input without proper validation, and the tester supplies a remote URL (http://attacker.com/malicious.txt) which the application then includes. This is the definition of Remote File Inclusion (RFI), where an attacker can include a file from a remote server, often leading to remote code execution. RFI is possible when the application uses user-supplied input in file inclusion functions (e.g., include, require in PHP) and allows remote URLs. The key indicator is the inclusion of a file from an external domain, which is RFI.

Answer analysis

Option-by-option breakdown

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

  • ✗

    Directory traversal

    Why it's wrong here

    Directory traversal exploits vulnerabilities in file path handling to access files and directories stored outside the intended web root directory. It typically involves using sequences like "../" to navigate the file system. While it can read files, it doesn't "include" them in the sense of executing their content within the application's context, which is what "includes f" (likely referring to file inclusion) implies. Its primary goal is unauthorized file access, not code execution via inclusion.

  • ✓

    Remote File Inclusion (RFI)

    Why this is correct

    Remote File Inclusion (RFI) occurs when a web application dynamically includes a file from a remote server, typically specified by a URL in user-controlled input. This vulnerability allows an attacker to inject and execute malicious code hosted on their own server within the context of the vulnerable web application. The application fetches the remote file (e.g., via HTTP) and processes its content as if it were a local script, leading to potential arbitrary code execution.

  • ✗

    Local File Inclusion (LFI)

    Why it's wrong here

    Local File Inclusion (LFI) allows an attacker to include files that are already present on the web server's file system. This vulnerability typically arises when the application uses user-supplied input to construct a path to a local file without proper validation. While LFI can be used to read sensitive files or potentially achieve code execution by including log files or uploaded malicious files, it specifically involves local resources, not fetching content from a remote URL.

  • ✗

    Server-Side Request Forgery (SSRF)

    Why it's wrong here

    Server-Side Request Forgery (SSRF) forces the server to make requests to an arbitrary domain specified by the attacker, often targeting internal network resources or services. The server acts as a proxy for the attacker's request, potentially revealing internal network topology, accessing internal APIs, or port scanning. Unlike file inclusion vulnerabilities, SSRF focuses on making outbound requests from the server, not directly including and executing file content within the application's response.

About these practice questions

This CEH question is part of Courseiva's 913-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 and reviewed by Johnson Ajibi, MSc IT Security

Senior Network & Security Engineer · founder of Courseiva

Last reviewed September 2026 · checked against the official EC-Council exam blueprint

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.