HackBlue

Labs / Web server logs

The traversal the filter missed

A download endpoint blocks ../ in file names. One request still came back 200 with the size of /etc/passwd. Find the encoding that slipped through and what else it read.

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

What you’re looking at

A download endpoint blocks ../ in file names. One request still came back 200 with the size of /etc/passwd. Find the encoding that slipped through and what else it read.

Your goal: Find the encoding that slipped past a traversal filter and what files it read.

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.

Words you will meet

PDF
Portable Document Format
URL
web address

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

docs-01 serves PDFs through /download?file=<name>. After a pen test last year, a filter was added that rejects file names containing ../ or %2e.

Rejected requests return 400 with a 31-byte body. A real PDF is hundreds of kilobytes. Anything else in between deserves a look.

analyst@docs-01

docs-01 · Web server logs

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: 284 words, about 2 min. It gives away every answer, so try the steps first.