# Level 10 → 11

## Level Goal

The password for the next level is stored in the file <mark style="color:orange;">data.txt</mark>, which contains base64 encoded data

## Write-Up

1. List the content of the current directory:

```sh
ls
```

<figure><img src="https://2377137241-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FyNXjlRfAJA38cZuMdmG3%2Fuploads%2FMpxxvJ0n9k8eJ5i0vE0z%2Fimage.png?alt=media&#x26;token=a164c4a4-38df-459e-b8a5-8a5233e7affc" alt="ls"><figcaption></figcaption></figure>

This confirms the presence of the <mark style="color:orange;">data.txt</mark> file.

2. Display the content of the data.txt file:

```sh
cat data.txt
```

<figure><img src="https://2377137241-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FyNXjlRfAJA38cZuMdmG3%2Fuploads%2FUxmZ8z6KAuQyKJovQhm0%2Fimage.png?alt=media&#x26;token=addced38-965a-4517-bd5e-b4ac47477ab8" alt="cat data.txt"><figcaption></figcaption></figure>

This revealed a string of base64 encoded data.

3. To decode the base64 data, the following command was used:

```sh
base64 -d data.txt
```

<figure><img src="https://2377137241-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FyNXjlRfAJA38cZuMdmG3%2Fuploads%2FeXKNAKODOYXFIEKGDgyW%2Fimage.png?alt=media&#x26;token=1593cad0-3e28-4437-bf4f-124778a5e841" alt="base64 -d data.txt"><figcaption></figcaption></figure>

* `base64`: The command used for encoding/decoding base64 data
* `-d`: Flag specifying decode mode (as opposed to encode)
* `data.txt`: The input file containing the encoded data

The password retrieved: <mark style="color:orange;">dtR173fZKb0RRsDFSGsg2RWnpNVj3qRr</mark>

4. Access the next level:

```sh
ssh bandit11@bandit.labs.overthewire.org -p 2220
```

Enter the password when prompted.

## Lessons Learned

* Base64 is a common encoding scheme used to represent binary data in ASCII string format
* The `base64` command in Unix systems can both encode and decode base64 data
* Simple command-line tools can often decode common data formats without need for specialized software

\-- Othmane
