> 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/ru/active-directory/enumeration/impacket-and-rpcclient.md).

# Impacket и rpcclient

Заметки по безопасности Active Directory для Impacket и rpcclient, охватывающие перечисление, Kerberos, учётные данные, злоупотребление ACL, боковое перемещение, рабочий процесс эксплуатации и этапы проверки.

### Локальная конфигурация DNS

На машине Linux мы добавляем DNS-разрешения в `/etc/hosts`:

{% code overflow="wrap" %}

```bash
172.16.0.10 WS01.whoami.local
172.16.0.20 WS02.whoami.local
172.16.0.100 DC01.whoami.local
```

{% endcode %}

Это позволяет использовать имена машин вместо IP-адресов.

### Перечисление с rpcclient

Подключение с доменным пользователем:

{% code overflow="wrap" %}

```bash
rpcclient -U "whoami/user1" WS01.whoami.local
```

{% endcode %}

`rpcclient` может запрашивать определённые службы Windows RPC.

Его можно использовать для перечисления:

* пользователей;
* группы;
* некоторой информации SAM;
* определённой информации о домене в зависимости от доступных прав.

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

### Перечисление с Impacket

#### синхронный дамп

{% code overflow="wrap" %}

```bash
samrdump.py 'whoami/user2'@WS02.whoami.local
```

{% endcode %}

`samrdump.py` позволяет перечислить информацию SAM, доступную удалённо.

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

#### secretsdump

{% code overflow="wrap" %}

```bash
secretsdump.py 'whoami/user2'@WS02.whoami.local
```

{% endcode %}

`secretsdump.py` более чувствителен: он используется для извлечения секретов или хэшей, когда у пользователя есть необходимые права.

В лабораторной среде вы можете протестировать это с пользователем с повышенными привилегиями.

### Прослушивание сеансов с NetView

{% code overflow="wrap" %}

```bash
netview.py 'whoami/administrador' -target WS01.whoami.local
```

{% endcode %}

Эта команда позволяет наблюдать определённые сеансы или подключения, связанные с целевой машиной.

Затем мы можем создать SMB-подключение к машине:

{% code overflow="wrap" %}

```bash
dir //WS01/c$
```

{% endcode %}

Если сеанс установлен, он может быть виден с помощью инструментов перечисления.

<figure><img src="https://4248209978-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Fl4EVJpcOrsgjSGsLI7p2%2Fuploads%2Fgit-blob-edc92a773655f5948d366993b4d2059aeee4856c%2Fimage%20(3199).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/ru/active-directory/enumeration/impacket-and-rpcclient.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.
