Login

  • ssh : ssh bandit18@bandit.labs.overthewire -p 2220
  • password : x2gLTTjFwMOhQ8oWNbMN362QKxfRqGlO

Task :

  • to get the next level password you have to read the readme file

Theory

  • .bashrc is a file that runs every time a terminal is loaded. This means it is also run when logging in through SSH because this also loads a terminal.
  • a new thing about ssh is that it does not just allows us to remotely connect to another machine but it lets us to run a command just after the common shh expression.

Solution

  • as mentioned in the level that thhappenese .bashrc file is modified to log us out just after we connect with ssh , so what I’ve done is i included the command cat with the ssh expression to read the file before the logout happens
ssh bandit18@bandit.labs.overthewire.org -p 2220 'cat readme'
  • i found and another alternative is to run or -t /bin/sh to open a pseudo-terminal