引言
昨天学到:
tab 键自动补完
unzip ,这个昨天没有仔细讲,但基本使用相当简单,遇到 zip 档只要 unzip xxx.zip
就会自动解压缩。(若没有安装过,使用 sudo apt install unzip
)
zip 则是压缩用, zip xxx your_path/*
会将 your_path 目录下的所有档案压缩到 xxx.zip 中,没有安装的话可以藉由 sudo apt install zip
安装。
General Skills / Magikarp Ground Mission
这题比较特别,题目提供了一个 On-Demand Instance (随需实例) ,
简单来说就是一个有时间限制的虚拟主机,会计时1小时,时间到就会关闭。
按下右边的 Launch Instance ,下方会出现让你连线的命令,
复制起来贴到你自己的 shell 中,格式如:
$ ssh [email protected] -p 60635
ssh 是用来连结远端主机的命令,
并保证安全连线,上述的命令翻译成
「连结到主机 venus.picoctf.net
埠号 60635 ,以帐号 ctf-player 登入」
其中 -p
这个 option (选项) 用来指定埠号。
连线时会出现:
The authenticity of host '[venus.picoctf.net]:60635 ([3.131.124.143]:60635)' can't be established.
ECDSA key fingerprint is SHA256:[---一串英文跟数字---].
Are you sure you want to continue connecting (yes/no/[fingerprint])?
键入 yes 即可。
连结成功後输入题目给的密码: ee388b88
,成功登入取得 shell 操控权,
就可以跟自己的 shell 一样下命令。
你可以看到你的 shell $
前面的帐号与主机变成:
ctf-player@pico-chall$
表示现在正在 pico-chall 这个名字的主机上,帐号是 ctf-player 。
题目说先打 ls
命令,我们先照做,可以看到两个档案:
ctf-player@pico-chall$ ls
1of3.flag.txt instructions-to-2of3.txt
我们看 1of3.flag.txt
那个档案:
ctf-player@pico-chall$ cat 1of3.flag.txt
picoCTF{xxsh_
看起来是 flag 的一部分,且我们可以猜测一共3个部份。
再来看看 instructions-to-2of3.txt
:
ctf-player@pico-chall$ cat instructions-to-2of3.txt
Next, go to the root of all things, more succinctly `/`
它请我们到根目录 /
去:
ctf-player@pico-chall$ cd /
ctf-player@pico-chall$ ls
2of3.flag.txt boot etc instructions-to-3of3.txt lib64 mnt proc run srv tmp var
bin dev home lib media opt root sbin sys usr
可以看到有两个跟刚刚差不多的档案, 2of3.flag.txt
应该是第二部份的 flag ,
我们看看 instructions-to-3of3.txt
:
ctf-player@pico-chall$ cat instructions-to-3of3.txt
Lastly, ctf-player, go home... more succinctly `~`
咦?又要回去家目录吗,回去看看:
ctf-player@pico-chall$ cd ~
ctf-player@pico-chall$ ls
3of3.flag.txt drop-in
居然变了,有点神奇,看起来三个片段都拿到了,先看看 drop-in
是啥:
ctf-player@pico-chall$ cd drop-in/
ctf-player@pico-chall$ ls
1of3.flag.txt instructions-to-2of3.txt
原来是刚刚的第一片段,而第二片段在根目录,我们用个命令将他们串起来吧!
ctf-player@pico-chall$ cat {1of3.flag,/2of3.flag,../3of3.flag}.txt | tr -d '\n'
picoCTF{xxsh_0ut_0f_\/\/4t3r_3ca613a1}
大括号是分配律的概念,意思等同於
cat 1of3.flag.txt; cat /2of3.flag.txt; cat ../3of3.flag.txt;
可参考brace expansion。然後 output 由管道
|
传给 tr 当作 input ,
它会把换行符号\n
去掉後输出。
顺利得到 flag。
p.s: 我重新连线後,发现一开始我们根本不在家目录,
一开始就在 drop-in
中了,难怪之後回家目录不是一开始的样子。
<<: 【Day25】 Transformer 实作包(二)
>>: 表单 Controlled Component VS Uncontrolled Component ( Day 11 )
现在简单说明Spring boot专案的建立方式 专案的建立方式有以下几个方式 官网starter建...
依照之前介绍的内容都是属於在Hostinger提供的功能面,当然还有许多细项的功能或建置时会用到的,...
各位点进来的朋友,你们好阿 小的不才只能做这个系列的文章,但还是分享给点进来的朋友,知道一些程序语言...
K8s除了自带的Ingress Gateway外,还可以透过Istio Ingress Gatewa...
这个实用网路行销工具系列文,整理我平常研究的各项Digital Marketing Tools,帮助...