nerdexam
CompTIA

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.

Attacks and exploits

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)
  • A
    2% (1)
  • B
    5% (2)
  • D
    7% (3)
  • E
    85% (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.

A'or 'folder' like 'file'; --

This payload uses SQL LIKE clause syntax, indicating a SQL injection attempt against a database, not a file path traversal.

B|| is /tmp/

The `||` operator combined with `is /tmp/` is a Unix command injection pattern that attempts to execute shell commands, not traverse directory paths.

C"><script>document.location=/root/</script>

This is a reflected XSS payload using a script tag to redirect the browser's location, not a directory traversal technique.

D&& dir C:/

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.

E../../../../../../../.Correct

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

#directory traversal#path traversal#web application#payload identification

Community Discussion

No community discussion yet for this question.

Full PT0-001 Practice