Must be an administrative user and assign the "Send on behalf of permission" to the compromised user account. In the below screenshots, Bob Jones will be able to send emails on behalf of Alex Wilber.
This will allow you to create a case and search with coniditions through Exchange, Yammer, Teams, SharePoint, OneDrive, etc. Useful for pilfering for credentials or reading contents of emails.
Create a search in eDiscovery and export results.
Detect
What logs are available?
Primary:
UAL
Azure Audit Logs
Sign-Ins
Azure Activity Logs
Message Tracing Logs
Secondary:
Azure AD Provisioning Logs
Azure Resource Logs (needs to be enabled).
Diagnostic Logs
Security Reports
Log Retention:
Log Source
Azure AD Free
Azure AD P1
Azure AD P2
Audit Logs
7 Days
30 Days
30 Days
Sign In Logs
7 Days
30 Days
30 Days
Unified Audit Logs
30 Days
Up to 1 year depending on retention policy
Up to 1 year depending on retention policy
Best to push these logs into SIEM, Sentinel, or external account to keep evidence.
Emails Accessed
UAL Operations:
MailItemsAccessed: Messages read or accessed (only logged for e5 licenses).
FileAccessed: User accesses file on sharepoint or onedrive.
Find MailItemsAccessed log and input it in explorer or message trace to find specific email.
Check path to see the directory of the message
Ediscovery
UAL Operations:
SearchStarted/SearchCreated: Content search was started
Admin must give permission to user for them to use eDiscovery.
Microsoft alerts on this activity.
Email Forwarding Rules
UAL Operations:
New-InboxRule - Inbox Rule Created
Set-InboxRule - User modified inbox rule using OWA
UpdateInboxRule - Inbox rule was modified, deleted, created by mailbox owner
Move - Message was moved to another folder
By default, forwarding rules are disabled by Microsoft's "scure by default" principles. Most companies have reenabled this.
Exchange Permission Abuse:
SendOnBehalf and accessing mailboxes require Admin privs.
UAL Operations:
Add-MailboxPermission - Admin assigned FullAccess mailbox permission to user allowing them to read/manage another inbox.
AddFolderPermission/UpdateFolderPermission - Allows user to access a folder and the message/mail within it.
SendAs - Message was sent using SendAs permission
SendOnBehalf - Message sent with SendOnBehalf permission
Message sent to nebula from AlexW (on behlaf of AlexW).
IDs at the end are object IDs for users. Malicious user was granted permissions to SendOnBehalf of another user. Trustee is able to send on behalf of Identity.
BEC Persistence:
Azure Audit Logs Operations:
Requires admin privs to all:
Add member to role - Added a user to an admin role in m365
Add member to group - Added a user to a group in Azure AD
Updated group - Updating property on a group
Add service principal credentials - Adding a secret to a service principal in Azure AD
Mitigate
Proactive Steps
Ensure MFA is enabled on all accounts, if an account is compromised reset the password and token.
Enforce strong password policy.
Forward all M365/Azure logs to a SIEM.
Block any mail forwarding to an external domain
Create alerting rules for permissions being granted to users/forwarding rules being created/new users being created.