-
Clone the repo
git clone https://github.com/1PingSun/Linux-CLI-CTF.git
-
Build Docker
- If your computer is x86_64:
docker build -t my-ssh-enabled-ubuntu .
- If your computer is Apple Silicon
docker build --platform linux/amd64 -t my-x86-app .
- If your computer is x86_64:
-
Run Docker
- If your computer is x86_64:
docker run --cpus="1.5" --memory="512m" --pids-limit=100 -d -p 2222:22 my-ssh-enabled-ubuntu
- If your computer is Apple Silicon
docker run --cpus="1.5" --memory="512m" --pids-limit=100 --platform linux/amd64 -d -p 2222:22 --name my-x86-app-container my-x86-app
- If your computer is x86_64:
-
Connect the target machine
ssh stu{ID}@localhost -p 2222
請登入 SSH 主機並拿到旗子。
Flag 格式:`/P!ng\\{.*?\\}/`
- 連線靶機,即可得到 Flag:P!ng{welcome_to_the_ctf}
P!ng{welcome_to_the_ctf}
找到俄羅斯娃娃(Matryoshka Doll)裡的秘密
Flag 格式:`/P!ng\\{.*?\\}/`
- 使用 tab 鍵進入資料夾
Mikhail
的最深層,即可找到名為P!ng{Secret_In_Matryoshka_Doll}
的檔案,此檔名即為 Flag。
P!ng{Secret_In_Matryoshka_Doll}
請在 `/home` 中找到幽靈使用者。
Flag 格式:`/P!ng\\{.*?\\}/`
- 查看
/home
存在的資料夾。ls /home
- 找到名為
P!ng{you_found_the_ghost}
的資料夾,即為 Flag。
P!ng{you_found_the_ghost}
貓咪很可愛!
Flag 格式:`/P!ng\\{.*?\\}/`
- 在家目錄使用 cat 將
Iam_a_cat
檔案的內容顯示出來,即可獲得 Flag。
P!ng{meow_meow_meow}
`run_me` 檔好像沒有執行去權限欸 🤔
Flag 格式:`/P!ng\\{.*?\\}/`
- 賦予檔案執行權
chmod +x run_me
- 執行檔案,即可獲得 Flag
./run_me
P!ng{execution_success}
- 建立名為
dumpling
的資料夾mkdir dumpling
- 進入資料夾並建立名為
pork
的檔案cd dumpling touch pork
- 執行
make_dumplings
即可獲得 Flagcd ~ ./make_dumplings
P!ng{Yuloong_is_better_then_Bafang_Yunji}
請在垃圾堆(`trash`)中找到鑰匙(`SECRET_KEY`)後,將鑰匙拷貝並貼上至檔案 `key` 中,最後執行 `open_the_dorr` 確認鑰匙是否正確無誤。
Flag 格式:`/P!ng\\{.*?\\}/`
- 使用 vim 打開
trash
檔vim trash
- 在命令模式查詢字串
SECRET_KEY
- 在普通模式輸入:
/SECRET_KEY
- 按下 Enter 鍵查詢
- 在普通模式輸入:
- 在普通模式輸入
yy
複製整行密碼 - 儲存並退出 vim 編輯介面:
:wq
- 建立
key
檔vim key
- 在普通模式按下
p
鍵貼上密碼 - 儲存並退出 vim 編輯介面:
:wq
- 執行
open_the_door
即可得到 Flag./open_the_door
P!ng{password-1234qwer}
乾草裡找一根針?
請下載附檔壓縮檔後解壓縮並在茫茫目錄中找到副檔名為 `.flag` 的檔案,接著在該檔中尋找 flag。
Flag 格式:`/P!ng\\{.*?\\}/
- 使用
wget <url> -O filename
下載題目附件壓縮檔。 - 解壓縮
tar -xvf filename
- 使用 find 找到副檔名為
.flag
的檔案find . -name "*.flag"
- 使用 grep 尋找 Flag 特徵,即可得到 Flag
grep "ng{" filename
P!ng{never_find_me}