> 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/active-directory/lab-setup.md).

# Active Directory ラボ

Active Directory の列挙、Kerberos、資格情報、ACL の悪用、横展開、悪用のワークフロー、検証手順を扱う Active Directory セキュリティメモ。

## ドメイン コントローラー（DC）のインストールと構成

#### 1. Windows Server のインストール

* ダウンロード **Windows Server 2022** ISO

{% embed url="<https://www.microsoft.com/en-us/evalcenter/download-windows-server-2022>" %}

* 選択 **Windows Server 2022 Standard（評価版）**

<figure><img src="https://2001299964-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Fl4EVJpcOrsgjSGsLI7p2%2Fuploads%2Fgit-blob-33465f5173c9c20c604aca74f5e13db947ed561c%2F%7B7E996479-527F-40BE-94D6-4840E71F0050%7D.png?alt=media" alt=""><figcaption></figcaption></figure>

* 仮想マシンにシステムをインストールする
* インストーラー **VMware Tools**

<figure><img src="https://2001299964-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Fl4EVJpcOrsgjSGsLI7p2%2Fuploads%2Fgit-blob-a9089e73fcd5200afa25278f64c8bc42d22cf5e0%2F%7B229AFF00-22A7-4EDB-BD03-AF43AA4A71CF%7D.png?alt=media" alt=""><figcaption></figcaption></figure>

#### 2. 初期設定

* 編集 **マシン名**

<figure><img src="https://2001299964-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Fl4EVJpcOrsgjSGsLI7p2%2Fuploads%2Fgit-blob-f0d8353aecf152fb7d1eea3445095ad4b2f9f3e6%2F%7B062678A8-1C4A-46F0-8CAC-8AC7BFE4C47F%7D.png?alt=media" alt=""><figcaption></figcaption></figure>

* ～を構成する **固定 IP アドレス**

<figure><img src="https://2001299964-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Fl4EVJpcOrsgjSGsLI7p2%2Fuploads%2Fgit-blob-40478a18c351a8dc484359bd062762a7689ed3d0%2F%7B79E50A8D-5B11-4298-BD09-45BDD0E028B7%7D.png?alt=media" alt=""><figcaption></figcaption></figure>

#### 3. ロールのインストール

* ロールをインストールする：
  * **Active Directory Domain Services（AD DS）**

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

#### 4. ドメイン コントローラーへの昇格

* 作成する **新しいフォレスト**
* ドメイン名： `whoami.local`

<figure><img src="https://2001299964-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Fl4EVJpcOrsgjSGsLI7p2%2Fuploads%2Fgit-blob-09dcfa5821f78d3de1c540160dfc51381ddf6527%2F%7B0AC81069-5284-46B3-8312-27975D0D4FC8%7D.png?alt=media" alt=""><figcaption></figcaption></figure>

* 構成後、仮想マシンを再起動する

## ドメインへの Windows 10 マシンの導入

{% embed url="<https://software.download.prss.microsoft.com/dbazure/Win10_22H2_Spanish_x64v1.iso?t=8faab265-3c5c-460a-ae83-230703b31fd6&P1=1777739675&P2=601&P3=2&P4=ESZ9seUg91b93n2FgqYLYn08u1otAQpm6KUoqKs%2bPfI%2fRGyaR5gC6Z%2bpXtNfLTnRjZwTh0kYwqPjfq0n6jCpj9JH8gba3jIb3OHetCttHy4inx40XJRc7nvkHlJpxfz9q75MgH%2fJNsc3h9ONnCrJ16sUH9PmqmYXPYzSxRQ%2bVltoOyn%2bgWrRLvWlemNQ3BPk6GRx%2bMaFPHPxZcur%2bobP%2fa2%2bCe%2fnm4Ymh2fbIK4KS1e9mXZMCT4hNto6aLXUoAHE6mkoLtIJVAG0wXB%2bo3koJs%2f3Maq8OTxThJdmIAHaASjxSOdRRuqQzOzDiyjQBpmLtvodrW6VrbRBxNGZ9839Bg%3d%3d>" %}

#### 1. マシンの作成

* 2 台のマシンを作成する：
  * **WS01**
  * **WS02**

<figure><img src="https://2001299964-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Fl4EVJpcOrsgjSGsLI7p2%2Fuploads%2Fgit-blob-fc070e3e176740f8719351c6a62557ef55b8e48f%2F%7B58592090-60B3-4E88-84F0-D7F9E05D7193%7D.png?alt=media" alt=""><figcaption></figcaption></figure>

#### 2. マシンの構成

* コンピューター名を変更する：
  * WS01
  * WS02

<figure><img src="https://2001299964-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Fl4EVJpcOrsgjSGsLI7p2%2Fuploads%2Fgit-blob-291adb37a82ecb97970b80b5f0856dbd6f07d56d%2F%7BBEC0C63F-B6D3-4DB5-8579-27188741188E%7D.png?alt=media" alt=""><figcaption></figcaption></figure>

IP アドレスを構成し、DNS をドメイン コントローラーに向ける：

* DNS： `172.16.0.100`

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

#### 3. ユーザーの作成

その **Active Directory 管理センター**:

<figure><img src="https://2001299964-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Fl4EVJpcOrsgjSGsLI7p2%2Fuploads%2Fgit-blob-cb0dac46761ef0daea2c758e98c91dbbf02d3eb8%2F%7B1BC3E755-F8B6-4F5C-B3C0-E907C950CE5E%7D.png?alt=media" alt=""><figcaption></figcaption></figure>

2 人のユーザーを作成する：

* user1
* user2

