MayADevBe Blog

A Blog about Computer Science

OverTheWire Bandit Level 0 -> 1 - Walkthrough

Previous Level: Level 0


Login

SSH: ssh bandit0@bandit.labs.overthewire.org -p 2220

Password: bandit0

Task

The password for the next level is stored in a file called readme located in the home directory.

A little bit of Theory

If you log into a machine with SSH as a specific user, you will land in the home directory of that user.

In the walkthrough for the previous level, I shortly mentioned the man command. This command gives you more information about a command like what additional information is needed (exp. ssh login info) and also possible flags (exp. -p to specify the port for ssh) In this level, you will start learning basic Linux commands to interact with the filesystem.

  • pwd this command is one method to see, which is the current working directory. An alternative can be on the left next to the username. Exp. bandit0@bandit:~$, here the ~ indicates the current working directory as the home directory of the user.
  • ls List the files in the current folder (if the folder is not specified). Two optional flags that should be known for this command are -l, which prints files in a long list format (additional information about a file) and -a, which also shows hidden files.
  • cat Reads files sequentially and writes them to standard output or in other words, prints the files content to the console.

Solution

  1. We log in through SSH with the information above. And as explained in the theory section, we land in the home directory from user ‘bandit0’. (You can check this with the pwd command.)

  2. Next, we can make sure that the readme file is actually in the folder.

    1
    2
    
    bandit0@bandit:~$ ls
    readme
    
  3. Since this is the case, we can print the content of a file with the following command syntax: cat <file>.

    1
    2
    
    bandit0@bandit:~$ cat readme
    boJ9jbbUNNfktd78OOpsqOltutMc3MY1
    

    The resulting string is the password for the ‘bandit1’ user.


https://overthewire.org/wargames/bandit/bandit1.html


Next Level: Level 2


Share on: