|
1 |
| -# BloodHound & Other AD Enum Tools |
| 1 | +# BloodHound & Other Active Directory Enumeration Tools |
2 | 2 |
|
3 | 3 | {{#include ../../banners/hacktricks-training.md}}
|
4 | 4 |
|
5 |
| -## AD Explorer |
6 |
| - |
7 |
| -[AD Explorer](https://docs.microsoft.com/en-us/sysinternals/downloads/adexplorer) is from Sysinternal Suite: |
8 |
| - |
9 |
| -> An advanced Active Directory (AD) viewer and editor. You can use AD Explorer to navigate an AD database easily, define favourite locations, view object properties, and attributes without opening dialog boxes, edit permissions, view an object's schema, and execute sophisticated searches that you can save and re-execute. |
10 |
| -
|
11 |
| -### Snapshots |
12 |
| - |
13 |
| -AD Explorer can create snapshots of an AD so you can check it offline.\ |
14 |
| -It can be used to discover vulns offline, or to compare different states of the AD DB across the time. |
15 |
| - |
16 |
| -You will be requires the username, password, and direction to connect (any AD user is required). |
| 5 | +{{#ref}} |
| 6 | +adws-enumeration.md |
| 7 | +{{#endref}} |
17 | 8 |
|
18 |
| -To take a snapshot of AD, go to `File` --> `Create Snapshot` and enter a name for the snapshot. |
| 9 | +> NOTE: This page groups some of the most useful utilities to **enumerate** and **visualise** Active Directory relationships. For collection over the stealthy **Active Directory Web Services (ADWS)** channel check the reference above. |
19 | 10 |
|
20 |
| -## ADRecon |
| 11 | +--- |
21 | 12 |
|
22 |
| -[**ADRecon**](https://github.com/adrecon/ADRecon) is a tool which extracts and combines various artefacts out of an AD environment. The information can be presented in a **specially formatted** Microsoft Excel **report** that includes summary views with metrics to facilitate analysis and provide a holistic picture of the current state of the target AD environment. |
| 13 | +## AD Explorer |
23 | 14 |
|
24 |
| -```bash |
25 |
| -# Run it |
26 |
| -.\ADRecon.ps1 |
27 |
| -``` |
| 15 | +[AD Explorer](https://docs.microsoft.com/en-us/sysinternals/downloads/adexplorer) (Sysinternals) is an advanced **AD viewer & editor** which allows: |
28 | 16 |
|
29 |
| -## BloodHound |
| 17 | +* GUI browsing of the directory tree |
| 18 | +* Editing of object attributes & security descriptors |
| 19 | +* Snapshot creation / comparison for offline analysis |
30 | 20 |
|
31 |
| -From [https://github.com/BloodHoundAD/BloodHound](https://github.com/BloodHoundAD/BloodHound) |
| 21 | +### Quick usage |
32 | 22 |
|
33 |
| -> BloodHound is a single page Javascript web application, built on top of [Linkurious](http://linkurio.us/), compiled with [Electron](http://electron.atom.io/), with a [Neo4j](https://neo4j.com/) database fed by a C# data collector. |
| 23 | +1. Start the tool and connect to `dc01.corp.local` with any domain credentials. |
| 24 | +2. Create an offline snapshot via `File ➜ Create Snapshot`. |
| 25 | +3. Compare two snapshots with `File ➜ Compare` to spot permission drifts. |
34 | 26 |
|
35 |
| -BloodHound uses graph theory to reveal the hidden and often unintended relationships within an Active Directory or Azure environment. Attackers can use BloodHound to easily identify highly complex attack paths that would otherwise be impossible to quickly identify. Defenders can use BloodHound to identify and eliminate those same attack paths. Both blue and red teams can use BloodHound to easily gain a deeper understanding of privilege relationships in an Active Directory or Azure environment. |
| 27 | +--- |
36 | 28 |
|
37 |
| -So, [Bloodhound ](https://github.com/BloodHoundAD/BloodHound)is an amazing tool which can enumerate a domain automatically, save all the information, find possible privilege escalation paths and show all the information using graphs. |
| 29 | +## ADRecon |
38 | 30 |
|
39 |
| -Booldhound is composed of 2 main parts: **ingestors** and the **visualisation application**. |
| 31 | +[ADRecon](https://github.com/adrecon/ADRecon) extracts a large set of artefacts from a domain (ACLs, GPOs, trusts, CA templates …) and produces an **Excel report**. |
40 | 32 |
|
41 |
| -The **ingestors** are used to **enumerate the domain and extract all the information** in a format that the visualisation application will understand. |
| 33 | +```powershell |
| 34 | +# On a Windows host in the domain |
| 35 | +PS C:\> .\ADRecon.ps1 -OutputDir C:\Temp\ADRecon |
| 36 | +``` |
42 | 37 |
|
43 |
| -The **visualisation application uses neo4j** to show how all the information is related and to show different ways to escalate privileges in the domain. |
| 38 | +--- |
44 | 39 |
|
45 |
| -### Installation |
| 40 | +## BloodHound (graph visualisation) |
46 | 41 |
|
47 |
| -After the creation of BloodHound CE, the entire project was updated for ease of use with Docker. The easiest way to get started is to use its pre-configured Docker Compose configuration. |
| 42 | +[BloodHound](https://github.com/BloodHoundAD/BloodHound) uses graph theory + Neo4j to reveal hidden privilege relationships inside on-prem AD & Azure AD. |
48 | 43 |
|
49 |
| -1. Install Docker Compose. This should be included with the [Docker Desktop](https://www.docker.com/products/docker-desktop/) installation. |
50 |
| -2. Run: |
| 44 | +### Deployment (Docker CE) |
51 | 45 |
|
52 | 46 | ```bash
|
53 | 47 | curl -L https://ghst.ly/getbhce | docker compose -f - up
|
| 48 | +# Web UI ➜ http://localhost:8080 (user: admin / password from logs) |
54 | 49 | ```
|
55 | 50 |
|
56 |
| -3. Locate the randomly generated password in the terminal output of Docker Compose. |
57 |
| -4. In a browser, navigate to http://localhost:8080/ui/login. Login with the username **`admin`** and a **`randomly generated password`** you can find in the logs of docker compose. |
| 51 | +### Collectors |
58 | 52 |
|
59 |
| -After this you will need to change the randomly generated password and you will have the new interface ready, from which you can directly download the ingestors. |
| 53 | +* `SharpHound.exe` / `Invoke-BloodHound` – native or PowerShell variant |
| 54 | +* `AzureHound` – Azure AD enumeration |
| 55 | +* **SoaPy + BOFHound** – ADWS collection (see link at top) |
60 | 56 |
|
61 |
| -### SharpHound |
| 57 | +#### Common SharpHound modes |
62 | 58 |
|
63 |
| -They have several options but if you want to run SharpHound from a PC joined to the domain, using your current user and extract all the information you can do: |
64 |
| - |
65 |
| -``` |
66 |
| -./SharpHound.exe --CollectionMethods All |
67 |
| -Invoke-BloodHound -CollectionMethod All |
| 59 | +```powershell |
| 60 | +SharpHound.exe --CollectionMethods All # Full sweep (noisy) |
| 61 | +SharpHound.exe --CollectionMethods Group,LocalAdmin,Session,Trusts,ACL |
| 62 | +SharpHound.exe --Stealth --LDAP # Low noise LDAP only |
68 | 63 | ```
|
69 | 64 |
|
70 |
| -> You can read more about **CollectionMethod** and loop session [here](https://support.bloodhoundenterprise.io/hc/en-us/articles/17481375424795-All-SharpHound-Community-Edition-Flags-Explained) |
71 |
| -
|
72 |
| -If you wish to execute SharpHound using different credentials you can create a CMD netonly session and run SharpHound from there: |
73 |
| - |
74 |
| -``` |
75 |
| -runas /netonly /user:domain\user "powershell.exe -exec bypass" |
76 |
| -``` |
| 65 | +The collectors generate JSON which is ingested via the BloodHound GUI. |
77 | 66 |
|
78 |
| -[**Learn more about Bloodhound in ired.team.**](https://ired.team/offensive-security-experiments/active-directory-kerberos-abuse/abusing-active-directory-with-bloodhound-on-kali-linux) |
| 67 | +--- |
79 | 68 |
|
80 | 69 | ## Group3r
|
81 | 70 |
|
82 |
| -[**Group3r**](https://github.com/Group3r/Group3r) is a tool to find **vulnerabilities** in Active Directory associated **Group Policy**. \ |
83 |
| -You need to **run group3r** from a host inside the domain using **any domain user**. |
| 71 | +[Group3r](https://github.com/Group3r/Group3r) enumerates **Group Policy Objects** and highlights misconfigurations. |
84 | 72 |
|
85 | 73 | ```bash
|
86 |
| -group3r.exe -f <filepath-name.log> |
87 |
| -# -s sends results to stdin |
88 |
| -# -f send results to file |
| 74 | +# Execute inside the domain |
| 75 | +Group3r.exe -f gpo.log # -s to stdout |
89 | 76 | ```
|
90 | 77 |
|
| 78 | +--- |
| 79 | + |
91 | 80 | ## PingCastle
|
92 | 81 |
|
93 |
| -[**PingCastle**](https://www.pingcastle.com/documentation/) **evaluates the security posture of an AD environment** and provides a nice **report** with graphs. |
| 82 | +[PingCastle](https://www.pingcastle.com/documentation/) performs a **health-check** of Active Directory and generates an HTML report with risk scoring. |
94 | 83 |
|
95 |
| -To run it, can execute the binary `PingCastle.exe` and it will start an **interactive session** presenting a menu of options. The default option to use is **`healthcheck`** which will establish a baseline **overview** of the **domain**, and find **misconfigurations** and **vulnerabilities**. |
| 84 | +```powershell |
| 85 | +PingCastle.exe --healthcheck --server corp.local --user bob --password "P@ssw0rd!" |
| 86 | +``` |
96 | 87 |
|
97 | 88 | {{#include ../../banners/hacktricks-training.md}}
|
98 |
| - |
99 |
| - |
100 |
| - |
0 commit comments