The bandit overthewire wargames are for absolute beginners. Therefore a fun way to learn Linux and shell command line. However, as the levels of games increases so will the difficulty but don’t give up. So we will proceed with the game here is the link for level 0.
Some helpful links
- how to setup Kali Linux on VMware.
- how to setup Kali Linux on a virtual box.
- introduction to ssh.
- Host: bandit.labs.overthewire.org
- port: 2220
bandit level 0
In Linux shell I will use credentials given to login using ssh as the password is given. Therefore I will use it as they ask for it.
bandit level 0 → 1
In Linux shell I am in level 0 now the goal is to read the content of a file called readme. Therefore we will use ls command to list the directory and files. As well as cat command to read the content of the file. After that, we get the password so we will use it to log in to the next level.
bandit level 1 → 2
In this level as we are told that password is stored in “-” (hyphen). As we use “cat -” it will not give us a password because Linux considers “-” (hyphen) as stdin/stdout. So to get the password we will prefix “./”. As it tells Linux shell to read the content of “-” hyphen in current directory.
- cat ./-
bandit level 2 → 3
In this level password is stored in file “spaces in this filename”. But we cannot directly use cat command because spaces are considered null character “/0”. Therefore input will be considered as 4 different inputs and we will get an error. So we will either use escape character after every word “spaces\ in\ this\ filename” or put the filename in quotes.
- cat spaces\ in \this\ filename
bandit level 3 → 4
In this level file is hidden in directory called “inhere”. We use cd command to change the directory and “ls -a” to show all files and folders of directory. As this also includes hidden files and folders. After that we can use cat command on hidden file and read its content.
- cd inhere
- ls -a
- cat .hidden
bandit level 4 → 5
In this level, only one file is human readable and others are of some other data type. After that we get the password of the next level, But how will we know which file is human readable. As we know the readable text is ASCII text and for finding filetype we will use a “find” command. Find command is used for getting filetype. Therefore we can traverse all files with find command and cat ASCII file.
- cd inhere
- file ./*
- cat ./-file07