allow_url_include = On in PHP, but gives immediate RCE. Start by confirming LFI with /etc/passwd, then escalate toward RCE.
Basic Traversal
High-Value Files
Linux
Windows
PHP Wrappers
PHP stream wrappers are the most powerful LFI escalation path. No external file needed.Read Source Code
RCE via php://input
Requires the LFI parameter to be passed via POST andallow_url_include = On.
RCE via data://
expect:// (RCE, rarely enabled)
Log Poisoning
Inject PHP into a file the server writes, then include it via LFI. The web server must have read access to the log.Apache / Nginx Access Log
SSH Auth Log
If you can trigger SSH auth attempts, the username goes into/var/log/auth.log.
Mail Log
/proc/self/environ
If the server includes environment variables in/proc/self/environ and you control an HTTP header:
/proc/self/fd (File Descriptor Brute-Force)
Each open file descriptor in the current process is exposed at/proc/self/fd/N. FD 0-2 are stdin/stdout/stderr; higher numbers are open files including logs. Brute-force to find a writable fd that contains injected data.
PHP Session File Inclusion
If the app stores unsanitized input in a PHP session, include the session file.Zip / Phar Wrappers
If the app accepts file uploads, upload a zip containing PHP and include it with the zip:// wrapper.RFI (Remote File Inclusion)
Requiresallow_url_include = On and allow_url_fopen = On in php.ini. Rare in modern setups, but still seen on old PHP or misconfigured apps.
LFI to RCE: Upload + Include
If you can upload a file anywhere on the server (avatar, attachment, temp file), you only need to know the path and include it.PHP Filter Chain RCE
The most powerful modern LFI escalation: generates a PHP payload using chainedphp://filter conversions, achieving RCE with no allow_url_include, no writable path, and no upload required. Works on any PHP app where the LFI parameter reaches include().
php://filter conversion pipeline so the PHP interpreter assembles your payload from character-encoding artifacts rather than from any file on disk.
Nginx Temp File Inclusion
When file uploads go through Nginx, the multipart body is written to a temp file at/tmp/phpXXXXXX before the PHP process reads it. Race the include against the temp file window.
pearcmd.php (register_argc_argv)
Ifregister_argc_argv = On in php.ini (common in Docker-based PHP images), /usr/local/lib/php/pearcmd.php can be abused via query string to write files.
$argv when register_argc_argv is on, so PEAR’s CLI commands execute server-side.
phpinfo() Race Condition
When a page exposesphpinfo(), it reveals the exact temp file path of any concurrent file upload before PHP cleans it up. Race the include against that temp path.