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

# Énumération SAM distante

Notes de sécurité Active Directory pour l'énumération SAM distante, couvrant l'énumération, Kerberos, les identifiants, l'abus d'ACL, le mouvement latéral, le flux d'exploitation et les étapes de validation.

### Principe

SAM signifie **Gestionnaire des comptes de sécurité**.

Il contient des informations sur :

* les comptes locaux ;
* les groupes locaux ;
* les appartenances aux groupes locaux.

Sur les anciennes versions de Windows, avant Windows 10 et Windows Server 2016, il était souvent possible d’énumérer certaines informations SAM à distance sans privilèges élevés.

### Énumérer les groupes locaux d’une machine distante

Avec PowerView :

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

Cette commande tente de récupérer les groupes locaux présents sur `WS02`.

### Alternative sans PowerView

Avec PowerShell Remoting :

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

Cette commande exécute `Get-LocalGroupMember` directement sur `WS02`.

Cela nécessite généralement que :

* PowerShell Remoting soit activé ;
* l’utilisateur dispose des droits nécessaires ;
* les règles réseau et pare-feu l’autorisent.

### Afficher les utilisateurs connectés à une machine distante

Avec PowerView :

```powershell
Get-NetLoggedon
```

Cette commande identifie les utilisateurs actuellement authentifiés sur une machine.

Il est utile de savoir :

* où un utilisateur est connecté ;
* si un administrateur est actif sur une machine ;
* quelles machines peuvent présenter un intérêt pour une analyse plus approfondie.

### Voir les sessions ouvertes sur votre machine

Avec PowerView :

```powershell
Get-NetSession
```

Cette commande affiche les sessions SMB établies sur la machine.

Par exemple, si un utilisateur tente d’accéder à :

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

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

Alors la connexion peut apparaître dans les sessions 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 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/fr/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.
