OverTheWire.org Walkthrough: Bandit

~ Level 17→18 ~

Level Description

There are 2 files in the homedirectory: 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

NOTE: if you have solved this level and see ‘Byebye!’ when trying to log into bandit18, this is related to the next level, bandit19

The commands listed for this level are: cat, grep, ls, and diff


Research Before Solving

The only command here we should be unfamiliar with is diff. This command is used to compare the contents of files line by line. The ouput will show unique lines that each file has. The syntax is as follows: diff [option] [file] [file]


Solution Walkthrough

Log in to the OverTheWire server as bandit17 and use ls to list files in the home directory.

ls showing passwords.old and passwords.new

We are shown the two files we need so we are ready to compare them. We are going to use diff passwords.old passwords.new. Be aware the output order will be determined by the order in which we list the files.

one unique line printed per file

In the command, we listed the files as passwords.old passwords.new, therefore the first unique line will be from the first file and the second unique line will be from the second file. Furthermore we are told the password to the next level is in the passwords.new file.

Record the password: kfBf3eYk5BPBRzwjqutbbfE887SVc5Yd, exit out of the session, and continue to the next level!