OverTheWire Bandit Level 18->Level 19 - Walkthrough
Introduction
In this post, I will be giving you a walkthrough to the Bandit wargame Level 18->Level 19. We will not use any new command to clear the level, instead slightly advanced SSH concept will be used as the .bashrc file is modified to logout the user on logging in with SSH.
Goal
Get the password for the next level from readme file stored in home directory.
Login Details
Server - bandit.labs.overthewire.org
Port - 2220
Username - bandit18
Password - hga5tuuCLF6fFzUpnagiMN8ssu9LFrdg
Theory
.bashrc(short for bash read command) is a configuration file for bash shell environment. Everytime a bash shell session starts, this file is executed. Therefore, this file is executed whenever we login through SSH as it also loads the terminal.
SSH not only allows us to log in to a machine remotely but also allows remote execution of command by appending it at the end of the SSH login expression. A helpful article to give more information on this topic is this.
Solution
On trying to login through SSH similar to the previous levels
will yield us nothing and "Byebye !" message comes at the end after
entering the password. Instead, we will execute the commands through SSH. Type
the below command to make sure that readme file is present in the location or
not-:
- ssh bandit18@bandit.labs.overthewire.org -p 2220 ls
Now type the command "ssh bandit18@bandit.labs.overthewire.org -p 2220 cat readme" to get the password.
This completes the Level 19 walkthrough. Please post your doubts and questions in the comment section.





Comments
Post a Comment