mobile wallpaper 1mobile wallpaper 2mobile wallpaper 3
178 字
1 分鐘
[OverTheWire] Bandit Level 18 → Level 19
2025-01-24

Level Goal#

The password for the next level is stored in a file readme in the homedirectory. Unfortunately, someone has modified .bashrc to log you out when you log in with SSH.

Commands you may need to solve this level#

  • ssh
  • ls
  • cat

My Answer (Step by step)#

  1. 連線到伺服器並登入
ssh bandit18@bandit.labs.overthewire.org -p 2220

{{< alert info >}} 連線後可以發現馬上被登出 {{< /alert >}}

  1. 連線回上一等級,並透過 cat 指令找尋伺服器還有哪些shell可以使用
/bin/sh
ssh bandit17@bandit.labs.overthewire.org -p 2220
cat /etc/shells
# /usr/bin/sh
# /bin/bash
# /usr/bin/bash
# /bin/rbash
# /usr/bin/rbash
# /usr/bin/dash
# /usr/bin/screen
# /usr/bin/tmux
# /usr/bin/showtext

{{< alert info >}} 根據指令結果,可以發現還有 sh, tmux 等 shell可以使用 {{< /alert >}}

  1. 重新連線伺服器,但這次指定透過 sh shell 登入
ssh bandit18@bandit.labs.overthewire.org -p 2220 -t sh
  1. 透過 cat 指令將 readme檔案內容呈現至畫面上,即可取得 Level 19 密碼!
cat readme
分享

如果這篇文章對你有幫助,歡迎分享給更多人!

[OverTheWire] Bandit Level 18 → Level 19
https://m21248074.github.io/blog/posts/2025-01-24-post092436/
作者
Cavey (凱維)
發布於
2025-01-24
許可協議
CC BY-NC-SA 4.0

部分資訊可能已經過時

目錄