Discordのアカウント StegBot が指定され、DMで /info を送るよう指示があった。
送ってみると、ソースコードとしてGitHubのURLが提示された。
app/app.ts を読むと、以下のことがわかった。
/embed コマンドを送り、URLを指定すると、そのURLから内容をダウンロードして渡してくれる。app.log に書き込まれる。bof.jpg に FLAG を埋め込む処理を行う。/tmp/images/ 内に保存される。
試しに /embed コマンドに渡すURLとして file:///etc/passwd を渡してみると、/etc/passwd の内容と思われるファイルが得られた。
app/jail.cfg から /home/ctf/app を /app にマウントしているらしいことがわかったので、
URL file:///app/app.log を渡すと、ログの内容を取得できた。
ログには bof.jpg を処理した時の出力ファイルのパスとパスワードが記録されていた。
このパスをもとにしたURLを指定してファイルを取得し、このパスワードを用いて
A Discord account StegBot was specified and there was an instruction to send /info as DM to the account.
Sending that, it posted an URL for GitHub as the source code.
Reading app/app.ts, I found these things:
/embed command as a DM and specifying an URL have it to download data from the URL and to post the data.app.log.FLAG to bof.jpg./tmp/images/.
I tried passing an URL file:///etc/passwd to the /embed command. As a result, I obtained what looks like the contents of /etc/passwd.
Finding that it looks like mounting /home/ctf/app to /app by reading app/jail.cfg,
I passed an URL file:///app/app.log and succeeded to obtain the contents of the log.
The log had the path of the output file and the password used in processing bof.jpg.
I retrieved the output file by specifying the URL created from the path and used