Recipe 9-2: Preventing Path-Traversal Attacks
This recipe shows you how to determine when attackers attempt to use path-traversal requests to access unauthorized data.
Ingredients
- OWASP ModSecurity Core Rule Set (CRS)
- modsecurity_crs_42_tight_security.conf
- ModSecurity
- REQUEST_URI variable
- REQUEST_BODY variable
- REQUEST_HEADERS variable
- XML variable
CAPEC-126: Path Traversal
Sample Attacks
Figure 9-1 shows a path-traversal attack that successfully accesses the OS-level /etc/passwd file.
In addition, here are some real-world path-traversal attacks captured from web server honeypot systems:
GET //index.php?option=com_awdwall&controller=../../../../../../../ ../../../../../../../../../../../../../etc/passwd%0000 ...