> 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/acl-security-descriptors-and-permissions/password-spraying.md).

# Spraying de mots de passe

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

#### 1. Principe

Le password spraying consiste à tester le même mot de passe sur plusieurs comptes utilisateurs.

Contrairement à une attaque par force brute classique, qui teste de nombreux mots de passe sur un seul utilisateur, le password spraying teste généralement un petit nombre de mots de passe sur de nombreux utilisateurs.

Cette technique est utilisée pour identifier les comptes partageant le même mot de passe.

#### 2. Attention en environnement réel

Dans un environnement réel, cette technique doit être utilisée avec une grande prudence.

Les tentatives d'authentification répétées peuvent provoquer :

* le verrouillage du compte ;
* des alertes de sécurité ;
* la détection par l'EDR, le SIEM ou l'équipe SOC ;
* un impact opérationnel sur les utilisateurs.

#### 3. Lister les descriptions des utilisateurs

Avant de lancer un password spraying, il peut être utile de consulter les descriptions des comptes utilisateurs.

Certaines descriptions peuvent contenir des informations sensibles, parfois même des mots de passe laissés par erreur.

Commande PowerView :

{% code overflow="wrap" %}

```powershell
Get-NetUser | select name,description
```

{% endcode %}

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

#### 4. Chargement de DomainPasswordSpray

{% embed url="<https://github.com/dafthack/DomainPasswordSpray/blob/master/DomainPasswordSpray.ps1>" %}

{% code overflow="wrap" %}

```powershell
. ./DomainPasswordSpray.ps1
```

{% endcode %}

#### 5. Création d’une liste d’utilisateurs

Nous extrayons la liste des utilisateurs du domaine dans un fichier texte :

{% code overflow="wrap" %}

```powershell
Get-NetUser | Select-Object -ExpandProperty name | Out-File C:/Users/user1/Desktop/users.txt
```

{% endcode %}

#### 6. Lancement du password spraying

Nous lançons ensuite le password spraying avec le mot de passe choisi :

{% code overflow="wrap" %}

```powershell
Invoke-DomainPasswordSpray -UserList ./users.txt -Password "Password1@" -Verbose
```

{% endcode %}

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

Cette commande teste le `Password1@` mot de passe sur les utilisateurs présents dans le `users.txt` fichier.

Si certains comptes utilisent ce mot de passe, l’outil les affichera comme des authentifications réussies.


---

# 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/acl-security-descriptors-and-permissions/password-spraying.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.
