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: src/pentesting-cloud/azure-security/az-lateral-movement-cloud-on-prem/az-connect-sync-policy-abuse.md
+15-6Lines changed: 15 additions & 6 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -4,7 +4,7 @@
4
4
5
5
## Basic Information
6
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**.
7
+
The **Entra ID Connect Sync** account (or its service principal) can access **internal Graph endpoints** (notably **`graph.windows.net` internal versions** such as the **`1.61-internal`** API). 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
8
9
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
10
@@ -16,11 +16,16 @@ If the sync principal can modify the **On‑Premises Authentication Policy**, it
16
16
17
17
High‑level flow:
18
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.
19
+
- Use Connect Sync credentials (user or service principal) to obtain tokens for **`graph.windows.net` internal API**.
20
+
- Query/modify the **On‑Premises Authentication Policy** object.
21
+
-**Add new KeyCredentials** for a target domain. The policy stores **symmetric Kerberos keys** used by Seamless SSO.
22
+
- Use the **new key material** to **forge Kerberos tickets** for **hybrid users**, enabling SSO‑based cloud authentication.
22
23
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
+
Notes from the talk:
25
+
26
+
- Existing keys are **not readable** (even as Global Admin), but **new keys can be added**.
27
+
- Adding keys effectively **backdoors Seamless SSO** without enabling it through normal admin flows.
28
+
- Audit visibility is minimal: policy changes are **poorly logged** (often only “policy changed” without details).
24
29
25
30
### Abuse Authentication Methods Policy to Bypass MFA
26
31
@@ -29,7 +34,11 @@ The sync principal can also modify **Authentication Methods Policy** (e.g., addi
29
34
-**Add a custom external method** as a valid MFA provider.
30
35
- Combine this with SSO/ADFS token forging to **satisfy MFA** requirements for hybrid users.
31
36
32
-
This is useful when MFA is enforced but the policy itself can be modified via internal Graph endpoints.
37
+
This is useful when MFA is enforced but the policy itself can be modified via internal Graph endpoints. The talk notes that policy updates may only show a **generic “policy changed”** entry without details.
The talk also mentions that **Conditional Access Policies** could historically be modified through internal Graph endpoints by the sync principal, but this was **patched in December 2023** (restricted to first‑party apps). The **policy‑abuse path still applies** for other policy types (on‑prem auth, auth methods, password management, external identities).
Copy file name to clipboardExpand all lines: src/pentesting-cloud/azure-security/az-lateral-movement-cloud-on-prem/az-exchange-hybrid-impersonation.md
+8-2Lines changed: 8 additions & 2 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -4,7 +4,7 @@
4
4
5
5
## Basic Information
6
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.
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**(commonly marked exportable) and use it to request **client‑credentials tokens** as Exchange Online.
8
8
9
9
This opens multiple pivot paths into Entra ID and other services.
10
10
@@ -27,7 +27,13 @@ Impact:
27
27
28
28
-**Impersonate any mailbox user** in Exchange Online.
29
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`**.
30
+
-**Impersonate Entra ID users** via `graph.windows.net` by crafting tokens with the target **`netId`** parameter.
31
+
32
+
Technical notes from the talk:
33
+
34
+
- The actor token is **issued by ACS**, contains the **Exchange audience**, and has **`trusted for delegation`** set.
35
+
- The actor token is embedded into an **unsigned bearer token**, where the **target user** is placed in the unsigned portion.
36
+
- For `graph.windows.net`, the call requires a **`netId`** value for the impersonated user (distinct from UPN). Exchange can query this and reuse it in the crafted token.
31
37
32
38
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.
0 commit comments