> 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 Writeup

Writeup zur HackTheBox-Easy-Linux-Maschine Keeper mit Abdeckung von Missbrauch von Request Tracker, Informationsleck, Erlangen des KeePass-Passworts durch Speicherabbild (Privilegieneskalation), mit praktischer Enumeration, e

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

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

* Missbrauch von Request Tracker
* Informationsleck
* KeePass-Passwort durch Speicherabbild erlangen (Privilegieneskalation)
  {% endhint %}

## Aufklärung

**Arbeitsbereich einrichten:**

Richte den Arbeitsbereich ein, indem du drei Ordner erstellst, um wichtige Inhalte, Exploits und Nmap-Aufklärungsergebnisse zu speichern.

<figure><img src="https://2955439919-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Fl4EVJpcOrsgjSGsLI7p2%2Fuploads%2Fgit-blob-1daea7fe4a5f12c95c5f636efb53601b5c1dd716%2Fimage%20(2858).png?alt=media" alt="" width="563"><figcaption></figcaption></figure>

**VPN-Verbindungsprüfung**/ Überprüfen Sie die VPN-Konnektivität, um eine stabile Kommunikation mit dem Zielrechner sicherzustellen.

<figure><img src="https://2955439919-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Fl4EVJpcOrsgjSGsLI7p2%2Fuploads%2Fgit-blob-106199afa6907972b35d6c991158df1a1911e9af%2Fimage%20(2859).png?alt=media" 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="https://2955439919-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Fl4EVJpcOrsgjSGsLI7p2%2Fuploads%2Fgit-blob-4c81d21456749c53bbd0f4a5f590aa30f14573eb%2Fimage%20(2860).png?alt=media" 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="https://2955439919-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Fl4EVJpcOrsgjSGsLI7p2%2Fuploads%2Fgit-blob-de06ec57138db755d39f61c53b265c438287558e%2Fimage%20(2861).png?alt=media" alt=""><figcaption></figcaption></figure>

### Port 80

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

<figure><img src="https://2955439919-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Fl4EVJpcOrsgjSGsLI7p2%2Fuploads%2Fgit-blob-736a526fc66ed498886efa883745e0257308c6bf%2Fimage%20(2862).png?alt=media" alt=""><figcaption></figcaption></figure>

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

<figure><img src="https://2955439919-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Fl4EVJpcOrsgjSGsLI7p2%2Fuploads%2Fgit-blob-4d5c91da3cb7f5cdf627ab979e47c6d7d583a0c1%2Fimage%20(2863).png?alt=media" alt=""><figcaption></figcaption></figure>

## Request Tracker CMS

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

<figure><img src="https://2955439919-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Fl4EVJpcOrsgjSGsLI7p2%2Fuploads%2Fgit-blob-26c53eb984edab9d28b606fdb1dd99fad739bea5%2Fimage%20(2864).png?alt=media" alt=""><figcaption></figcaption></figure>

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

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

<figure><img src="https://2955439919-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Fl4EVJpcOrsgjSGsLI7p2%2Fuploads%2Fgit-blob-4348c548652cc3646252cf1c928e47ee0af222e7%2Fimage%20(2865).png?alt=media" alt=""><figcaption></figcaption></figure>

Verbindung erfolgreich!

<figure><img src="https://2955439919-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Fl4EVJpcOrsgjSGsLI7p2%2Fuploads%2Fgit-blob-f3a7c22f6b34a75f42886c0b308d1ca778e7ba1f%2Fimage%20(2866).png?alt=media" alt=""><figcaption></figcaption></figure>

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

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

<figure><img src="https://2955439919-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Fl4EVJpcOrsgjSGsLI7p2%2Fuploads%2Fgit-blob-9a4b389cefd80fc989e3d50e8e52081a4940a202%2Fimage%20(2867).png?alt=media" 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="https://2955439919-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Fl4EVJpcOrsgjSGsLI7p2%2Fuploads%2Fgit-blob-7d2b48c026468476d09f49f72b7476fb57cf7734%2Fimage%20(719).png?alt=media" alt=""><figcaption></figcaption></figure>

### Flagge user.txt :)

