TCPサーバの接続情報が与えられた。
また、ELFファイル rop-returns と、C言語のソースコード rop-returns.c が与えられた。
rop-returns.c は、最初に "/bin/sh" のアドレスを出力した後、以下の操作ができるプログラムだった。
Information to connect to a TCP server was given.
Also, an ELF file rop-returns and a C source code rop-returns.c were given.
rop-returns.c was a program that first prints the address of "/bin/sh", and then provides these operations:
似たプログラムを WaniCTF'21-spring の 03 rop machine easy で扱ったことがあり、
スタックに積む値を低位から高位の順で入力していけばよさそうだと予想できた。
以下の順で操作を行うことで、シェルを起動できた。
I have dealt with a program like this in 03 rop machine easy in WaniCTF'21-spring.
From this experience, I guessed that the values to put on the stack should be entered from the lower address to the higher address.
I succeeded to launch the shell by doing operations in this order:
"/bin/sh" のアドレス)
(the printed address of "/bin/sh")
ls -al コマンドを実行するとファイル flag.txt があることがわかり、cat flag.txt コマンドを実行するとflagが得られた。
Executing a command ls -al revealed that there is a file flag.txt, and I obtained the flag by executing a command cat flag.txt.