Shell
cat
Description
ssh cat@cat.problem.cpctf.space password: cat
ssh接続すると-flag-.txtがあるが、catできない。
$ ssh cat@cat.problem.cpctf.space The authenticity of host 'cat.problem.cpctf.space (2400:8500:1302:841:150:95:178:211)' can't be established. ECDSA key fingerprint is SHA256:S+YLXmWq0dATJ6BGsLlsVr7J5zjMvLcY6mmE6wDkMaM. Are you sure you want to continue connecting (yes/no)? yes Warning: Permanently added 'cat.problem.cpctf.space' (ECDSA) to the list of known hosts. cat@cat.problem.cpctf.space's password: [cat@cat ~]$ ls -flag-.txt [cat@cat ~]$ cat -flag-.txt cat: invalid option -- 'f' Try 'cat --help' for more information.
ので、リダイレクトでcatに渡した。
[cat@cat ~]$ cat < -flag-.txt FLAG_100{Fi1e5_c0n74ining_hyphen5_4re_ug1y}[cat@cat ~]$
FLAG : FLAG_100{Fi1e5_c0n74ining_hyphen5_4re_ug1y}
command_not_found
Description
ssh nothing@command_not_found.problem.cpctf.space password: nothing
$ ssh nothing@command_not_found.problem.cpctf.space The authenticity of host 'command_not_found.problem.cpctf.space (2400:8500:1302:841:150:95:178:211)' can't be established. ECDSA key fingerprint is SHA256:S+YLXmWq0dATJ6BGsLlsVr7J5zjMvLcY6mmE6wDkMaM. Are you sure you want to continue connecting (yes/no)? yes Warning: Permanently added 'command_not_found.problem.cpctf.space' (ECDSA) to the list of known hosts. nothing@command_not_found.problem.cpctf.space's password: [nothing@command_not_found ~]$ ls bash: ls: No such file or directory [nothing@command_not_found ~]$ ls -al bash: ls: No such file or directory [nothing@command_not_found ~]$
何もない。。
[nothing@command_not_found ~]$ cat /home/nothing/ .bash_logout .bash_profile .bashrc flag.txt [nothing@command_not_found ~]$ cat /home/nothing/flag.txt bash: cat: No such file or directory
保管で見るとflag.txtがあるが、読み取れない。 $PATHを見ると通ってなかった。
[nothing@command_not_found ~]$ echo $PATH
/binのパスを通す。
[nothing@command_not_found ~]$ export PATH=$PATH:/bin [nothing@command_not_found ~]$ echo $PATH :/bin [nothing@command_not_found ~]$ ls flag.txt [nothing@command_not_found ~]$ cat flag.txt FLAG_200{y0u_533m_70_kn0w_4b50lu73_p47h}
FLAG : FLAG_200{y0u_533m_70_kn0w_4b50lu73_p47h}
flag_is_command
Description
ssh contestant@flag_is_command.problem.cpctf.space password: contestant
$ ssh contestant@flag_is_command.problem.cpctf.space contestant@flag_is_command.problem.cpctf.space's password: [contestant@flag_is_command ~]$ ls [contestant@flag_is_command ~]$ ls -al total 24 drwx------ 1 contestant contestant 4096 Apr 18 10:27 . drwxr-xr-x 1 root root 4096 Apr 15 14:59 .. -rw-r--r-- 1 contestant contestant 21 Jan 7 16:11 .bash_logout -rw-r--r-- 1 contestant contestant 57 Jan 7 16:11 .bash_profile -rw-r--r-- 1 contestant contestant 141 Jan 7 16:11 .bashrc [contestant@flag_is_command ~]$ FLAG_200\{b3_4_TAB_5p4mm3r\}
Tabで保管したらフラグあった。
FLAG : FLAG_200{b3_4_TAB_5p4mm3r}
Hidden
Description
ssh hidden@hidden.problem.cpctf.space password: hidden
隠しファイルになっているのでls -aオプションで表示させる。
[hidden@hidden ~]$ ls -al total 32 drwx------ 1 hidden hidden 4096 Apr 18 10:29 . drwxr-xr-x 1 root root 4096 Apr 9 15:25 .. -rw-r--r-- 1 hidden hidden 21 Jan 7 16:11 .bash_logout -rw-r--r-- 1 hidden hidden 57 Jan 7 16:11 .bash_profile -rw-r--r-- 1 hidden hidden 141 Jan 7 16:11 .bashrc -rw-r--r-- 1 hidden hidden 36 Apr 9 15:25 .flag.txt -rw-r--r-- 1 hidden hidden 45 Apr 9 15:25 message [hidden@hidden ~]$ cat .flag.txt FLAG_100{d07f1l35_4r3_h1dd3n_f1l35}
FLAG : FLAG_100{d07f1l35_4r3_h1dd3n_f1l35}
Description
flag.txtにフラッグが書いてあります。 matryona.zip
matryona.zipが与えられる。 解凍すると1991zipとpassword.txtが与えられる。
~/Desktop/CPCTF/matryona ᐅ cat password.txt traP_cpctf
traP_cpctfを使って1991回解凍するのが想定される。 シェルスクリプトで解凍する。たまにMiscで使うやつ。
extract.sh
while [ "`find . -type f -name '*.zip' | wc -l`" -gt 0 ]; do find -type f -name "*.zip" -exec unzip -P traP_cpctf -- '{}' \; -exec rm -- '{}' \;; done
(snip) Archive: ./7.zip extracting: 6.zip Archive: ./6.zip extracting: 5.zip Archive: ./5.zip extracting: 4.zip Archive: ./4.zip extracting: 3.zip Archive: ./3.zip extracting: 2.zip Archive: ./2.zip extracting: 1.zip Archive: ./1.zip inflating: flag.txt ~/Desktop/CPCTF/matryona ᐅ cat flag.txt FLAG_200{m47ry05hk4_15_n1ckn4m3_0f_m47ry0n4}
nc
Description
ncというコマンドを使って接続してみましょう。
nc nc.problem.cpctf.space 4060
(ヒントはありません。ヒントを開放しても獲得できる点数が減るだけなので注意してください。)
~ ᐅ nc nc.problem.cpctf.space 4060 Congratulation!!!FLAG is FLAG_100{nc_test}
FLAG : FLAG is FLAG_100{nc_test}
veeeeeeery_long _text
Description
veeeeeery longなテキストファイルがあるのでgrepする
[qwerty@veeeeeeery_long_text ~]$ cat qwerty | grep FLAG FLAG_0{just_a_dummy_flag_haha}cis;wOYQMt!\1qAN{Rs(ns=:YM6Xho<lL:8RIK#kcDXLUcN*5.6W1L+sF3HRI;x$>eS(Jm K<-O.m,g+!6:)[olth0WCG-0E(}FLAG_100{50m3t1m35_u53ful_p1p3}J0fW33d6j-m'tTuKi--y$1aK:&)Rsu_MbvnPclagU0
FLAG : FLAG_100{50m3t1m35_u53ful_p1p3}