File Inclusion: Local File Inclusion
File Inclusion Vulnerability should be differentiated from Path Traversal. The Path Traversal vulnerability allows an attacker to access a file, usually exploiting a "reading" mechanism implemented in the target application, when the File Inclusion will lead to the execution of arbitrary code.
Consider a PHP script that includes a file based on user input. If proper sanitization is not in place, an attacker could manipulate the page parameter to include local or remote files, leading to unauthorized access or code execution.
<?php
$file = $_GET['page'];
include($file);
?>In the following examples we include the /etc/passwd file, check the Directory & Path Traversal chapter for more interesting files.
http://example.com/index.php?page=../../../etc/passwd
Comments
No comments yet.