> For the complete documentation index, see [llms.txt](https://cybersecurity-cloud-and-it-notes.gitbook.io/kyles-cybersecurity-cloud-and-it-gitbook/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://cybersecurity-cloud-and-it-notes.gitbook.io/kyles-cybersecurity-cloud-and-it-gitbook/hack-the-box/labs/offense/tier-0-pen-testing/redis-lab-enumerate-server-dump-db-for-flag-redeemer.md).

# Redis Lab: Enumerate Server, Dump DB for Flag (Redeemer)

<figure><img src="/files/IjHMjAq0EanSWnbP3s4l" alt=""><figcaption></figcaption></figure>

Hmmm... I scanned the ports with NMAP but the scan came back that all 1000 ports were closed.

<figure><img src="/files/bIT92ivinzfHEgL967M5" alt=""><figcaption></figcaption></figure>

The HTB writeup shows me to include a "-p-" flag into the command... This endedup scanning the full range of over 60,000 ports.&#x20;

<figure><img src="/files/4KXKWj7Py13zdBWSKHx7" alt=""><figcaption></figcaption></figure>

<figure><img src="/files/OpKrcQkQLFLsYFAUmgZi" alt=""><figcaption></figcaption></figure>

Finally, task 1 is complete...

<figure><img src="/files/pwMh3h3UfPT760Sl9Smg" alt=""><figcaption></figcaption></figure>

Oh, and task 2:

<figure><img src="/files/dvQ3N8j5how4gIAfONWr" alt=""><figcaption></figcaption></figure>

Also task 3:

<figure><img src="/files/B28Vpa4TV37Gu57h49dN" alt=""><figcaption></figcaption></figure>

According to the writeup, the answer to task 4 is "redis-cli"

<figure><img src="/files/ymAT8bNGFpRr5ejYOdlU" alt=""><figcaption></figcaption></figure>

<figure><img src="/files/FLcE0ub26zzDRR0vQeab" alt=""><figcaption></figcaption></figure>

The writeup said I needed to install the redis-cli in order to continue onward so I entered the following command:

<figure><img src="/files/ANWFsRTwM779dGFJZhM1" alt=""><figcaption></figcaption></figure>

<figure><img src="/files/ZSZSplw7BO7vdAI1dZou" alt=""><figcaption></figcaption></figure>

Looks like it was already installed, so all that it did was just make two updates.

Next up was checking the help menu.

<figure><img src="/files/cQxAfSZLYSpfM041Uf16" alt=""><figcaption></figcaption></figure>

This output is likely to help me answer the next task.

<figure><img src="/files/WqXmhzhcaSpgaKgHmvRT" alt=""><figcaption></figcaption></figure>

<figure><img src="/files/yMNHXh3eU66sTbOt8nMC" alt=""><figcaption></figcaption></figure>

<figure><img src="/files/P2nXxmVK1TXQQ1h0Hbec" alt=""><figcaption></figcaption></figure>

<figure><img src="/files/CWAanbKmFKHZrLbapBy7" alt=""><figcaption></figcaption></figure>

<figure><img src="/files/MF664dRd2Tak48HMfXvY" alt=""><figcaption></figcaption></figure>

Looks like the answer to task 5 was close to the top of the output for help menu:

<figure><img src="/files/GvYLNLgZhzECo1ruMIvZ" alt=""><figcaption></figcaption></figure>

<figure><img src="/files/UJ9fPyOjri9axsLsLzqR" alt=""><figcaption></figcaption></figure>

<figure><img src="/files/pzjJZV5RUbQc9iQw4QMh" alt=""><figcaption></figcaption></figure>

To get the answer for task 6, I had to use the -h command to get the host name, this sort of accesses the host for me. giving me a little prompt with the host name:

<figure><img src="/files/jVIXWMFy25avDoN4xDYZ" alt=""><figcaption></figcaption></figure>

<figure><img src="/files/MLMPbjkJxJOI6qHYyHGh" alt=""><figcaption></figcaption></figure>

Of course I already typed in the "info" command here - suggested by the machine's writeup of-course. This command shows or returns information and statistics about the redis server.

<figure><img src="/files/NyBw1DSYr3TXawWqT7Si" alt=""><figcaption></figcaption></figure>

<figure><img src="/files/MZWy6GzT6iNDUGVaxQ4J" alt=""><figcaption></figcaption></figure>

<figure><img src="/files/oA0bdl51Af48IYdvfhBT" alt=""><figcaption></figcaption></figure>

I skipped a lot of the other info to show the bottom output which is 'Keyspace."

<figure><img src="/files/Op4WHEHgexQpcXbmmzvF" alt=""><figcaption></figcaption></figure>

<figure><img src="/files/MBtAnDEdveA5HQBac0T5" alt=""><figcaption></figcaption></figure>

The answer to task 7 was at the beginning of the "info" command's output.

<figure><img src="/files/DkXNWSVNRegLAgQ2umWx" alt=""><figcaption></figcaption></figure>

<figure><img src="/files/tePf9abBXjCnAUhuXwcI" alt=""><figcaption></figcaption></figure>

Task 8 finally relates to the "Keyspace" section of the "info" command's output - the output at the very bottom / end. Keyspace section shows how many databases there are and the number of keys for each database as well as how many have an expiration. in the keyspace section of my output it shows there is only 1 database - called out with the index of "0" or "db0"

<figure><img src="/files/wAbPpBECHGTRtwDZ2goh" alt=""><figcaption></figcaption></figure>

Task 8 is asking for what command is used to select the desired database in redis, well according to the writeup, the command is "select."

<figure><img src="/files/x1m1zS5DkyfvmrUnLD4r" alt=""><figcaption></figcaption></figure>

Don't judge me for using a writeup... to be fair, HTB gives literally zero points and no hacker rank what so ever for any labs that are retired or that have writeups.&#x20;

<figure><img src="/files/z9yQfwXkd6GBIMkfHeUx" alt=""><figcaption></figcaption></figure>

So I will use the select command to literally select the only available database, "0" or zero.

<figure><img src="/files/BnizMhXyGb2ekeKPx3Lu" alt=""><figcaption></figcaption></figure>

It gave me a response of "OK.' Wow. That was... underwhelming.

<figure><img src="/files/jH6Ml6AVXR5fpQa5Kcs7" alt=""><figcaption></figcaption></figure>

Task 9 asks for how many keys are present with Database zero, that was already given in the "info" commands output in the Keyspace section.

<figure><img src="/files/AQlL7RHtvvfAne9xM6QP" alt=""><figcaption></figcaption></figure>

Literally the next sentence in the writeup gives the answer... lol I'm shameless. It's okay, I'm learning and the active labs will still brutalize me when I work on them.

<figure><img src="/files/0mKPdRUwQYWkxqWdpbVQ" alt=""><figcaption></figcaption></figure>

<figure><img src="/files/qJspXtZkRUdwk79Q0amm" alt=""><figcaption></figcaption></figure>

<figure><img src="/files/CndZJapxgBhAY9a5NsxD" alt=""><figcaption></figcaption></figure>

<figure><img src="/files/GXNU2vX49sl6zmJhHWd6" alt=""><figcaption></figcaption></figure>

I literally have no idea what the flag has anything to do with these keys, unless these keys are hash values, which would make sense considering how long the value is that they are expecting for the input field lol.

<figure><img src="/files/IQuzJgutlM0oB9OkfNcd" alt=""><figcaption></figcaption></figure>

Just a stab in the dark... but I tried "get flag" and it outputed a pretty long string of numbers and characters... looks like a hash to me lol. I will copy and paste it into the final task's input and see if I was right.

<figure><img src="/files/pvg8BWhkJcQ70byV06Tl" alt=""><figcaption></figcaption></figure>

Guess so lol. Had to redeem myself at least a little bit by trying something without looking at the writeup lol...

Funny that I literally worked on this lab for 2 years, jk. It took me til the next year to complete it! I started December 31st 2024 close to midnight... and finished on January 1 2025 after midnight LOL!
