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

連線後可以發現馬上被登出

  1. 連線回上一等級,並透過 cat 指令找尋伺服器還有哪些shell可以使用
ssh bandit17@bandit.labs.overthewire.org -p 2220
cat /etc/shells
# /bin/sh
# /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

根據指令結果,可以發現還有 sh, tmux 等 shell可以使用

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