HackBlue

Labs / Web config review

One missing slash in an alias

A location without a trailing slash plus an alias with one lets /assets../ step out of the static folder. Read the config and the log to see what was read through the gap.

  • Terminal mission
  • Advanced
  • 3 objectives
  • 0 of 3 solved

What you’re looking at

A location without a trailing slash plus an alias with one lets /assets../ step out of the static folder. Read the config and the log to see what was read through the gap.

Your goal: Show how one missing slash let visitors step out of the static folder.

Briefing
the story: what happened and what evidence you were handed.
Terminal
the dark box. It is a pretend Linux shell that runs in your browser. Type a command and press Enter. Nothing you type touches a real system.
Walkthrough
the numbered path. Each step says what to type and what you should see. Hints open one at a time.
Answer boxes
under each question step. Type what you found and press Check.

Start with step 1 in the walkthrough. Every step says what to do and what you should see. The whole thing takes about 2 min to talk through.

Briefing

nginx’s alias replaces the matched location prefix with a path. With location /assets and alias /srv/site/static/, a request for /assets../x becomes /srv/site/static/../x, one directory up, with no ../ ever reaching nginx’s normalizer.

The access log shows a visitor testing the classic ../ first, which nginx rejected, then the off-by-slash form.

analyst@web-02

web-02 · Web config review

Type help for the command list and objectives for your tasks. Everything runs in this browser.

Up and down arrows walk your history. Ctrl+L clears the screen. Try help, ls, and objectives.

The whole walkthrough

Every step in order, written to be read aloud: 270 words, about 2 min. It gives away every answer, so try the steps first.