CS0-003 practice question 12 of 35

An analyst reviews the following web server log entries:%2E%2E/%2E%2E/%2ES2E/%2E%2E/%2E%2E/%2E%2E/etc/passwdNo attacks or malicious attempts have…

Full set: 462 questions

An analyst reviews the following web server log entries:

%2E%2E/%2E%2E/%2ES2E/%2E%2E/%2E%2E/%2E%2E/etc/passwd

No attacks or malicious attempts have been discovered. Which of the following most likely describes what took place?

Answer options
A: A SQL injection query took place to gather information from a sensitive file.
B: A PHP injection was leveraged to ensure that the sensitive file could be accessed.
C: Base64 was used to prevent the IPS from detecting the fully encoded string.
D: Directory traversal was performed to obtain a sensitive file for further reconnaissance. Correct answer
Correct Answer:
D. Directory traversal was performed to obtain a sensitive file for further reconnaissance.
Explanation

The log entry %2E%2E/ is the URL-encoded version of ../. This sequence is used to navigate up the directory hierarchy on a server's file system. The repeated use of this pattern is a classic technique for a directory traversal (or path traversal) attack. The attacker's goal is to move outside of the web server's root directory to access sensitive system files. In this case, the target is /etc/passwd, a file on Unix-like systems that contains a list of local user accounts. Accessing this file is a common reconnaissance step to gather usernames for further attacks.

Why Incorrect

A. This is not a SQL injection attack, as the log entry contains no SQL-specific syntax, keywords (like SELECT, UNION), or operators.
B. This is not a PHP injection attack because the string does not contain any PHP code, functions (like include or eval), or tags.
C. The string uses URL encoding (e.g., %2E for .), not Base64 encoding, which uses a distinct character set (A-Z, a-z, 0-9, +, /).

References

1. MITRE Corporation. (2023). CWE-22: Improper Limitation of a Pathname to a Restricted Directory ('Path Traversal'). Common Weakness Enumeration. Retrieved from https://cwe.mitre.org/data/definitions/22.html. The "Observed Examples" section (e.g., CWE-22-1) explicitly details the use of ../ sequences to access files like /etc/passwd.

2. OWASP Foundation. (n.d.). Path Traversal. OWASP Cheat Sheet Series. Retrieved from https://cheatsheetseries.owasp.org/cheatsheets/PathTraversalCheatSheet.html. This document provides examples of path traversal, including the ../../../../etc/passwd pattern and its various encodings, such as URL encoding (%2e%2e%2f).

3. Zeller, E., & Miller, R. (2014). Lecture 10: Web Security. MIT OpenCourseWare, 6.858 Computer Systems Security, Fall 2014. Page 18, "Path Traversal" slide. This lecture slide provides a clear example of a path traversal attack targeting the /etc/passwd file using the ../ sequence. Retrieved from https://ocw.mit.edu/courses/6-858-computer-systems-security-fall-2014/resources/mit6858f14lec10/.

Scroll to Top