Gitのレポジトリをアップロードするとcommitをしてくれるサービスの情報と、
ファイル gcaas.zip および prepare-git-repo.sh が与えられた。
このサービスは、以下の手順で利用が可能である。
git init コマンドでGitレポジトリにする。git add コマンドでステージングする。.git ディレクトリを含む) をtar.gzアーカイブにする。.git ディレクトリなどがアーカイブのルートに配置されるようにする。
Information about a service that makes a commit to uploaded Git repositories,
and files gcaas.zip and prepare-git-repo.sh were given.
We can use this service by these steps:
git init command.git add command..git directory) of the directory into a tar.gz archive using .git directory should be placed in the root of the archive.アーカイブファイルをサービスに送信すると、処理結果の標準出力と標準エラー出力の内容が返される。
問題文より、flagは /flag にあるということなので、以下の内容をレポジトリ内の .git/hooks/pre-commit ファイルに保存し、
同様にレポジトリのアーカイブを作成して送信した。
Sending archive files to the service, what is printed to the standard output and standard error in the process are returned.
As the flag is in /flag according to the challenge description, I put following contents to the .git/hooks/pre-commit file in the repository,
created an archive of the repository in the same way, and sent the archive.
すると、標準エラー出力の内容としてflagが得られた。
As a result, the flag was returned as the standard error.