Bandit Level 18 → Level 19

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


From ssh man page, we can actually append an command after our login to execute it. Since we know which file the password stored, we can just display the file before we got logout

ssh bandit18@bandit.labs.overthewire.org cat readme
IueksS7Ubh8G3DCwVzrTd8rAVOwq3M5x

Another way is to use scp, secure file transfer using the private key we created from level16→level17 to copy the file from bandit18 home directory to /tmp. Everything done inside bandit17 with the bandit18 login password. The next password from both methods are the same as expected.

scp -i /tmp/key/b16pkey bandit18@localhost:readme /tmp/tmpfile/readme
cat /tmp/tmpfile/readme
IueksS7Ubh8G3DCwVzrTd8rAVOwq3M5
Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s