Level18

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.

Solution

As stated in the level goal, you get automatically logged out when you SSH into the system. There are still a couple of ways we can get the contents of the readme file. The ssh utility can be provided a command to execute instead of a login shell. We can also use a utility like scp to copy the file your local system.

root@0xCAB: /writeups/overthewire/bandit/level18/

$ ssh -p 2220 bandit18@bandit.labs.overthewire.org cat readme
...
bandit18@bandit.labs.overthewire.org's password:
awhqfNnAbc1naukrpqDYcF95h7HoMTrC

$ scp -P 2220 bandit18@bandit.labs.overthewire.org:~/readme .
...
bandit18@bandit.labs.overthewire.org's password:
readme 100% 33 0.1KB/s 00:00

$ cat readme
awhqfNnAbc1naukrpqDYcF95h7HoMTrC

$