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

# Remote SAM Enumeration

Active Directory security notes for Remote SAM Enumeration, covering enumeration, Kerberos, credentials, ACL abuse, lateral movement, exploitation workflow, and validation steps.

### Principle

SAM signifie **Security Account Manager**.

It contains information about:

* local accounts;
* local groups;
* memberships in local groups.

On older versions of Windows, before Windows 10 and Windows Server 2016, it was often possible to enumerate certain SAM information remotely without elevated privileges.

### Enumerate local groups of a remote machine

With PowerView:

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

This command attempts to retrieve the local groups present on `WS02`.

### Alternative without PowerView

With PowerShell Remoting:

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

This command executes `Get-LocalGroupMember` directly on `WS02`.

It generally requires that:

* PowerShell Remoting is enabled;
* the user has the necessary rights;
* network and firewall rules allow it.

### View users connected to a remote machine

With PowerView:

```powershell
Get-NetLoggedon
```

This command identifies the users currently authenticated on a machine.

It is useful to know:

* where a user is logged in;
* if an administrator is active on a machine;
* which machines may be of interest for further analysis.

### See the sessions opened to your machine

With PowerView:

```powershell
Get-NetSession
```

This command displays the SMB sessions established to the machine.

For example, if a user tries to access:

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

<figure><img src="https://131707722-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>

Then the connection can appear in visible sessions.


---

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