pentesting, updated

Testing directory traversal file include

Check whether file-path parameters can be manipulated to read or include files outside the intended directory.

Goal

Confirm file-referencing parameters are sanitized against ../ traversal and arbitrary path input.

How to test

Test any parameter that references a file or template:

curl -s "https://example.com/download?file=../../../../etc/passwd"
curl -s "https://example.com/page?template=../../../../etc/passwd%00"
curl -s "https://example.com/download?file=..%2f..%2f..%2fetc%2fpasswd"   # URL-encoded

Try common encodings and double-encoding if the first attempt is filtered (%2e%2e%2f, ..%252f).

What to look for

File contents from outside the intended directory (root: lines from /etc/passwd is the classic confirmation), or an error revealing the resolved filesystem path.

References

§ home
~/knubertus/home/
1,1 Top