roaris / ctf-log

0 stars 0 forks source link

picoCTF: file-run2 (Reverse Engineering) #13

Open roaris opened 3 months ago

roaris commented 3 months ago

https://play.picoctf.org/practice/challenge/267

roaris commented 3 months ago

実行権限を付与して実行

$ file run
run: ELF 64-bit LSB pie executable, x86-64, version 1 (SYSV), dynamically linked, interpreter /lib64/ld-linux-x86-64.so.2, BuildID[sha1]=106bb01c6a4466da1f636e31c9167e8a3d18c89a, for GNU/Linux 3.2.0, not stripped
$ ./run
zsh: permission denied: ./run
$ chmod +x run
$ ./run
Run this file with only one argument.
$ ./run a
Won't you say 'Hello!' to me first?
$ ./run Hello!
The flag is: picoCTF{F1r57_4rgum3n7_f65ed63e}  
roaris commented 3 months ago

stringsコマンドでもフラグを得られる

$ strings run | grep ^[^_.]
/lib64/ld-linux-x86-64.so.2
libc.so.6
puts
printf
strcmp
GLIBC_2.2.5
u+UH
[]A\A]A^A_
picoCTF{F1r57_4rgum3n7_f65ed63e}
Run this file with only one argument.
Hello!
The flag is: %s
Won't you say 'Hello!' to me first?
:*3$"
GCC: (Ubuntu 9.4.0-1ubuntu1~20.04.1) 9.4.0
crtstuff.c
deregister_tm_clones
completed.8061
frame_dummy
run.c
flag
puts@@GLIBC_2.2.5
printf@@GLIBC_2.2.5
strcmp@@GLIBC_2.2.5
main