Writeups OverTheWireBanditLinuxmorevimShell Escape

Bandit 25 Writeup - OverTheWire

Writeup for Bandit level 25 from OverTheWire: escaping a restricted shell via the more pager.

Contents

Wargame: Bandit

Level: 25

Category: Linux Fundamentals

Description

The home directory has an SSH key for bandit26, but bandit26’s login shell is /usr/bin/showtext, which runs more on a short text file and then exits. The goal is to escape from more into a real shell.

Overview

Solution

Step 1: Shrink the Terminal

Step 2: Enter Vim from more

Step 3: Escape to Bash

:set shell=/bin/bash
:shell

Step 4: Read the Password

cat /etc/bandit_pass/bandit26

Password

c7GvcKlw9mC7aUQaPx7nwFstuAIBw1o1

← Back to Blog