TCPサーバの接続情報と、以下のファイルが与えられた。
Information for connecting to a TCP server, and these files were given.
docker-compose.ymlDockerfileflag.pymain.py
main.py は、指定したファイルの内容を出力するが、以下の条件のいずれかに当てはまる場合は出力しない、というものだった。
flag.py である。
さらに、main.py は flag を import している。
このようにファイルを import すると、__pycache__ が作成される。
そこで、出力するファイルとして ./__pycache__/flag.cpython-311.pyc を指定すると、flagを含む出力が得られた。
main.py outputs contents of the specified file unless it satisfies any of these conditions:
flag.py.
Note that main.py imports flag.
Importing a file like this will result in creating __pycache__.
I specified ./__pycache__/flag.cpython-311.pyc as the file to output. The result contained the flag.