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

# Enumeración remota de SAM

### Principio

SAM significa **Administrador de cuentas de seguridad**.

Contiene información sobre:

* cuentas locales;
* grupos locales;
* pertenencias en grupos locales.

En versiones anteriores de Windows, antes de Windows 10 y Windows Server 2016, a menudo era posible enumerar cierta información de SAM de forma remota sin privilegios elevados.

### Enumerar los grupos locales de una máquina remota

Con PowerView:

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

Este comando intenta recuperar los grupos locales presentes en `WS02`.

### Alternativa sin PowerView

Con PowerShell Remoting:

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

Este comando ejecuta `Get-LocalGroupMember` directamente en `WS02`.

Generalmente requiere que:

* PowerShell Remoting esté habilitado;
* el usuario tenga los permisos necesarios;
* las reglas de red y del firewall lo permitan.

### Ver usuarios conectados a una máquina remota

Con PowerView:

```powershell
Get-NetLoggedon
```

Este comando identifica a los usuarios actualmente autenticados en una máquina.

Es útil saber:

* dónde ha iniciado sesión un usuario;
* si un administrador está activo en una máquina;
* qué máquinas pueden ser de interés para un análisis posterior.

### Ver las sesiones abiertas en tu máquina

Con PowerView:

```powershell
Get-NetSession
```

Este comando muestra las sesiones SMB establecidas en la máquina.

Por ejemplo, si un usuario intenta acceder a:

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

<figure><img src="/files/0f591ac76fd79000d0ea2a60f650f988f7b0723a" alt=""><figcaption></figcaption></figure>

Entonces la conexión puede aparecer en las sesiones visibles.


---

# 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/es/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.
