|
| 1 | +--- |
| 2 | +title: Create Guest User |
| 3 | +--- |
| 4 | + |
| 5 | +# Create Guest User |
| 6 | + |
| 7 | + |
| 8 | + |
| 9 | + |
| 10 | +Platform: Entra ID |
| 11 | + |
| 12 | +## MITRE ATT&CK Tactics |
| 13 | + |
| 14 | + |
| 15 | +- Persistence |
| 16 | + |
| 17 | +## Description |
| 18 | + |
| 19 | + |
| 20 | +Invites an external guest user in the tenant. |
| 21 | + |
| 22 | +<span style="font-variant: small-caps;">Warm-up</span>: None |
| 23 | + |
| 24 | +<span style="font-variant: small-caps;">Detonation</span>: |
| 25 | + |
| 26 | +- Invite guest user (without generating an invitation email) |
| 27 | + |
| 28 | +References: |
| 29 | + |
| 30 | +- https://securitylabs.datadoghq.com/cloud-security-atlas/attacks/inviting-external-users/ |
| 31 | +- https://derkvanderwoude.medium.com/azure-subscription-hijacking-and-cryptomining-86c2ac018983 |
| 32 | +- https://dirkjanm.io/assets/raw/US-22-Mollema-Backdooring-and-hijacking-Azure-AD-accounts_final.pdf |
| 33 | + |
| 34 | +!!! note |
| 35 | + |
| 36 | + By default, Stratus Red Team invites the e-mail <code>[email protected]</code>. However, you can override |
| 37 | + this behavior by setting the environment variable <code>STRATUS_RED_TEAM_ATTACKER_EMAIL</code>, for instance: |
| 38 | + |
| 39 | + ```bash |
| 40 | + export STRATUS_RED_TEAM_ATTACKER_EMAIL="[email protected]" |
| 41 | + stratus detonate entra-id.persistence.guest-user |
| 42 | + ``` |
| 43 | + |
| 44 | + |
| 45 | +## Instructions |
| 46 | + |
| 47 | +```bash title="Detonate with Stratus Red Team" |
| 48 | +stratus detonate entra-id.persistence.guest-user |
| 49 | +``` |
| 50 | +## Detection |
| 51 | + |
| 52 | + |
| 53 | +Using [Entra ID audit logs](https://learn.microsoft.com/en-us/entra/identity/monitoring-health/concept-audit-logs) with the specific activity types: |
| 54 | + |
| 55 | +- <code>Add user</code> |
| 56 | +- <code>Invite external user</code> |
| 57 | +- <code>Add user sponsor</code> |
| 58 | + |
| 59 | +When the invited user accepts the invite, an additional event <code>Redeem external user invite</code> is logged. |
| 60 | + |
| 61 | +Sample events, shortened for clarity: |
| 62 | + |
| 63 | +```json |
| 64 | +{ |
| 65 | + "category": "UserManagement", |
| 66 | + "result": "success", |
| 67 | + "activityDisplayName": "Invite external user", |
| 68 | + "loggedByService": "Invited Users", |
| 69 | + "initiatedBy": { |
| 70 | + "user": { |
| 71 | + "userPrincipalName": "<[email protected]>", |
| 72 | + } |
| 73 | + }, |
| 74 | + "userAgent": "", |
| 75 | + "targetResources": [ |
| 76 | + { |
| 77 | + "displayName": "<invited user display name>", |
| 78 | + "type": "User", |
| 79 | + "userPrincipalName": "<invited-user-email>#EXT#@<tenant.tld>", |
| 80 | + "groupType": null, |
| 81 | + "modifiedProperties": [] |
| 82 | + } |
| 83 | + ], |
| 84 | + "additionalDetails": [ |
| 85 | + { |
| 86 | + "key": "invitedUserEmailAddress", |
| 87 | + "value": "<invited-user-email>" |
| 88 | + } |
| 89 | + ] |
| 90 | +} |
| 91 | +{ |
| 92 | + "category": "UserManagement", |
| 93 | + "result": "success", |
| 94 | + "resultReason": null, |
| 95 | + "activityDisplayName": "Redeem external user invite", |
| 96 | + "loggedByService": "B2B Auth", |
| 97 | + "initiatedBy": { |
| 98 | + "user": { |
| 99 | + "userPrincipalName": "<invited-user-email>", |
| 100 | + "ipAddress": "<invited-user-ip>" |
| 101 | + } |
| 102 | + }, |
| 103 | + "targetResources": [ |
| 104 | + { |
| 105 | + "id": "d042c4fe-5dd1-44a2-883a-eede6c10608f", |
| 106 | + "displayName": "UPN: <invited-user-email>#EXT#<tenant.tld>, Email: <invited-user-email>, InvitationId: 4c93fc70-169a-411f-8cf7-aff732f8c7b9, Source: One Time Passcode", |
| 107 | + "type": "User", |
| 108 | + "userPrincipalName": "<invited-user-email>#EXT#<tenant.tld>" |
| 109 | + } |
| 110 | + ] |
| 111 | +} |
| 112 | +``` |
| 113 | + |
| 114 | + |
0 commit comments