> 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/writeups-ctf/hackthebox/linux-easy/keeper-hackthebox-writeup.md).

# Keeper HackTheBox Writeup

Keeper HackTheBox Easy Linux machine writeup covering Abusing Request Tracker, Information Leakage, Obtaining KeePass password through memory dump (Privilege Escalation), with practical enumeration, e

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

{% hint style="warning" %}
**Skills:**

* Abusing Request Tracker
* Information Leakage
* Obtaining KeePass password through memory dump (Privilege Escalation)
  {% endhint %}

## Reconaisssance

**Workspace Setup:**

Set up the workspace by creating three folders to store important content, exploits, and Nmap reconnaissance results.

<figure><img src="https://131707722-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 Connectivity Check**/ Check VPN connectivity to ensure stable communication with the target machine.

<figure><img src="https://131707722-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>

**Searching for open ports with Nmap: 22.80**

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

<figure><img src="https://131707722-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>

**Scanning the port version with Nmap:** Using Nmap to scan the port version and extracting the information into the "targeted" file:

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

<figure><img src="https://131707722-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

We discover the domain **keeper.htb** and a subdomain **tickets.keeper.htb**.

<figure><img src="https://131707722-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>

We add them to the `/etc/hosts` file:

<figure><img src="https://131707722-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

Visiting **tickets.keeper.htb** we find an admin panel.

<figure><img src="https://131707722-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>

We test the default credentials of **Request Tracker**:

```plaintext
Username: root  
Password: password  
```

<figure><img src="https://131707722-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>

Connection successful!

<figure><img src="https://131707722-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 the **Admin → Users** section we find a user account:

* User: <Inorgaard@keeper.htb>
* Password: Welcome2023!

<figure><img src="https://131707722-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 connection

We use the credentials found to connect via SSH:

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

<figure><img src="https://131707722-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>

### Flag user.txt :)

<figure><img src="https://131707722-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>

## Privilege Escalation

### **KeePass database dump**

We find a ZIP file `RT30000.zip` which we download to our machine:

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

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

<figure><img src="https://131707722-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>

After extraction, we obtain:

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

<figure><img src="https://131707722-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>

We are trying to open `passcodes.kdbx` with KeePassXC:

```bash
keepassxc passcodes.kdbx
```

It asks for a password. We try a bruteforce with **John The Ripper**, without success.

<figure><img src="https://131707722-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 - memory dump analysis**

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

We exploit the `.dmp` file with a Python script:

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

This reveals unreadable characters. An online search leads us to a likely password:

<figure><img src="https://131707722-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://131707722-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>

**Result**: red porridge with cream

<figure><img src="https://131707722-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>

We use this password to unlock KeePass, giving us a **PuTTY encrypted key and root password**.

<figure><img src="https://131707722-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>

### Convert PuTTY key to OpenSSH format

We need to convert the PuTTY key to OpenSSH format:

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

Next, make sure your private key has the right permissions:

```bash
chmod 600 id_rsa
```

#### **Connect to SSH server**

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

<figure><img src="https://131707722-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>

### Flag root.txt :)

<figure><img src="https://131707722-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://131707722-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/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.
