Wednesday, July 1, 2015

OverTheWire - Bandit - Level 19

Level Goal

The password for the next level is stored in a file readme in in the home directory. Unfortunately, someone has modified the .bashrc to log you out when you log in with SSH.

Commands you may need to solve this level

  • ssh
  • ls
  • cat

Helpful Reading Material

  • None provided, however I recommend reading up on the ssh command.

Log in to any other level you have completed. Let's perform an ls on the bandit18 directory to see what's in there.
ls /home/bandit18
We do indeed see a readme file in the home directory. However, if we try to log in to bandit18 we are immediately kicked out because someone has messed with the .bashrc - don't believe me? Try it.
ssh bandit18@bandit.bandit.labs.overthewire.org
If we check the man page of ssh
man ssh
We see in the SYNOPSIS section that ssh can take a [command] after the [user@]hostname. Let's try to do something with that.
ssh bandit18@bandit.bandit.labs.overthewire.org cat readme
This will read the readme file in the directory which will display the password for bandit19.

No comments:

Post a Comment