WeChall - Training - Warchall - The Beginning

Challenge

Warchall 入门挑战。在 WeChall 挑战页面注册 SSH 账号,然后 SSH 登录 Warchall 服务器(ssh -p 19198 <username>@warchall.net),完成 Level 0-5 六个初始关卡。答案以逗号分隔提交,格式为 Solution1,Solution2,Solution3,Solution4,Solution5,Solution6(对应 Level 0-5)。

Solution

SSH 登录后,关卡目录在 /home/level/,每关还有一个副本在 ~/level/(你的 home 目录下)。

Level 0 (/home/level/00_welcome/):

1
$ cat /home/level/00_welcome/README.md

Level 1 (/home/level/01_choice_tree/):

1
2
3
4
5
6
$ ls /home/level/01_choice_tree/
blue green README.md red
$ find /home/level/01_choice_tree/ -type f
/home/level/01_choice_tree/blue/hats/grey/solution/patience/SOLUTION.txt
...
$ cat /home/level/01_choice_tree/blue/hats/grey/solution/patience/SOLUTION.txt

在目录树中探索,选择 blue 路径(提示: "become a gray hat"),深入到 blue/hats/grey/solution/patience/SOLUTION.txt

Level 2 (/home/level/02/):

1
2
3
4
5
6
7
$ ls /home/level/02/
documents photos
$ ls -al /home/level/02/
drwxr-xr-x 2 root level02 4096 Jan 10 2023 documents
drwxr-xr-x 2 root level02 4096 Jan 11 2023 photos
drwxr-xr-x 2 root level02 4096 Jan 11 2023 .porb
$ cat /home/level/02/.porb/.solution

ls 看不到答案,用 ls -al 发现隐藏目录 .porb

Level 3 (/home/level/03/):

1
2
$ cat /home/level/03/.bash_history
The solution to SSH3 is: RepeatingHistory

读取 .bash_history 文件直接获得答案。

Level 4 (/home/level/04_kwisatz/):

1
2
3
4
5
6
7
$ cat /home/level/04_kwisatz/README.nfo
Look in your ~
$ ls -la ~/level/04_kwisatz/
---------- 1 <username> <username> 248 Jun 4 05:02 README2.md
-rw-r--r-- 1 <username> <username> 140 Jun 4 05:02 README.txt
$ chmod u+r ~/level/04_kwisatz/README2.md
$ cat ~/level/04_kwisatz/README2.md

README.nfo 提示看 home 目录。~/level/04_kwisatz/README2.md 权限为 ----------(无任何权限),但文件所有者是自己,用 chmod u+r 添加读权限。

Level 5 (/home/level/05_privacy/):

1
2
3
4
$ cat /home/level/05_privacy/README.md
# WAR#5: Privacy
Please protect your ~ from any other people than yourself.
The 5th solution is "OKPRIVATE" without the quotes.

README 直接给出答案。实际操作是用 chmod 700 ~ 保护 home 目录不被其他用户访问。

bitwarrior,patience,HiddenIsConfig,RepeatingHistory,AndOfCourseIDoKnowChown,OKPRIVATE