TCPサーバの接続情報が与えられた。
また、ELFファイル chall と、C言語のソースコード bof.c が与えられた。
bof.c を読むと、gets 関数を用いて入力を読み込む部分と、flagの内容を出力する部分があった。
challを逆アセンブルすると、入力は -0x40(%rbp) に読み込まれ、リターンアドレスは %rbp の8バイト先にあることがわかった。
すなわち、入力の最初から 0x48 バイト先がリターンアドレスである。
flagの内容を出力する部分のアドレスに書き換える以下のデータを「ファイル送信」することで、flagが得られた。
Information to connect to a TCP server was given.
Also, an ELF file chall and a C source code bof.c were given.
Reading bof.c, I found a part to read input using the function gets, and a part that prints the contents in flag.
Disassembling chall using "objdump" from -0x40(%rbp) and that the return address is 8 bytes ahead from %rbp.
This means that the return address is 0x48 bytes ahead from the beginning of the input.
I connected to the server using flag via "Send file" to obtain the flag.