Bait A Phish
Bait A Phish
Security Pulse
tutorial · bandit

Bandit Level 26

Escape a non-bash shell (more/vi style) to get a real shell.
banditescapemorevi
Narration (cached)
Marks this level complete in your browser.

Goal

Logging into bandit26 is easy, but the shell isn’t /bin/bash.

Find what it is and break out into a real shell.

Hints

Solution (click to reveal)
  1. SSH in:
ssh bandit26@bandit.labs.overthewire.org -p 2220
  1. Identify the shell:
grep '^bandit26:' /etc/passwd
  1. If it’s more, you can trigger a shell via v to open vi (works when output is paged). In vi, run:
:set shell=/bin/bash
:shell
  1. Once you have a shell, grab the password for bandit27 from the usual place:
cat /etc/bandit_pass/bandit27

Notes

Bandit Level 25Bandit Level 27