What if we can travel everywhere in the Web Server?
Directory traversal (also known as file path traversal) is a web security vulnerability that allows an attacker to read arbitrary files on the server that is running an application.
This might include application code and data, credentials for back-end systems, also sensitive files such as /etc/passwd or /etc/shadow on the server running the Web Application.
Note that: This vulnerability only appears in filebase Programming Language such as PHP.., the routebase Programming Language such as NodeJS, ASP, Golang.. are not affected by this vulnerability.
In order to get the best experience learning this Vulnerability, you should have basic knowledge in
Linux Basic Command, in this module, you should get used to Linux Navigation Command
For more information: Navigating your filesystem in the Linux Terminal
If you have learned this vulnerability before, why not going to solve my challenges here?
For the Developer's aspect - if you were an developer, in the real-world, there would be some case you have to assign a path value for something like picture or a script file.
Let me introduce you some kind of getting the path info in PHP:
<?php
$path = './image/my-document.txt';
readfile($path);
?>
<?php
$available-php = './php-script/my-script.php';
include($available-php);
?>
Let's take a look at the code:
<?php
$available-php = './php-script/my-script.php' . $_GET['user_input'];
include($available-php);
?>
Note that: