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
- Check your login shell:
cat /etc/passwd | grep bandit26. - Often the “shell” is something like
more. - If you can open an editor/pager, you can often run shell commands from it.
Solution (click to reveal)
- SSH in:
ssh bandit26@bandit.labs.overthewire.org -p 2220
- Identify the shell:
grep '^bandit26:' /etc/passwd
- If it’s
more, you can trigger a shell viavto openvi(works when output is paged). Invi, run:
:set shell=/bin/bash
:shell
- Once you have a shell, grab the password for bandit27 from the usual place:
cat /etc/bandit_pass/bandit27
Notes
- This is a classic “escape the pager/editor” exercise.
- On some terminals, you may need to resize so
moreactually activates.