Logo
Published on
views

Bandit 25 Writeup

Authors
  • Name
    Pablo
    Twitter
    @pablousu
  • Name
    Maylen Echavez
    Twitter

Concepts to consider

to understand this bandit room what we can read is about the more command and how it works. more displays the lines bit by bit, so to keep here we have to resize the terminal so that it doesn't display the full text.

then from here you can also access vi from more.

  • with vi you can access the terminal

bandit 25

Task

Logging in to bandit26 from bandit25 should be fairly easy… The shell for user bandit26 is not /bin/bash, but something else. Find out what it is, how it works and how to break out of it.

Solution

bandit25@bandit:~$ cat /etc/passwd
bandit26:x:11026:11026:bandit level 26:/home/bandit26:/usr/bin/showtext
bandit25@bandit:~$ cat /usr/bin/showtext
#!/bin/sh

export TERM=linux

exec more ~/text.txt
exit 0

this is what happens when you log into bandit26 via ssh


 Enjoy your stay!
  _                     _ _ _   ___   __
 | |                   | (_) | |__ \ / /
 | |__   __ _ _ __   __| |_| |_   ) / /_
 | '_ \ / _` | '_ \ / _` | | __| / / '_ \
 | |_) | (_| | | | | (_| | | |_ / /| (_) |
 |_.__/ \__,_|_| |_|\__,_|_|\__|____\___/
Connection to bandit.labs.overthewire.org closed.

therefore text.txt is ascii art. Then, as is more we can adjust the size of the window and enter bandit26 through ssh Now we are in the more program. If we see the manual we can enter vi with v Within vi we can now reorganize the size of the window in the vi program we can access to the terminal, and