201 字
1 分鐘
[OverTheWire] Bandit Level 18 → Level 19

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. 連線到伺服器並登入
Terminal window
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 登入
Terminal window
ssh bandit18@bandit.labs.overthewire.org -p 2220 -t sh
  1. 透過 cat 指令將 readme檔案內容呈現至畫面上,即可取得 Level 19 密碼!
Terminal window
cat readme

第 19 篇,共 34 篇本文屬於系列

[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

分享文章

生成精美分享圖或複製連結,與更多人分享本文。

繼續閱讀

沿著主題讀

基於共同的標籤與分類

換條路線

從其他文章中穩定抽取

最後更新於 ,距今已過 631 天

部分內容可能已過時