Path Traversal Vulnerability
Path Traversal Vulnerability
TRAVERSAL
by : Yahia ahmad
Course outline :
• How do we find it ??
• How do we prevent it ??
What is path traversal
vulnerability ??
../../../../etc/passwd
../../.htaccess
\..\..\windows\win.ini
White-box testing
• Identify instances where user-supplied
input is being passed to file APIs or as
parameters to the OS.
• Identify instances ia a running
application first
((black box perspective))
And then review the code responsible for
what functionality .
• Gerp on functions in the code that are
known to include and evaluate files on
the server and review it they take user
supplied input.
• Use a tool to monitor all filesystem
activity on the server then test each
page of the application by inserting a
single unique string . seta filter
monitoring tool for the specific string
and identify all filesystem events that
contain the string .
Note on the black-box and white box testing :
..\..\..\..\..\windows\win.ini
• Absolute paths :
/etc/passwd
../../../etc/passwd
%2e%2e%2f%2e%2e%2f%2e%2e%2f%2e%2e%2f
%2e%2e%2f%2e%2e%2f%65%74%63%2f%70%61%73
%73%77%64
/var/www/images/../../../../etc/passwd
../../../etc/passwd%00.png
Automated exploitation
tools
Web application vulnerability
scanners(WAVS):
How to prevent Path traversal
vulnerabilities??
1* The best way to prevent Path
traversal vulnerabilities is to avoid
passing user-supplied input to
filesystem APIs.