PT0-001 · Question #252
A penetration tester has identified a directory traversal vulnerability. Which of the following payloads could have helped the penetration tester identify this vulnerability?
The correct answer is E. ../../../../../../../. Directory traversal attacks use sequences of ../ to escape the intended directory and access files outside the web root. The payload ../../../../../../../. is the canonical example of this technique.
Question
A penetration tester has identified a directory traversal vulnerability. Which of the following payloads could have helped the penetration tester identify this vulnerability?
Options
- A'or 'folder' like 'file'; --
- B|| is /tmp/
- C"><script>document.location=/root/</script>
- D&& dir C:/
- E../../../../../../../.
How the community answered
(41 responses)- A2% (1)
- B5% (2)
- D7% (3)
- E85% (35)
Why each option
Directory traversal attacks use sequences of `../` to escape the intended directory and access files outside the web root. The payload `../../../../../../../.` is the canonical example of this technique.
This payload uses SQL LIKE clause syntax, indicating a SQL injection attempt against a database, not a file path traversal.
The `||` operator combined with `is /tmp/` is a Unix command injection pattern that attempts to execute shell commands, not traverse directory paths.
This is a reflected XSS payload using a script tag to redirect the browser's location, not a directory traversal technique.
The `&&` chained with `dir C:/` is a Windows command injection payload designed to execute OS commands, not to traverse file system paths via path manipulation.
The payload `../../../../../../../.` chains multiple `../` sequences to traverse up the directory tree, potentially reaching the filesystem root and exposing sensitive files like `/etc/passwd` on Linux or `C:\Windows\win.ini` on Windows. This exploits insufficient input validation on file path parameters in web applications. The multiple repetitions ensure the traversal succeeds regardless of how deeply nested the application's working directory is.
Concept tested: Directory traversal path sequence identification
Source: https://owasp.org/www-community/attacks/Path_Traversal
Topics
Community Discussion
No community discussion yet for this question.