> 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/remote-sam-enumeration.md).

# Удаленное перечисление SAM

### Принцип

SAM означает **Диспетчер учетных записей безопасности**.

Он содержит информацию о:

* локальных учетных записях;
* локальных группах;
* членстве в локальных группах.

В более старых версиях Windows, до Windows 10 и Windows Server 2016, часто можно было удаленно перечислять определенную информацию SAM без повышенных привилегий.

### Перечисление локальных групп удаленной машины

С PowerView:

```powershell
Get-NetLocalGroup -ComputerName WS02
```

Эта команда пытается получить локальные группы, присутствующие на `WS02`.

### Альтернатива без PowerView

С помощью удаленного выполнения PowerShell:

```powershell
Invoke-Command -ScriptBlock { Get-LocalGroupMember -Group Administrators } -ComputerName WS02
```

Эта команда выполняет `Get-LocalGroupMember` непосредственно на `WS02`.

Обычно для этого требуется, чтобы:

* было включено удаленное выполнение PowerShell;
* у пользователя были необходимые права;
* сетевые правила и правила брандмауэра это разрешали.

### Просмотр пользователей, подключенных к удаленной машине

С PowerView:

```powershell
Get-NetLoggedon
```

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

Полезно знать:

* где пользователь вошел в систему;
* активен ли на машине администратор;
* какие машины могут представлять интерес для дальнейшего анализа.

### Просмотр сеансов, открытых на вашей машине

С PowerView:

```powershell
Get-NetSession
```

Эта команда отображает SMB-сеансы, установленные к машине.

Например, если пользователь пытается получить доступ к:

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

<figure><img src="/files/5b5b9f1b234bd1f8ae6c9a7df63a8b7d07fd8b48" 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/remote-sam-enumeration.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.
