basic-file-exploit (Binary exploitation)
The program provided allows you to write to a file and read what you wrote from it. Try playing around with it and see if you can break it!
The program's source code with the flag redacted can be downloaded here.
Connect to the program with netcat:
$ nc saturn.picoctf.net 59093
添付ファイル
・program-redacted.c
とりあえず、実行してみる。
$ nc saturn.picoctf.net 59093
Hi, welcome to my echo chamber!
Type '1' to enter a phrase into our database
Type '2' to echo a phrase in our database
Type '3' to exit the program
1
1
Please enter your data:
%x%x%x%x
%x%x%x%x
Please enter the length of your data:
8
8
Your entry number is: 1
Write successful, would you like to do anything else?
2
2
Please enter the entry number of your data:
0
0
picoCTF{M4K3_5UR3_70_CH3CK_Y0UR_1NPU75_E0394EC0}
フラグが出てきてしまった。
picoCTF{M4K3_5UR3_70_CH3CK_Y0UR_1NPU75_E0394EC0}
ちなみに、最初に選択肢1を選び、何らかの文字を入力した後、2を選んでPlease enter the entry number of your data:
のところで0
を入力すれば、フラグが出力できる。