1
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

毎日write up 2日目 Forbidden Paths

Posted at

問題

Description

Can you get the flag?
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?
Additional details will be available after launching your challenge instance.
スクリーンショット 2025-05-06 0.07.58.png

どうやら絶対パスだとflagは取れないらしい(もはや答えでは?)

解法

試しに書いてあるdivine-comedy.txtを入れてReadボタンを押してみる
スクリーンショット 2025-05-06 0.10.23.png
read.phpというパスに飛ばされて先程のdivine-comedy.txtらしきものが表示された。
どうやらphpのファイルで入力されたパスのファイルを取ってきているらしい
現在が/usr/share/nginx/html/らしいので、4つ戻った先にflag.txtはあるので、相対パスで../../../../flag.txtと入力すればflagが手に入る

1
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
1
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?