OverTheWire Bandit Level 18–19

br4ind3ad
1 min readAug 18, 2021

--

Given :

The password for the next level is stored in a file readme in the home directory. Unfortunately, someone has modified .bashrc to log you out when you log in with SSH.

Commands you may need to solve this level
ssh, ls, cat

  1. ssh into bandit18, but as someone has modified the .bashrc, we are not able to log in.
└─$ ssh bandit18@bandit.labs.overthewire.org -p 2220 1 ⨯This is a OverTheWire game server. More information on http://www.overthewire.org/wargamesbandit18@bandit.labs.overthewire.org’s password: 
Linux bandit.otw.local 5.4.8 x86_64 GNU/Linux
...Enjoy your stay!Byebye !
Connection to bandit.labs.overthewire.org closed.
  • t flag = Force pseudo-terminal allocation. This can be used to execute arbitrary screen-based programs on a remote machine, which can be very useful, e.g. when implementing menu services. Multiple -t options force tty allocation, even if ssh has no local tty.

2. Using the t flag we can force a pseudo-terminal.


└─$ ssh -t bandit18@bandit.labs.overthewire.org -p 2220 /bin/sh
This is a OverTheWire game server. More information on http://www.overthewire.org/wargames
bandit18@bandit.labs.overthewire.org’s password:
$
$ ls
readme
$ cat readme
IueksS7Ubh8G3******Td8rAVOwq3M5x
$

--

--

No responses yet