The Goal
The home directory contains two files: passwords.new and
passwords.old. The password for Level 18 is the one line that was changed
between the two files.
The Approach
diff compares two files line by line and reports the differences. The line
marked with < belongs to the first file (passwords.new), which
is the updated version containing the password:
bandit17@bandit:~$ ls
passwords.new passwords.old
bandit17@bandit:~$ diff passwords.new passwords.old
42c42
< password
---
> password
The line from passwords.new (marked <) is the password for
the next level.
Notably, logging into bandit18 with this password immediately logs you out. That behavior is explained in the next level.
Commands Covered
diff file1 file2, show the differences between two files; lines prefixed<are from file1,>from file2