WebページのURLと、サーバのファイル一式が与えられた。
Webページは、LaTeXのソースコードを送信するとPDFを生成してくれるものだった。
与えられたファイルを調べると、送信したLaTeXのソースコードが配置されるディレクトリの2階層上にファイル flag があることがわかった。
また、app/app.py より、送信したデータに flag という文字列が含まれているとデータ全体が消されることがわかった。
\newcommand を用いて flag を fl と ag に分割して定義することで、
flag をそのまま含めずに flag を表すことができる。
これを用いて \input で ../../flag を取り込もうとしたが、エラーになってしまった。
flagに含まれる特殊文字が影響していると考え、外部ファイルの内容をそのまま取り込む方法を探すと、
MasaYan Information LaTeX で紹介されている \verbatiminput がエラーにならずに使えることがわかった。
これらを組み合わせた以下のソースコードを送信することで、flagが得られた。
An URL of a web page and files for the server were given.
The web page accepts LaTeX source code and generates PDF files from that.
Checking the given files, I found that there is a file flag on the directory two levels upper from the directory where tha LaTeX source code sent is placed.
Also, from app/app.py, I found that the data sent is turned into an empty string when it contains a string flag.
We can express flag without including flag directly by splitting flag to fl and ag with \newcommand.
I tried to put the contents of ../../flag via \input, but it resulted in errors.
I guessed that this is caused by some special characters in the flag, and searched for a way to put contents of external files without processing.
As a result, I found that \verbatiminput, which was introduced on MasaYan Information LaTeX, is available in the environment for this challenge.
In conclusion, I obtained the flag by sending this source code: