Challenge Description

HNF26 Directors Traversal

The challenge pointed to a web application called “The Drawer”, which was hosted on Vercel during the CTF. The description stated:

Description

The director has hidden something important deep within the server’s filesystem. The drawer looks harmless, but perhaps the files aren’t as secure as they seem. Can you find your way out of the drawer and retrieve the director’s secret flag.txt?

Visiting the site presented an interface listing public papers (/welcome.txt, /hours.txt, /notice.txt), along with an input form to open any file by specifying its path.

I clicked on /notice.txt to inspect its contents.

HNF26 Directors Traversal 2

The file contained the following message:

These three papers are the public copies.
flag.txt is the master copy. It is kept in the folder above this one.

The note gave an explicit path clue, stating that flag.txt was located in the parent directory directly above the drawer.

HNF26 Directors Traversal 3

Because the application allows user-controlled paths without strict validation, it was vulnerable to directory traversal. I returned to the input form and entered ../flag.txt to navigate out of the drawer folder.

Directory Traversal (Dot-Dot-Slash)

Path traversal occurs when an application includes user input into filesystem operations without sanitizing relative path sequences. Supplying ../ walks up the directory tree, allowing access to files outside the intended root folder.

Reference: PortSwigger - Directory Traversal

Submitting ../flag.txt successfully loaded the file from the parent directory:

HNF26 Directors Traversal 4

Flag

HNF26{one_folder_above_the_drawer}