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

# Keeper HackTheBox攻略記事

Request Trackerの悪用、情報漏えい、メモリダンプ経由でKeePassパスワードを取得（権限昇格）を扱うKeeper HackTheBox Easy Linuxマシンの攻略記事。実践的な列挙、e

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

{% hint style="warning" %}
**スキル:**

* Request Trackerの悪用
* 情報漏えい
* メモリダンプからKeePassのパスワードを取得する（権限昇格）
  {% endhint %}

## 偵察

**作業環境の設定:**

重要なコンテンツ、エクスプロイト、Nmap の偵察結果を保存するために、3つのフォルダを作成して作業環境を整えます。

<figure><img src="https://2001299964-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 接続確認**/ 対象マシンとの安定した通信を確保するため、VPN接続を確認する。

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

**Nmapで開いているポートを探索する: 22.80**

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

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

**Nmapでポートのバージョンをスキャン：** Nmapでポートのバージョンをスキャンし、情報を「targeted」ファイルに抽出します：

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

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

### ポート80

ドメインを見つける **keeper.htb** そしてサブドメイン **tickets.keeper.htb**.

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

それらを `/etc/hosts` ファイル：

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

アクセスすると **tickets.keeper.htb** 管理パネルが見つかる。

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

のデフォルト認証情報を試す **Request Tracker**:

```plaintext
ユーザー名: root  
パスワード: password  
```

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

接続成功！

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

その **管理 → ユーザー** セクションでユーザーアカウントを見つける:

* ユーザー: <Inorgaard@keeper.htb>
* パスワード: Welcome2023!

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

見つけた認証情報を使ってSSH経由で接続する:

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

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

### フラグ user.txt :)

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

## 権限昇格

### **KeePassデータベースのダンプ**

ZIPファイルを見つける `RT30000.zip` これを自分のマシンにダウンロードする:

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

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

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

展開後、次を得る:

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

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

これを開こうとしている `passcodes.kdbx` KeePassXCで:

```bash
keepassxc passcodes.kdbx
```

パスワードを求められる。でブルートフォースを試すが **John The Ripper**、成功しない。

<figure><img src="https://2001299964-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 - メモリダンプ解析**

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

私たちは `.dmp` ファイルをPythonスクリプトで利用する:

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

これにより判読不能な文字が明らかになる。オンライン検索で有力なパスワードが見つかる:

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

**結果**: 赤いクリーム入りの粥

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

このパスワードを使ってKeePassのロックを解除すると、 **PuTTYの暗号化キーとrootパスワード**.

<figure><img src="https://2001299964-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キーをOpenSSH形式に変換する

PuTTYキーをOpenSSH形式に変換する必要がある:

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

次に、秘密鍵に適切な権限があることを確認する:

```bash
chmod 600 id_rsa
```

#### **SSHサーバーに接続する**

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

<figure><img src="https://2001299964-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 フラグ :)

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