> For the complete documentation index, see [llms.txt](https://hacking-notes.jord4n.pro/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://hacking-notes.jord4n.pro/de/writeups-ctf/hackthebox/linux-easy/keeper-hackthebox-writeup.md).

# Keeper HackTheBox-Lösungsbericht

{% embed url="<https://app.hackthebox.com/machines/Keeper>" %}

{% hint style="warning" %}
**Fähigkeiten:**

* Ausnutzen von Request Tracker
* Informationsleck
* Ermitteln des KeePass-Passworts über einen Speicherauszug (Privilegienausweitung)
  {% endhint %}

## Aufklärung

**Einrichtung des Arbeitsbereichs:**

Richten Sie den Arbeitsbereich ein, indem Sie drei Ordner erstellen, um wichtige Inhalte, Exploits und Nmap-Aufklärungsergebnisse zu speichern.

<figure><img src="/files/5a3a0b38469e20782ab245c689974f8f32f7895f" alt="" width="563"><figcaption></figcaption></figure>

**VPN-Verbindung prüfen**/ VPN-Konnektivität prüfen, um eine stabile Kommunikation mit der Zielmaschine sicherzustellen.

<figure><img src="/files/0223823fb389aa441b7143310c258a63af6d6849" alt="" width="563"><figcaption></figcaption></figure>

**Suche nach offenen Ports mit Nmap: 22.80**

```bash
nmap -p- --open -n -Pn -vvv --min-rate 5000 10.10.11.227 -oG allPorts 
```

<figure><img src="/files/61a7e54d6734502f141e4076c7b062370cafc444" alt=""><figcaption></figcaption></figure>

**Scannen der Port-Version mit Nmap:** Verwendung von Nmap, um die Port-Version zu scannen und die Informationen in die Datei "targeted" zu extrahieren:

```bash
nmap -sCV -p22,80 10.10.11.227 -oN targeted
```

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

### Port 80

Wir entdecken die Domain **keeper.htb** und eine Subdomain **tickets.keeper.htb**.

<figure><img src="/files/466d9a5a584eddd017a687c814ea70aba0173e83" alt=""><figcaption></figcaption></figure>

Wir fügen sie dem `/etc/hosts` Datei ein:

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

## Request Tracker CMS

Beim Aufrufen von **tickets.keeper.htb** finden wir ein Admin-Panel.

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

Wir testen die Standard-Zugangsdaten von **Request Tracker**:

```plaintext
Benutzername: root  
Passwort: password  
```

<figure><img src="/files/42314022a5d385559e8e8af28fc627e9c0e15bd6" alt=""><figcaption></figcaption></figure>

Verbindung erfolgreich!

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

In dem **Admin → Benutzer** Bereich finden wir ein Benutzerkonto:

* Benutzer: <Inorgaard@keeper.htb>
* Passwort: Welcome2023!

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

#### SSH-Verbindung

Wir verwenden die gefundenen Zugangsdaten, um uns per SSH zu verbinden:

```bash
ssh Inorgaard@keeper.htb
```

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

### Flagge user.txt :)

<figure><img src="/files/7510d4f5d3c2f1749a465569ee6f028d8744ebf1" alt="" width="563"><figcaption></figcaption></figure>

## Privilegieneskalation

### **KeePass-Datenbank-Dump**

Wir finden eine ZIP-Datei `RT30000.zip` die wir auf unseren Rechner herunterladen:

```bash
python3 -m http.server 8080
```

```bash
wget http://10.10.11.227:8080/RT30000.zip
```

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

Nach dem Entpacken erhalten wir:

* **KeePassDumpFull.dmp**
* **passcodes.kdbx**

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

Wir versuchen zu öffnen `passcodes.kdbx` mit KeePassXC:

```bash
keepassxc passcodes.kdbx
```

Es wird nach einem Passwort gefragt. Wir versuchen einen Brute-Force-Angriff mit **John The Ripper**, ohne Erfolg.

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

### **KeePass – Analyse des Speicherauszugs**

{% embed url="<https://github.com/matro7sh/keepass-dump-masterkey>" %}

Wir nutzen den `.dmp` Datei mit einem Python-Skript:

```bash
python3 poc.py KeePassDumpFull.dmp
```

Dies zeigt unlesbare Zeichen. Eine Online-Suche führt uns zu einem wahrscheinlichen Passwort:

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

<figure><img src="/files/350d1fb6151ec794cdf4974f0429c3cefc8dfe76" alt="" width="563"><figcaption></figcaption></figure>

**Ergebnis**: roter Brei mit Sahne

<figure><img src="/files/0c89eab46b334ffc1e264b3cd7758e2b35a5ea26" alt="" width="563"><figcaption></figcaption></figure>

Wir verwenden dieses Passwort, um KeePass zu entsperren, wodurch wir einen **verschlüsselten PuTTY-Schlüssel und Root-Passwort**.

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

### PuTTY-Schlüssel ins OpenSSH-Format konvertieren

Wir müssen den PuTTY-Schlüssel ins OpenSSH-Format konvertieren:

```bash
puttygen key.ppk -O private-openssh -o id_rsa
```

Stellen Sie als Nächstes sicher, dass Ihr privater Schlüssel die richtigen Berechtigungen hat:

```bash
chmod 600 id_rsa
```

#### **Mit dem SSH-Server verbinden**

```bash
ssh -i id_rsa root@10.10.11.227
```

<figure><img src="/files/99789b335a4abe955403d98d47fd7afe295de9e5" alt=""><figcaption></figcaption></figure>

### Flag root.txt :)

<figure><img src="/files/0de5aa9404c5b7a3ce471d23ca30257f500cde36" alt="" width="563"><figcaption></figcaption></figure>

<figure><img src="/files/1bc0f4c99c69ccea8464a27e023d74d17eceb36a" alt="" width="417"><figcaption></figcaption></figure>


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter, and the optional `goal` query parameter:

```
GET https://hacking-notes.jord4n.pro/de/writeups-ctf/hackthebox/linux-easy/keeper-hackthebox-writeup.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
