All levels

Bandit · Level 17

Level 17

Login

SSH: ssh [email protected] -p 2220

Challenge URL: https://overthewire.org/wargames/bandit/bandit18.html

Task

There are 2 files in the home directory: passwords.old and passwords.new. The password for the next level is in passwords.new and is the only line that has been changed between passwords.old and passwords.new.

Solution

We got the RSA private key from the previous level, so we can use it with the -i flag in SSH command.

Note: Don't forget to make a note of this level's password at /etc/bandit_pass/bandit17.

These are the files present:

bandit17@bandit:~$ ls
passwords.new  passwords.old

We can use diff to compare lines of two files:

diff --suppress-common-lines -i -y passwords.old passwords.new

-i is to ignore cases and -y is to display side by side.


One liner: diff --suppress-common-lines -i -y passwords.new passwords.old | awk {'print $1'}