Bandit CTF — 6 to 10 Challenges Writeup
Tags: security, ctf, ctfwriteup
Published: 2021-02-24 09:17:17

A CTF is the perfect place to learn security skills in a safe environment, knowing you are not going to destroy something valuable or do something illegal.

Moreover, you know that a vulnerability exists, about a particular problem, wether it is XSS, CSRF or many others and that there is a way to find and exploit it.

That’s why it is so loved by security engineer in the making.

The Bandit CTF from OverTheWire is a beginner oriented CTF and today after the challenges 1 to 5 we reviewed last week, we are going to play the challenges 6 to 10.

---

If you want to go through the 1 to 5 challenges, it is located here.
{% link shostarsson/bandit-ctf-1-to-5-challenges-walkthrough-6lg %}

---

Let’s dive in the 6 to 10 challenges in a video :
{% youtube fR4ax6gK4Qk %}

---

If you want to read the walk-through without the voice over, here are all the writeups (for the 6 to 10 challenges).

---

#### Bandit Level 6 -> 7
ssh bandit6@bandit.labs.overthewire.org -p 2220
Use the DXjZPULLxYr17uwoI01bNLQbtFemEgo7 flag as the password.
```bash
find / * -size 33c -user bandit7 -group bandit6
```

**Flag : HKBPTKQnIay4Fw76bEy8PVxKEDQRKTzs**

---

#### Bandit Level 7 -> 8
ssh bandit7@bandit.labs.overthewire.org -p 2220
Use the HKBPTKQnIay4Fw76bEy8PVxKEDQRKTzs flag as the password.

Use a simple grep command (`man grep`) to get the lines that have the word “millionth” next to it.
```bash
grep millionth data.txt
```

**Flag : cvX2JJa4CFALtqS87jk27qwqGhBM9plV**

---

#### Bandit Level 8 -> 9
ssh bandit8@bandit.labs.overthewire.org -p 2220
Use the cvX2JJa4CFALtqS87jk27qwqGhBM9plV flag as the password.

One uses pipe to chain actions on the file (man sort and man uniq to understand these command and what’s possible with them).
```bash
cat data.txt | sort | uniq -u
```

**Flag : UsvVyFSfZZWbi6wgC7dAFyFuR6jQQUhR**

---

#### Bandit Level 9 -> 10
ssh bandit9@bandit.labs.overthewire.org -p 2220
Use the UsvVyFSfZZWbi6wgC7dAFyFuR6jQQUhR flag as the password.

Simple cat let see the flag
```bash
cat data.txt
```

strings is a bash command which prints the strings that are human readable.

One prints all the human readable strings.
One chains it to a grep command that prints only the strings which have at least 2 “=” character.
-o allows to print only the matching lines
-w allows to print only the regular expression matching lines
```bash
strings data.txt | grep ="=.*".* -oh
```

**Flag : truKLdjsbJ5g7yyJ2X2R0o3a5HQJFuLk**

---

#### Bandit Level 10 -> 11
ssh bandit10@bandit.labs.overthewire.org -p 2220
Use the truKLdjsbJ5g7yyJ2X2R0o3a5HQJFuLk flag as the password.

The file is a simple base64. You just have to decode it (man base64)
```bash
base64 -d data.txt
```
The password is IFukwKGsFW8MOq3IRFqrxE1hxTNEbUPR
**Flag : IFukwKGsFW8MOq3IRFqrxE1hxTNEbUPR**
 
---

If you have any question, feel free to ask and I’ll do my best to answer it and help you grow.

---

*If you like this content, push the like button, that helps spread the message.* 👍🏼
*If you think it can be useful to anyone in your network, share it.* 📨

---

Video produced by [Wild & Secure](https://wildnsecure.com), your consulting firm to all things security and real estate.
If you want to receive weekly quality content about security, subscribe to our newsletter [on our website](https://wildnsecure.com/contact).