# Level 9 → 10

## Level Goal

The password for the next level is stored in the file <mark style="color:orange;">data.txt</mark> in one of the few human-readable strings, preceded by several `=` characters.

## 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%2FBhuf3PoYPI6LJSJLrYaC%2Fimage.png?alt=media&#x26;token=c4a04b61-5266-4d59-9843-d65d6aa661af" 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%2FYvkFWRijtZz2FGA4CsuH%2Fimage.png?alt=media&#x26;token=73d51aa0-b63b-48ae-9350-10736b96a1f3" alt="cat data.txt"><figcaption></figcaption></figure>

3. To find human-readable strings proceeded by `=` characters, the `string` command was used in combination with `grep`:

```sh
strings data.txt | grep "="
```

<figure><img src="https://2377137241-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FyNXjlRfAJA38cZuMdmG3%2Fuploads%2FYmbxVqBdFCB7nF4M9igt%2Fimage.png?alt=media&#x26;token=79bc77a0-74b7-498b-8666-58d9753697b6" alt="strings data.txt | grep &#x22;=&#x22;"><figcaption></figcaption></figure>

* `strings data.txt`: Extracts printable strings from the file
* `|`: Pipes the output to the next command
* `grep "="`: Searches for lines containing '=' characters

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

4. Access the next level:

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

Enter the password when prompted.

## Lessons Learned

* The `strings` command is crucial for extracting readable text from binary files
* `Grep` is versatile for finding patterns, but exact patterns may need adjustment
* Visual inspection of output can be necessary when automated filtering is imprecise
* Binary files often contain hidden, readable information

\-- Othmane
