> 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/ports-and-services/smb-445/rpcclient-smb-tool.md).

# rpcclient（SMBツール）

rpcclientを使ったSMBとActive Directoryの列挙。ユーザー、グループ、RID、説明、nullセッション。

> ある **RPCClient** リモートプロシージャコールを行うためのプログラムです。クライアントが、あたかもローカルで実行されているかのように、リモートサーバー上の関数やメソッドを実行できます。クライアントはネットワークを介してサーバーにリクエストを送り、サーバーは要求された関数を実行して結果をクライアントに返します。この通信は、異なるシステム間のやり取りを容易にするために、分散アーキテクチャで一般的に使用されます。

### **ドメインコントローラーへの接続**

**1. 認証なしでの初回ログイン**/ パスワードを指定せずにドメインコントローラーへ接続するコマンド。 `-N` オプションは `rpcclient` パスワードを送信しないようにします：

```bash
rpcclient -U "" 10.10.10.175 -N
```

**2. ドメインユーザーの列挙**/ ドメインユーザーを一覧表示するには：

```bash
enumdomusers
```

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

**3. ドメイングループの一覧**/ ドメイングループを一覧表示するコマンド：

```bash
rpcclient -U "" 10.10.10.161 -N -c 'enumdomgroups'
```

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

### **ユーザーとグループの調査**

**1. パスワードでログイン**/ 特定のパスワードでドメインコントローラーに接続するには：

```bash
rpcclient -U "<password>" 10.10.10.10
```

<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>

**2. Administratorsグループのメンバーを特定する**/ Administratorsグループのメンバーを特定するには（RID `0x200`):

```bash
rpcclient -U "<password>" 10.10.10.10 -c 'querygroupmem 0x200'
```

**3. 特定のグループのユーザーを取得する**/ 特定のグループのユーザーを取得するには（RID `0x1f4`):

```bash
rpcclient -U "<password>" 10.10.10.10 -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>

**4. ユーザーの説明を一覧表示する**/ すべてのユーザーの説明を一覧表示するには：

```bash
rpcclient -U "<password>" 10.10.10.10 -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>

### ドメインの列挙

**1. 資格情報を使用してドメインにログイン**/ 資格情報を使用してドメインコントローラーに接続するには：

```bash
rpcclient -U 'ldap%nvEfEK16^1aM4$e7AclUf8x$tRWxPWO1%lmz' 10.10.11.174
```

**2. ドメインユーザーの一覧**

ドメインユーザーを一覧表示するには：

```
enumdomusers
```

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

**3. ドメイングループの一覧**/ ドメイン内のグループを一覧表示するには：

```bash
enumdomgroups
```

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

**4. ユーザーの説明**/ ユーザーの説明を取得するには：

```bash
querydispinfo
```

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

**5. 有効なユーザーをファイルに書き出す**/ すべての有効なユーザーをファイルに書き出すには：

```bash
rpcclient -U 'ldap%nvEfEK16^1aM4$e7AclUf8x$tRWxPWO1%lmz' 10.10.11.174 -c 'enumdomusers' | grep -oP '/[.*?/]' | grep -v 0x |tr -d '[]'
```

<figure><img src="https://2001299964-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Fl4EVJpcOrsgjSGsLI7p2%2Fuploads%2Fgit-blob-8d30a010c21f0ac40cf81716bea9056e3ffe7124%2Fimage%20(1545).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/ports-and-services/smb-445/rpcclient-smb-tool.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.
