Module 10: Directory Traversal Attacks

Directory Traversal Overview

Accessing The Lab Machines

Start the VPN, the VM, and add the ip to your hosts file.

Understanding Suggestive Parameters

A paremeter that hints at what it does or the types of data values it works with, typically vai its name.

Sample search request

GET /search/Hello%20World! HTTP/1.1

Sample file retrieval request

GET /admin/dashboard/manage/handler.aspx?file=ourFile.jpeg HTTP/1.1

Sample Suggestive Parameters

?file=
?f=
/file/someFile

?location=
?l=
/location/someLocation

search=
s=
/search/someSearch

?data=
?d=
/data/someData

?download=
?d=
/download/someFileData

Relative vs. Absolute Pathing

Absolute Pathing

The full path, i.e. /home/kali/Desktop

Example command utilizing absolute pathing

Extra Mile I

Try it in your own VM.

Relative Pathing

The path to a target file/folder relative to your current working directory.

Group File Read from a relative perspective in /etc/

Group File Read with traversal strings

Extra Mile II

Do it on your own VM.

Directory Listing

Parameter Analysis

Path Variable

The value being /var/www/html/demo/css indicates we're likely dealing with absolute pathing. This also tells us the target is likely running Linux with a web-root of /var/www/html.

Evidence of Directory Listing

Test by replacin the path with ..%2F

First traversal string usage
Var Directory
Attempting to access /etc/passwd
Disclosure of a system-level user

Directory Traversal Sandbox

Directory Traversal - Exploitation

Directory Traversal Sandbox Landing Page
Directory Traversal Sandbox Absolute Pathing
Directory Traversal Sandbox - Relative Pathing

Wordlist/Payload Lists

Automated attempts are only as good as the wordlist used β€” we'll be using seclists/Fuzzing/LFI/LFI-Jhaddix.txt.

Fuzzing the Path Parameter

Erroneous Output to be Filtered

Enumerating out the target Operating System

Case Study: Home Assistant

Initial Application Assessment

Login Form for Home Assistant
HTTP History Tab

Fuzzing the Web-Root and Analyzing the 404 Response size

Fuzzing the /fontawesome/ URI and analyzin the 404 response size

Exploitation

Case Study /etc/passwd
Configuration file for Home Assistant
Configuration.yaml

Fuzzing the /fontawesome/ URI

Extra Mile

Do the lab yourself.

Wrapping Up

We did the thing.

Last updated