OverTheWire Bandit Solutions & Notes
---
This writeup is my personal notes in solving OverTheWire's Bandit. Each level's task is to find the password for the next level.
---
## Level 0
Simply SSH to the server.
```bash
$ ssh bandit0@bandit.labs.overthewire.org -p 2220
```
## Level 1 Append *./* to the filename when using commands to read the file ```bash $ cat ./filename ```
## Level 2 Use quotes ```bash $ cat "./filename" ```
## Level 3 *-a* flag in the *ls* command shows all files including *.hidden* ones ```bash $ ls -al $ cat .filename ```
## Level 4 This command below allows us to list all files and all its contents with label ```bash $ tail -n +1 "./*" ```
## Level 5 Use the *-size* flag in *find* command to filter the file and print the output ```bash $ find . -type f -size 1033 | xargs cat ```
## Level 6 Filter based on criteria given ```bash $ find / -type f -size 33c -user bandit7 -group bandit6 2>/dev/null $ cat filename ```
## Level 7 The *grep* commands allows us to only select the line with the word millionth in it, which is next to the password. ```bash cat data.txt | grep "millionth" ```
## Level 8 *sort* and *uniq* allows us to print only non-duplicates ```bash $ sort data.txt | uniq -u ```
## Level 9 This command narrows the non-printable characters and the password is already obvious ```bash $ cat data.txt | grep "======" -a ```
## Level 10 *base64 -d* allows us to decode a Base64 encoded message ```bash $ cat data.txt | base64 -d ```
...to be continued
## Level 1 Append *./* to the filename when using commands to read the file ```bash $ cat ./filename ```
## Level 2 Use quotes ```bash $ cat "./filename" ```
## Level 3 *-a* flag in the *ls* command shows all files including *.hidden* ones ```bash $ ls -al $ cat .filename ```
## Level 4 This command below allows us to list all files and all its contents with label ```bash $ tail -n +1 "./*" ```
## Level 5 Use the *-size* flag in *find* command to filter the file and print the output ```bash $ find . -type f -size 1033 | xargs cat ```
## Level 6 Filter based on criteria given ```bash $ find / -type f -size 33c -user bandit7 -group bandit6 2>/dev/null $ cat filename ```
## Level 7 The *grep* commands allows us to only select the line with the word millionth in it, which is next to the password. ```bash cat data.txt | grep "millionth" ```
## Level 8 *sort* and *uniq* allows us to print only non-duplicates ```bash $ sort data.txt | uniq -u ```
## Level 9 This command narrows the non-printable characters and the password is already obvious ```bash $ cat data.txt | grep "======" -a ```
## Level 10 *base64 -d* allows us to decode a Base64 encoded message ```bash $ cat data.txt | base64 -d ```
...to be continued