Directory Traversal

Directory Traversal

Knowledge Base>Directory Traversal

Summary

Directory Traversal refers to exploitation of insufficient security validations to access unauthorized directories via unexpected user input.

Testing methodology

/path/%255c%255c..%255c/?page=?path=?download=?include=?doc=?site=?conf=?lang=JWT KID valuePHPSESSIDStatic File CSS JS etcTraverse to Static FileEnumerate File SystemEnumerate File Systemboot.iniweb.configglobal.asa/etc/passwd/etc/shadowenviron/run/secrets/kubernetes.io/..Escalate to LFIEscalate to RFI
Identified Entry Point
Common Parameters, Headers, and Cookies
Common URI Parsing
Accessing File in Parent Directory
Windows
Linux
LFI
RFI
File Read

Description

A Directory Traversal vulnerability allows an attacker to access files and directories that are stored outside the web root folder. By manipulating variables that reference files with 'dot-dot-slash (../)' sequences and its variations, attackers can traverse to arbitrary directories and access files outside of the intended directory.

Remediations

  • Validate and sanitize user input to prevent the inclusion of file system traversal characters.
  • Implement an Allow-List of allowed file paths and deny all other paths.

Usually follows

Affected components

  • Server

By using this site you agree to our Terms of Service and Privacy Policy.