Bandit Level 18 Solution

bandit level 18 will teach you new trick, which is how to execute a command right after you login into machine via SSH.

First, Let’s login into bandit level 18 with our new trick

ssh -p 2220  'ls -la'

now this is where the trick is, SSH will execute that command that yo write between single quotes right after you login.

Now, you need to provide the password that we got from the previous level


you should get a list of all files that are in home directory of bandit 18

Now, let’s login into the machine again but with “cat” command to get the content of readme file

ssh -p 2220  'cat readme'

and you should get the password for the next level