Path Traversal

Path traversal attacks

A directory traversal vulnerability can be present inside a web server, inside an application framework (during the HTTP request pre-processing and routing), or within an application endpoint that processes data according to application logic (for example, reading a file from storage based on its name).

Platform - Filename and Path

You need to figure out a platform in order to know how to address specific files. For Linux, a good file to read is/etc/passwwhich is readable every time. On Windows, you can choose C:\Windows\win.ini

Simple

../../../etc/passwd

URL encoding

. = %2e
/ = %2f
\ = %5c

Double URL encoding

. = %252e
/ = %252f
\ = %255c

UTF-8 bit Unicode

16 bit Unicode

Bypass Path Sequence

Intruder

Don't forget to disable URL encoding for the both next Payloads (payload1,payload2)

Payload 1 - Traversal directory sequence, deep 6

Payload 2 - Filename

Web Server Path Traversal Attacks

Tools

DotDotPwn

References

https://github.com/swisskyrepo/PayloadsAllTheThings/tree/master/Directory%20Traversal https://gracefulsecurity.com/path-traversal-cheat-sheet-linux/ https://www.kali.org/tools/dotdotpwn/

Last updated

Was this helpful?