You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardexpand all lines: docs/389-636-ldap.md
+1-1
Original file line number
Diff line number
Diff line change
@@ -26,7 +26,7 @@ The relationship between AD and LDAP can be compared to Apache and HTTP. The sam
26
26
- It's a binary protocol and by default not encrypted.
27
27
- Has been updated to include encryptions addons, as Transport Layer Security (TLS)/SSL and can be tunnelled through SSH
28
28
29
-
The hierarchy (tree) of information stored via LDAP is known as the Directory Information Tree (DIT). That structure is defined in a schema.
29
+
The hierarchy (tree) of information stored via LDAP is known as the **Directory Information Tree (DIT).** That structure is defined in a schema.
30
30
31
31
A common use of LDAP is to provide a central place to store usernames and passwords. This allows many different applications and services to connect to the LDAP server to validate users.
Copy file name to clipboardexpand all lines: docs/active-directory-from-linux-enumeration.md
-24
Original file line number
Diff line number
Diff line change
@@ -381,30 +381,6 @@ It's possible to obtain the Ticket Granting Ticket (TGT) for any account that ha
381
381
382
382
ASREPRoasting is similar to Kerberoasting, but it involves attacking the AS-REP instead of the TGS-REP. An SPN is not required. This setting can be enumerated with PowerView or built-in tools such as the PowerShell AD module.
383
383
384
-
#### DONT_REQ_PREAUTH Value using Get-DomainUser
385
-
386
-
Enumerating for DONT_REQ_PREAUTH Value using Get-DomainUser
With this information in hand, the Rubeus tool can be leveraged to retrieve the AS-REP in the proper format for offline hash cracking. This attack does not require any domain user context and can be done by just knowing the SAM name for the user without Kerberos pre-auth.
[targetedKerberoast](https://github.com/ShutdownRepo/targetedKerberoast) is a Python script that can, like many others (e.g. GetUserSPNs.py), print "kerberoast" hashes for user accounts that have a SPN set. This tool brings the following additional feature: for each user without SPNs, it tries to set one (abuse of a write permission on the servicePrincipalName attribute), print the "kerberoast" hash, and delete the temporary SPN set for that operation. This is called targeted Kerberoasting. This tool can be used against all users of a domain, or supplied in a list, or one user supplied in the CLI.
Next, we can use [lookupsid.py](https://github.com/SecureAuthCorp/impacket/blob/master/examples/lookupsid.py) , an Impacket script used for querying a Windows system to obtain information about the SID associated with a given user or group.
221
+
222
+
The tool will give us back the SID for the domain and the RIDs for each user and group that could be used to create their SID in the format `DOMAIN_SID-RID`.
#### Step 3: getting the name of a target user in the child domain (does not need to exist!)
243
+
244
+
For instance, `hacker`.
245
+
246
+
#### Step 4: getting the FQDN of the child domain.
247
+
248
+
logistics.inlanefreight.local
249
+
250
+
251
+
#### Step 5: getting the SID of the Enterprise Admins group of the root domain
252
+
253
+
Next, we can rerun the command, targeting the INLANEFREIGHT Domain Controller (DC01) at 172.16.5.5. We will perform a **SID enumeration** on the target system and filter the results to find information related to the **Enterprise Admins** group in the Active Directory (AD) domain. For filtering we will use the RID of the Enterprise Admins group. [Here](active-directory-security-identifiers.md) is a handy list of well-known SIDs.
As the domain SID was: `S-1-5-21-3842939050-3880317879-2865463114` and the RID is `519`, the SID of "Enterprise Admin" group is `S-1-5-21-3842939050-3880317879-2865463114-519` .
272
+
273
+
274
+
#### Step 6: Generate a golden ticket
275
+
276
+
Next, we can use [ticketer.py](https://github.com/SecureAuthCorp/impacket/blob/master/examples/ticketer.py) from the Impacket toolkit to construct a Golden Ticket. This ticket will be valid to access resources in the child domain (specified by `-domain-sid`) and the parent domain (specified by `-extra-sid`).
The ticket will be saved down to our system as a credential cache (ccache) file, which is a file used to hold Kerberos credentials:
285
+
286
+
```
287
+
[*] Saving ticket in hacker.ccache
288
+
```
289
+
290
+
291
+
Setting the KRB5CCNAME environment variable tells the system to use this file for Kerberos authentication attempts.
292
+
293
+
```shell-session
294
+
export KRB5CCNAME=hacker.ccache
295
+
```
296
+
297
+
298
+
We can check if we can successfully authenticate to the parent domain's Domain Controller using [Impacket's version of Psexec](impacket-psexec.md). If successful, we will be dropped into a SYSTEM shell on the target Domain Controller.
Impacket also has the tool [raiseChild.py](https://github.com/SecureAuthCorp/impacket/blob/master/examples/raiseChild.py), which will automate escalating from child to parent domain.
311
+
312
+
We need to specify the target domain controller and credentials for an administrative user in the child domain.
Sometimes you cannot escalate privileges in your current domain, but instead can obtain a Kerberos ticket and crack a hash for an administrative user in another domain that has Domain/Enterprise Admin privileges in both domains.
387
+
388
+
To do this, we need credentials for a user that can authenticate into the other domain and specify the `-target-domain` flag in our command.
### 🐇 Hunting Foreign Group Membership with Bloodhound-python
415
+
416
+
we may, from time to time, see users or admins from one domain as members of a group in another domain. Since only `Domain Local Groups` allow users from outside their forest, it is not uncommon to see a highly privileged user from Domain A as a member of the built-in administrators group in domain B when dealing with a bidirectional forest trust relationship.
417
+
418
+
If we are testing from a Linux host, we can gather this information by using the [Python implementation of BloodHound](https://github.com/fox-it/BloodHound.py).
419
+
420
+
**Collecting information from INLANEFREIGHT.LOCAL**
421
+
422
+
```shell-session
423
+
sudo nano /etc/resolv.conf
424
+
```
425
+
426
+
Modify the file so it will have the following entries:
427
+
428
+
```
429
+
#nameserver 1.1.1.1
430
+
#nameserver 8.8.8.8
431
+
domain INLANEFREIGHT.LOCAL
432
+
nameserver 172.16.5.5
433
+
```
434
+
435
+
Running bloodhound-python Against INLANEFREIGHT.LOCAL:
We can compress the resultant zip files to upload one single zip file directly into the BloodHound GUI.
470
+
471
+
```shell-session
472
+
zip -r FREIGHTLOGISTICS.zip *.json
473
+
```
474
+
475
+
Transfer the files to your attacker machine, open [Bloodhound](bloodhound.md) in your attacker machine, upload the zip. Now we can click on Users with Foreign Domain Group Membership under the Analysis tab and select the source domain as INLANEFREIGHT.LOCAL. Here, we will see the built-in Administrator account for the INLANEFREIGHT.LOCAL domain is a member of the built-in Administrators group in the FREIGHTLOGISTICS.LOCAL domain as we saw previously.
0 commit comments