OverTheWire

OverTheWire: Bandit Level 18 → Level 19

Level Goal

Commands you may need to solve this level

> whatis ssh
ssh (1) - OpenSSH remote login client
> whatis ls
ls (1) - list directory contents
> whatis cat
cat (1) - concatenate files and print on the standard output

Solution

From reading the question we understand that we cannot login directly as the default shell “Bash” has been modified to not allow any login using SSH. So we need to use a shell other than bash to access the system.

> cat /etc/shells
# /etc/shells: valid login shells
/bin/sh
/bin/bash
/usr/bin/bash
/bin/rbash
/usr/bin/rbash
/bin/dash
/usr/bin/dash
/usr/bin/tmux
/usr/bin/screen
$ ssh bandit18@bandit.labs.overthewire.org -p 2220 -t "/bin/sh"
This is a OverTheWire game server. More information on http://www.overthewire.org/wargames
bandit18@bandit.labs.overthewire.org's password: kfBf3eYk5BPBRzwjqutbbfE887SVc5Yd
$
$ ls
readme
$ cat readme
IueksS7Ubh8G3DCwVzrTd8rAVOwq3M5x
> ssh bandit19@bandit.labs.overthewire.org -p 2220
This is a OverTheWire game server. More information on http://www.overthewire.org/wargames
bandit19@bandit.labs.overthewire.org's password: IueksS7Ubh8G3DCwVzrTd8rAVOwq3M5x

--

--

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store