TCPサーバの接続情報と、ファイル in.c が与えられた。
in.c を送信すると、以下のメッセージが出力されて接続が切れた。
Information for connecting to a TCP server, and a file in.c were given.
I connected the server using in.c via "Send File". As a result, this message appeared and the connection was closed.
接続し直し、a を送信すると、以下のメッセージが出力されて接続が切れた。
Connecting again and sending a, this message appeared and the connection was closed.
ここで出てきた e8b7be43 は、a のCRC-32値である。
さらに、in.c を送信したときの通信を確認すると、最初の100バイトが最初のパケットで、残りの部分が次のパケットで送信されていた。
The value in the message e8b7be43 is the CRC-32 value of a.
I checked the communication while sending in.c using
最初のメッセージで出てきた 7a10d0ba は、この in.c の最初の100バイトのCRC-32値であった。
よって、1パケットで送られる程度に短く、かつCRC-32値が in.c 全体のCRC-32値の 38df65f2 であるようなC言語のソースコードを送信すると、それを実行してくれると推測した。
そして、そのようなソースコードを以下のプログラムで求めた。
The value 7a10d0ba, which was in the first message, is the CRC-32 value of this first 100 bytes of in.c.
From these findings, I guessed that sending a C source code which is short enough to be sent in a single packet and its CRC-32 value is 38df65f2, which is the CRC-32 value of the entire in.c, will make the source code be executed.
Therefore, I searched for such source code using this program.
以下のソースコードが求まった。
As a result, this source code was found:
Tera Term でサーバに接続し、このソースコードを貼り付けすると、シェルを起動できた。
シェルで ls -al コマンドを実行すると、ファイル flag.txt があることがわかった。
コマンド cat flag.txt を実行すると、flagが得られた。
I succeeded to launch the shell by connecting to the server using Tera Term and pasting this source code.
I executed a command ls -al on the server, and found a file flag.txt.
I obtained the flag by executing a command cat flag.txt.