OverTheWire.org Walkthrough: Bandit

~ Level 18→19 ~

Level Description

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 that may be required while solving are: ssh, ls, and cat


Research Before Solving

There are no new commands to learn for this level so we must use what we already know.


Solution Walkthrough

Log in as you normally do to the OverTheWire server, this time using bandit18 as the username.

During previous levels we used a pipe symbol to run multiple commands so that the second command would use the ouput of the first command as input. Let's try to run two commands now but without the pipe symbol. The idea behind this is that we will ssh into the server and then immediately perform another command before the session is terminated.

We know the password is located in the home directory in a file by the name of readme. Our command will be as follows: ssh bandit18@bandit.labs.overthewire.org -p 2220 cat readme

password to bandit19

We are once again kicked off of the server, however, the password to the next level was printed before this happened!

Password:IueksS7Ubh8G3DCwVzrTd8rAVOwq3M5x