<figure><img src="https://2955439919-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Fl4EVJpcOrsgjSGsLI7p2%2Fuploads%2Fgit-blob-cd8afd60013271941e739fd314cb1625a72ad99d%2Fimage%20(720).png?alt=media" alt="" width="563"><figcaption></figcaption></figure>

## Privilegieneskalation

### **KeePass-Datenbankabbild**

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="https://2955439919-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Fl4EVJpcOrsgjSGsLI7p2%2Fuploads%2Fgit-blob-0f26cf09466e8586507ef3dcc65167a830ebd162%2Fimage%20(721).png?alt=media" alt=""><figcaption></figcaption></figure>

Nach dem Entpacken erhalten wir:

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

<figure><img src="https://2955439919-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Fl4EVJpcOrsgjSGsLI7p2%2Fuploads%2Fgit-blob-a083bdfed784d266e4be05f3874a6375846fca61%2Fimage%20(723).png?alt=media" alt=""><figcaption></figcaption></figure>

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

```bash
keepassxc passcodes.kdbx
```

Es fragt nach einem Passwort. Wir versuchen eine Brute-Force-Attacke mit **John The Ripper**, ohne Erfolg.

<figure><img src="https://2955439919-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Fl4EVJpcOrsgjSGsLI7p2%2Fuploads%2Fgit-blob-7fe73720931bd178e5c76ece0ee57e27a57900e9%2Fimage%20(722).png?alt=media" alt=""><figcaption></figcaption></figure>

### **Keepass - Analyse des Speicherabzugs**

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

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

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

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

<figure><img src="https://2955439919-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Fl4EVJpcOrsgjSGsLI7p2%2Fuploads%2Fgit-blob-3b190ce7266316ed0d0d7cc6434ab0d1138a1440%2Fimage%20(724).png?alt=media" alt=""><figcaption></figcaption></figure>

<figure><img src="https://2955439919-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Fl4EVJpcOrsgjSGsLI7p2%2Fuploads%2Fgit-blob-73a3378c51ebaa83bb54894ae5046e2661635b9d%2Fimage%20(725).png?alt=media" alt="" width="563"><figcaption></figcaption></figure>

**Ergebnis**: roter Brei mit Sahne

<figure><img src="https://2955439919-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Fl4EVJpcOrsgjSGsLI7p2%2Fuploads%2Fgit-blob-8bb05d1d6204657f047011d42b69fd36c6740335%2Fimage%20(726).png?alt=media" alt="" width="563"><figcaption></figcaption></figure>

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

<figure><img src="https://2955439919-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Fl4EVJpcOrsgjSGsLI7p2%2Fuploads%2Fgit-blob-1922b68469347a5ba6a014476bd1e73b4b55356f%2Fimage%20(727).png?alt=media" alt=""><figcaption></figcaption></figure>

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

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

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

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

```bash
chmod 600 id_rsa
```

#### **SSH-Server verbinden**

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

<figure><img src="https://2955439919-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Fl4EVJpcOrsgjSGsLI7p2%2Fuploads%2Fgit-blob-7341286e6ef1bb0f3b6364fa22244dbf5c2b6e65%2Fimage%20(730).png?alt=media" alt=""><figcaption></figcaption></figure>

### root.txt-Flagge :)

<figure><img src="https://2955439919-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Fl4EVJpcOrsgjSGsLI7p2%2Fuploads%2Fgit-blob-c6fad0aaaa37ad4f62398e77d71e6ae16fc3092e%2Fimage%20(731).png?alt=media" alt="" width="563"><figcaption></figcaption></figure>

<figure><img src="https://2955439919-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Fl4EVJpcOrsgjSGsLI7p2%2Fuploads%2Fgit-blob-cd34abac87dcf4d967f077c022ea096d94a6c21b%2Fimage%20(732).png?alt=media" 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 by asking a question.

Perform an HTTP GET request on the following URL with the `ask` and `goal` query parameters:

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

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is what the user is ultimately trying to achieve, the reason they need the answer. Sharing it helps GitBook give you a better, more relevant answer. A goal is most helpful when it describes the outcome the user wants rather than restating the question. For example, with `ask=how do I create an API token`, a goal like `automate deployments from our CI pipeline` lets GitBook tailor the answer to that use case.

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.
