Skip to content

Commit 93c2d43

Browse files
author
chack
committed
Add AD to Entra pivot techniques from recent talk
1 parent 9ebb2d9 commit 93c2d43

4 files changed

Lines changed: 86 additions & 1 deletion

File tree

src/SUMMARY.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -504,9 +504,11 @@
504504
- [Az - Cloud Kerberos Trust](pentesting-cloud/azure-security/az-lateral-movement-cloud-on-prem/az-cloud-kerberos-trust.md)
505505
- [Az - Cloud Sync](pentesting-cloud/azure-security/az-lateral-movement-cloud-on-prem/az-cloud-sync.md)
506506
- [Az - Connect Sync](pentesting-cloud/azure-security/az-lateral-movement-cloud-on-prem/az-connect-sync.md)
507+
- [Az - Connect Sync Policy Abuse](pentesting-cloud/azure-security/az-lateral-movement-cloud-on-prem/az-connect-sync-policy-abuse.md)
507508
- [Az - Domain Services](pentesting-cloud/azure-security/az-lateral-movement-cloud-on-prem/az-domain-services.md)
508509
- [Az - Federation](pentesting-cloud/azure-security/az-lateral-movement-cloud-on-prem/az-federation.md)
509510
- [Az - Hybrid Identity Misc Attacks](pentesting-cloud/azure-security/az-lateral-movement-cloud-on-prem/az-hybrid-identity-misc-attacks.md)
511+
- [Az - Exchange Hybrid Impersonation (ACS Actor Tokens)](pentesting-cloud/azure-security/az-lateral-movement-cloud-on-prem/az-exchange-hybrid-impersonation.md)
510512
- [Az - Local Cloud Credentials](pentesting-cloud/azure-security/az-lateral-movement-cloud-on-prem/az-local-cloud-credentials.md)
511513
- [Az - Pass the Certificate](pentesting-cloud/azure-security/az-lateral-movement-cloud-on-prem/az-pass-the-certificate.md)
512514
- [Az - Pass the Cookie](pentesting-cloud/azure-security/az-lateral-movement-cloud-on-prem/az-pass-the-cookie.md)

src/pentesting-cloud/azure-security/az-lateral-movement-cloud-on-prem/README.md

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,12 +16,16 @@ This section covers the pivoting techniques to move from a compromised Entra ID
1616

1717
- [**Connect Sync**](az-connect-sync.md): How to abuse Connect Sync to move from the cloud to on-premises AD and the other way around.
1818

19+
- [**Connect Sync Policy Abuse**](az-connect-sync-policy-abuse.md): How to abuse Connect Sync access to modify internal policies (e.g., enable Seamless SSO or add external auth methods) and pivot from AD to Entra ID.
20+
1921
- [**Domain Services**](az-domain-services.md): What is the Azure Domain Services Service and how to pivot from Entra ID to the AD it generates.
2022

2123
- [**Federation**](az-federation.md): How to abuse Federation to move from the cloud to on-premises AD and the other way around.
2224

2325
- [**Hybrid Misc Attacks**](az-hybrid-identity-misc-attacks.md): Miscellaneous attacks that can be used to pivot from the cloud to on-premises AD and the other way around.
2426

27+
- [**Exchange Hybrid Impersonation (ACS Actor Tokens)**](az-exchange-hybrid-impersonation.md): How to abuse Exchange Hybrid to impersonate users across Exchange/SharePoint/Entra ID and pivot from AD to Entra ID.
28+
2529
- [**Local Cloud Credentials**](az-local-cloud-credentials.md): Where to find credentials to the cloud when a PC is compromised.
2630

2731
- [**Pass the Certificate**](az-pass-the-certificate.md): Generate a cert based on the PRT to login from one machine to another.
@@ -39,4 +43,3 @@ This section covers the pivoting techniques to move from a compromised Entra ID
3943

