documentation/modules/auxiliary/scanner/http/http_traversal.md
This module allows you to test if a web server (or web application) is vulnerable to directory traversal.
/var/www/html/index.php with the following contents
<?php
$p = 'home.php';
if (isset($_GET['p']))
$p = $_GET['p'];
include ($p);
?>
/var/www/html/home.php with the following contents
<!DOCTYPE html>
<html>
<head>
<title>Hello, World!</title>
</head>
<body>
<a href="?p=home.php">home</a>
</body>
</html>
sudo systemctl start apache2.serviceuse auxiliary/scanner/http/http_traversalset rhosts <rhost>set path <filepath>runHTTP body data to send in the request
Directory traversal depth (default: 5)
File containing list of files to bruteforce for (default: /usr/share/metasploit-framework/data/wordlists/sensitive_files.txt)
HTTP request method to use (default: GET)
Vulnerable path. Ex: /foo/index.php?pg= (default: /)
Regexp pattern to determine successful directory traversal (default: ^HTTP/\d\.\d 200)
msf > use auxiliary/scanner/http/http_traversal
msf auxiliary(scanner/http/http_traversal) > set rhosts 127.0.0.1
rhosts => 127.0.0.1
msf auxiliary(scanner/http/http_traversal) > set path /?p=
path => /?p=
msf auxiliary(scanner/http/http_traversal) > run
[*] Running action: CHECK...
[+] Found trigger: ../
[+] Directory traversal found: ../
[*] Scanned 1 of 1 hosts (100% complete)
[*] Auxiliary module execution completed