> 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/pt-br/active-directory/enumeration/remote-sam-enumeration.md).

# Enumeração remota do SAM

Anotações de segurança do Active Directory para Enumeração remota do SAM, cobrindo enumeração, Kerberos, credenciais, abuso de ACL, movimentação lateral, fluxo de exploração e etapas de validação.

### Princípio

SAM significa **Gerenciador de Contas de Segurança**.

Ele contém informações sobre:

* contas locais;
* grupos locais;
* associações em grupos locais.

Em versões mais antigas do Windows, antes do Windows 10 e do Windows Server 2016, muitas vezes era possível enumerar certas informações do SAM remotamente sem privilégios elevados.

### Enumerar grupos locais de uma máquina remota

Com o PowerView:

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

Este comando tenta recuperar os grupos locais presentes em `WS02`.

### Alternativa sem PowerView

Com PowerShell Remoting:

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

Este comando executa `Get-LocalGroupMember` diretamente em `WS02`.

Geralmente requer que:

* o PowerShell Remoting esteja habilitado;
* o usuário tenha os privilégios necessários;
* as regras de rede e do firewall permitam isso.

### Ver usuários conectados a uma máquina remota

Com o PowerView:

```powershell
Get-NetLoggedon
```

Este comando identifica os usuários atualmente autenticados em uma máquina.

É útil saber:

* onde um usuário está conectado;
* se um administrador está ativo em uma máquina;
* quais máquinas podem ser de interesse para análise posterior.

### Ver as sessões abertas na sua máquina

Com o PowerView:

```powershell
Get-NetSession
```

Este comando exibe as sessões SMB estabelecidas com a máquina.

Por exemplo, se um usuário tentar acessar:

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

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

Então a conexão pode aparecer nas sessões visíveis.


---

# 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/pt-br/active-directory/enumeration/remote-sam-enumeration.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.