4044
{{#include ../../../banners/hacktricks-training.md}}
4145

42-
Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
# Az - Connect Sync Policy Abuse
2+
3+
{{#include ../../../banners/hacktricks-training.md}}
4+
5+
## Basic Information
6+
7+
The **Entra ID Connect Sync** account (or its service principal) can access **internal Graph endpoints** (notably `graph.windows.net` internal API versions). With that access it can **modify tenant policies** beyond simple directory sync, which enables **new pivot paths from on‑prem AD to Entra ID**.
8+
9+
The techniques below are based on practical research and are especially relevant in hybrid environments where Connect Sync is present but ADFS/Seamless SSO are not explicitly enabled.
10+
11+
## Attack Paths
12+
13+
### Enable Seamless SSO by Adding Kerberos Keys
14+
15+
If the sync principal can modify the **On‑Premises Authentication Policy**, it can **add new key material** for Seamless SSO. This effectively **backdoors Seamless SSO** even if it was not enabled before.
16+
17+
High‑level flow:
18+
19+
- Use Connect Sync credentials (user or service principal) to obtain tokens for `graph.windows.net` internal API.
20+
- Modify the **On‑Premises Authentication Policy** and **add KeyCredentials** for a target domain.
21+
- Use the newly added key to **forge Kerberos tickets** for **hybrid users**, enabling SSO‑based cloud authentication.
22+
23+
This enables AD‑to‑Entra impersonation without needing to steal existing key material. In practice, policy changes are **poorly logged** (often only “policy changed” without details).
24+
25+
### Abuse Authentication Methods Policy to Bypass MFA
26+
27+
The sync principal can also modify **Authentication Methods Policy** (e.g., adding external authentication methods). This can allow an attacker to:
28+
29+
- **Add a custom external method** as a valid MFA provider.
30+
- Combine this with SSO/ADFS token forging to **satisfy MFA** requirements for hybrid users.
31+
32+
This is useful when MFA is enforced but the policy itself can be modified via internal Graph endpoints.
33+
34+
## References
35+
36+
- https://www.youtube.com/watch?v=rzfAutv6sB8
37+
38+
{{#include ../../../banners/hacktricks-training.md}}
Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
1+
# Az - Exchange Hybrid Impersonation (ACS Actor Tokens)
2+
3+
{{#include ../../../banners/hacktricks-training.md}}
4+
5+
## Basic Information
6+
7+
In **Exchange Hybrid** deployments, the on‑prem Exchange server shares a **service principal identity** with Exchange Online. If an attacker compromises the on‑prem Exchange server, they can often **export the hybrid certificate** and use it to request **client‑credentials tokens** as Exchange Online.
8+
9+
This opens multiple pivot paths into Entra ID and other services.
10+
11+
## Attack Paths
12+
13+
### Modify Federation Configuration via Exchange
14+
15+
Exchange Hybrid can **write domain federation configuration**. This can be abused to:
16+
17+
- **Add a new token‑signing certificate** for a federated domain.
18+
- **Relax MFA claims acceptance** for ADFS‑issued tokens.
19+
20+
Once a malicious token‑signing cert is added (or MFA acceptance is loosened), an attacker can **forge ADFS tokens** and impersonate hybrid users in Entra ID.
21+
22+
### ACS Actor Tokens → Impersonate Any User
23+
24+
Exchange can request **ACS actor tokens** that include **`trusted for delegation`**. Those tokens allow **service‑to‑service impersonation** across Exchange and other Microsoft 365 services.
25+
26+
Impact:
27+
28+
- **Impersonate any mailbox user** in Exchange Online.
29+
- **Access SharePoint/OneDrive** as any user (Exchange uses those services under the hood).
30+
- **Impersonate Entra ID users** via `graph.windows.net` by crafting tokens with the target **`netId`**.
31+
32+
These actor tokens are **not subject to Conditional Access** and are typically valid for long periods (e.g., ~24 hours). With them, an attacker can perform **Entra ID admin actions** (e.g., create a Global Admin), resulting in full tenant compromise.
33+
34+
### Detection Notes
35+
36+
Entra audit logs may show **odd mixed identities** (the impersonated user UPN combined with **Exchange Online** as the display name), which can be a detection signal for this abuse path.
37+
38+
## References
39+
40+
- https://www.youtube.com/watch?v=rzfAutv6sB8
41+
42+
{{#include ../../../banners/hacktricks-training.md}}

0 commit comments

Comments
 (0)