> 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

### Локальная конфигурация 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="/files/c4326bcb56e53ba19d7a236773e8dc056627850c" alt=""><figcaption></figcaption></figure>

### Перечисление с помощью Impacket

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

{% code overflow="wrap" %}

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

{% endcode %}

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

<figure><img src="/files/7639cfa6a0663762d2d7e265a9e23487ba3a8ca7" 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="/files/6a0af772351a3a440443734e50d013c6ead904c6" 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 dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter, and the optional `goal` query parameter:

```
GET https://hacking-notes.jord4n.pro/ru/active-directory/enumeration/impacket-and-rpcclient.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

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.
