Bandit
Level 18
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.
Solution
This seems interesting. As stated above, when we login using our credentials, we are immediately logged out.
We can solve this level by providing a command while logging in via SSH
From the SSH Docs:
If a command is specified, it is executed on the remote host instead of a login shell
Our Final Command:
$ ssh bandit18@bandit.labs.overthewire.org -p 2220 'cat ~/readme'
Solution Screenshot:
We have the password for next Level, just for our curiosity, lets see what changes were made in .bashrc
file.
Command used:
$ ssh bandit18@bandit.labs.overthewire.org -p 2220 'cat ~/.bashrc'
Below is output of above command, the end part of our .bashrc
contains some changes:
This was Level 18.