Bandit level 18
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.̈́
This one also making it hard for us to log in, this time we get instantly logged out once we log in. How can we circumvent this issue? Do we need to stay logged in? Can we send commands directly over ssh? A look in the man pages should provide useful information
Useful commands
- ls
- cat
- ssh
Solution - Spoiler Alert
When we try to log in with ssh we get instantly logged out. Luckily I am very used to sending commands over ssh in my homelab. At the end of a ssh connect command we can add the command we need.
sending ssh bandit18@bandit ls
will run the ls command on the server after we have typed the password. But before we are thrown out of the system. We can see the readme file listed. Next up is then ssh bandit18@bandit cat readme
to get the content, and we now have our password for the next level
Comments ()