<figure><img src="https://2001299964-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Fl4EVJpcOrsgjSGsLI7p2%2Fuploads%2Fgit-blob-73dcd0c7b32b45209ba003238e7544b0163518ab%2F%7B60749964-2526-4990-98CC-3DB3265C3CF2%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-36007368b2874de0623f6e0146c92d70b10878c4%2F%7B691A4287-1B46-455E-8C48-FEF93032F378%7D.png?alt=media" alt=""><figcaption></figcaption></figure>

#### 4. ドメインへの統合

* 移動先： **職場または学校へのアクセス**

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

* 選択： **ドメインに接続する**
* ドメイン名を入力： `whoami.local`
* ドメイン アカウントで認証する

<figure><img src="https://2001299964-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Fl4EVJpcOrsgjSGsLI7p2%2Fuploads%2Fgit-blob-eef6debbc8731e5fb69da7d832329a539a064163%2F%7BFAFBED6E-EDD1-450C-8CC8-505C27DE8A3A%7D.png?alt=media" alt="" width="535"><figcaption></figcaption></figure>

## Active Directory の機能：ユーザー、グループ、および OU

〜では **Active Directory ユーザーとコンピューター**、フォレストとオブジェクトの構成を管理・変更できます。

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

#### ユーザーと OU の管理

<figure><img src="https://2001299964-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Fl4EVJpcOrsgjSGsLI7p2%2Fuploads%2Fgit-blob-5a3a54afea6d4437a79a5b4c47fa9675774216da%2Fimage%20(3177).png?alt=media" alt="" width="418"><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-4b38621fef7d6018436d6adee9e7ea21f4cfe66d%2Fimage%20(3178).png?alt=media" alt=""><figcaption></figcaption></figure>

以下を作成: **組織単位（OU）**、たとえば：

* *トゥールーズ*
* 既存のユーザーをこの OU に移動して、構成を整理します。

<figure><img src="https://2001299964-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Fl4EVJpcOrsgjSGsLI7p2%2Fuploads%2Fgit-blob-64ae8f8fbc6f40dd289cdf94bd48685829c02501%2F%7B2CF10B62-6D8E-4945-9B34-438449D46821%7D.png?alt=media" alt=""><figcaption></figcaption></figure>

#### グループ管理

* たとえば、グループを作成する：

  * **IT**

  ユーザーをグループに追加します。

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

グループは **別のグループのメンバーになれます**.

* 例:
  * その *IT* グループは *Administrators* グループのメンバーになれます

その後、ユーザーは **アクセス許可** を親グループから継承します。

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

#### GPO 管理（グループ ポリシー オブジェクト）

**GPO** により、構成ポリシーを管理できます。

<figure><img src="https://2001299964-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Fl4EVJpcOrsgjSGsLI7p2%2Fuploads%2Fgit-blob-746b05995b7c1aed4e6acb94e044e9dd380bcf51%2F%7B05C91C61-EC64-40CB-A870-8453181CA0CF%7D.png?alt=media" alt=""><figcaption></figcaption></figure>

#### GPO の作成

* 移動先： **グループ ポリシーの管理**

<figure><img src="https://2001299964-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Fl4EVJpcOrsgjSGsLI7p2%2Fuploads%2Fgit-blob-59f8dc03e2867ab269ec7355b6409c0c58cdd022%2F%7B501F9469-78FB-4BF6-867F-5597B5C99ACE%7D.png?alt=media" alt="" width="475"><figcaption></figcaption></figure>

* たとえば OU をクリックします **トゥールーズ**
* 新しい～を作成する **GPO**

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

#### ポリシーの種類

GPO は次に応じて適用できます：

* **ユーザー**
* **コンピューター**

<figure><img src="https://2001299964-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Fl4EVJpcOrsgjSGsLI7p2%2Fuploads%2Fgit-blob-6aa63a88a36b53094cbc9c470fa6814849dc11a0%2F%7BD1E2524F-382F-46EF-844F-3C6A4AB87EBC%7D.png?alt=media" alt=""><figcaption></figcaption></figure>

#### 例：セッション開始時にスクリプトを実行する

* 移動先：/ **ユーザーの構成 → Windows の設定 → スクリプト（ログオン）**
* 作成する `script.bat` 次の内容を含むファイル

{% code overflow="wrap" %}

```bash
calc.exe
```

{% endcode %}

<figure><img src="https://2001299964-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Fl4EVJpcOrsgjSGsLI7p2%2Fuploads%2Fgit-blob-2a0eebb970b0ee660716e14cb9e778262cafc71e%2Fimage%20(3185).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-d3848cc94e526b4836bb08942ea7358980909ddf%2F%7B1A27CE21-BAB8-44C7-8EFD-773AFDF3D83A%7D.png?alt=media" alt=""><figcaption></figcaption></figure>

#### 共有リソース（SMB）

共有の作成

* 移動先：/ **サーバー マネージャー → ファイル サービスと記憶域サービス → 共有**

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

* たとえば、新しい SMB 共有を作成する：
  * ローカル フォルダー： `C:\Shares\it`
  * ネットワーク パス： `//DC01/it`

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

#### GPO による自動マウント

共有に自動接続するには：

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

* スクリプトを使用する：

{% code overflow="wrap" %}

```bash
net use t: //172.16.0.100/it
```

{% endcode %}

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

#### 注意点（セキュリティ）

次のフォルダーに注意してください：

* **NETLOGON**
* **SYSVOL**

<figure><img src="https://2001299964-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Fl4EVJpcOrsgjSGsLI7p2%2Fuploads%2Fgit-blob-f176dfc5bab82dac1b22acf6f2afa316505fa42c%2Fimage%20(3190).png?alt=media" alt=""><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/active-directory/lab-setup.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.
