Skip to content

LFI & Path Traversal Techniques

Every Local File Inclusion and path traversal technique, from ../ traversal and encoding bypasses to PHP wrappers and LFI-to-RCE, each with detection and remediation. This reference covers 15 technique classes and 59 representative payloads. Browse by technique below, or use the searchable payload index to filter by target OS and bypass class.

Basic path traversal

Walk out of the intended directory with ../ to read arbitrary files.

Arbitrary file readInformation disclosure

Absolute path inclusion

Supply a full path like /etc/passwd directly — no ../ needed.

Arbitrary file readInformation disclosure

Encoding bypass

Encode the dots and slashes so the ../ filter never sees them.

Arbitrary file readInformation disclosure

Filter-strip bypass

Craft ....// so removing one ../ leaves another ../ behind.

Arbitrary file readInformation disclosure

Null byte injection

Terminate the string with %00 to drop an appended .php extension.

Arbitrary file readSource code disclosureInformation disclosure

Path truncation

Pad with ./ and trailing dots so an appended extension is cut off.

Arbitrary file readSource code disclosureInformation disclosure

Extension bypass

Make an appended extension harmless with ?, #, ; or a wrapper.

Arbitrary file readSource code disclosureInformation disclosure

php://filter source read

Base64-encode PHP source so include returns code, not output.

Source code disclosureInformation disclosure

php:// & data:// RCE

Feed PHP to include via data://, php://input, or expect://.

Remote code execution

PHP filter chain RCE

Chain iconv filters so php://filter emits a PHP payload in memory.

Remote code execution

Log poisoning

Inject PHP into a log via User-Agent, then include the log.

Remote code execution

Session / upload inclusion

Plant PHP in a session file (/tmp/sess_<id>), then include it.

Remote code execution

/proc inclusion

Smuggle PHP via User-Agent into /proc/self/environ, then include it.

Remote code executionInformation disclosure

zip:// & phar:// wrappers

Include PHP packed inside an uploaded zip or phar archive.

Remote code execution

Remote file inclusion

Make include fetch and run PHP from your own URL or SMB share.

Remote code execution