← Back to SOC feed Coverage →

Anomaly of MailItemAccess by Other Users Mailbox [Nobelium]

kql MEDIUM Azure-Sentinel
CloudAppEvents
huntingmicrosoftofficial
This rule was pulled from an open-source repository and enriched with AI. Validate in a test environment before deploying to production.
View original rule at Azure-Sentinel →
Retrieved: 2026-05-07T11:00:00Z · Confidence: medium

Hunt Hypothesis

Users accessing multiple other users’ mailboxes or folders may indicate lateral movement or data exfiltration by an adversary, such as Nobelium, seeking to escalate privileges or extract sensitive information. SOC teams should proactively hunt for this behavior in Azure Sentinel to identify potential compromise and mitigate advanced persistent threats.

KQL Query

// Adjust this value to exclude historical activity as known good
let LookBack = 30d;
// Adjust this value to change hunting timeframe
let TimeFrame = 14d;
// Adjust this value to alter how many mailbox (other than their own) a user needs to access before being included in results
let UserThreshold = 1;
// Adjust this value to alter how many mailbox folders in other's email accounts a users needs to access before being included in results.
let FolderThreshold = 5;
let relevantMailItems = materialize (
    CloudAppEvents
    | where Timestamp > ago(LookBack)
    | where ActionType == "MailItemsAccessed"
    | where RawEventData['ResultStatus'] == "Succeeded"
    | extend UserId = tostring(RawEventData['UserId'])
    | extend MailboxOwnerUPN = tostring(RawEventData['MailboxOwnerUPN'])
    | where tolower(UserId) != tolower(MailboxOwnerUPN)
    | extend Folders = RawEventData['Folders']
    | where isnotempty(Folders)
    | mv-expand parse_json(Folders)
    | extend foldersPath = tostring(Folders.Path)  
    | where isnotempty(foldersPath)
    | extend ClientInfoString = RawEventData['ClientInfoString']
    | extend MailBoxGuid = RawEventData['MailboxGuid']
    | extend ClientIP = iif(IPAddress startswith "[", extract("\\[([^\\]]*)", 1, IPAddress), IPAddress)
    | project Timestamp, ClientIP, UserId, MailboxOwnerUPN, tostring(ClientInfoString), foldersPath, tostring(MailBoxGuid)    
);
let relevantMailItemsBaseLine = 
    relevantMailItems
    | where Timestamp between(ago(LookBack) ..  ago(TimeFrame))    
    | distinct MailboxOwnerUPN, UserId;
let relevantMailItemsHunting = 
    relevantMailItems
    | where Timestamp between(ago(TimeFrame) .. now())
    | distinct ClientIP, UserId, MailboxOwnerUPN, ClientInfoString, foldersPath, MailBoxGuid; 
relevantMailItemsBaseLine 
    | join kind=rightanti relevantMailItemsHunting
    on MailboxOwnerUPN, UserId
    | summarize FolderCount = dcount(tostring(foldersPath)),
                UserCount = dcount(MailBoxGuid),
                foldersPathSet = make_set(foldersPath),
                ClientInfoStringSet = make_set(ClientInfoString), 
                ClientIPSet = make_set(ClientIP),
                MailBoxGuidSet = make_set(MailBoxGuid),
                MailboxOwnerUPNSet = make_set(MailboxOwnerUPN)
            by UserId
    | where UserCount > UserThreshold or FolderCount > FolderThreshold
    | extend Reason = case( 
                            UserCount > UserThreshold and FolderCount > FolderThreshold, "Both User and Folder Threshold Exceeded",
                            FolderCount > FolderThreshold and UserCount < UserThreshold, "Folder Count Threshold Exceeded",
                            "User Threshold Exceeded"
                            )
    | sort by UserCount desc

Analytic Rule Definition

id: 6a927d9a-66c3-4491-815d-a31d4bbb2948
name: Anomaly of MailItemAccess by Other Users Mailbox [Nobelium]
description: |
  This query looks for users accessing multiple other users' mailboxes, or accessing multiple folders in another user's mailbox.
  This query is inspired by an Azure Sentinel detection.
  Reference - https://github.com/Azure/Azure-Sentinel/blob/master/Hunting%20Queries/OfficeActivity/AnomolousUserAccessingOtherUsersMailbox.yaml
requiredDataConnectors:
- connectorId: MicrosoftThreatProtection
  dataTypes:
  - CloudAppEvents
tactics:
- Collection
tags:
- Nobelium
query: |
  // Adjust this value to exclude historical activity as known good
  let LookBack = 30d;
  // Adjust this value to change hunting timeframe
  let TimeFrame = 14d;
  // Adjust this value to alter how many mailbox (other than their own) a user needs to access before being included in results
  let UserThreshold = 1;
  // Adjust this value to alter how many mailbox folders in other's email accounts a users needs to access before being included in results.
  let FolderThreshold = 5;
  let relevantMailItems = materialize (
      CloudAppEvents
      | where Timestamp > ago(LookBack)
      | where ActionType == "MailItemsAccessed"
      | where RawEventData['ResultStatus'] == "Succeeded"
      | extend UserId = tostring(RawEventData['UserId'])
      | extend MailboxOwnerUPN = tostring(RawEventData['MailboxOwnerUPN'])
      | where tolower(UserId) != tolower(MailboxOwnerUPN)
      | extend Folders = RawEventData['Folders']
      | where isnotempty(Folders)
      | mv-expand parse_json(Folders)
      | extend foldersPath = tostring(Folders.Path)  
      | where isnotempty(foldersPath)
      | extend ClientInfoString = RawEventData['ClientInfoString']
      | extend MailBoxGuid = RawEventData['MailboxGuid']
      | extend ClientIP = iif(IPAddress startswith "[", extract("\\[([^\\]]*)", 1, IPAddress), IPAddress)
      | project Timestamp, ClientIP, UserId, MailboxOwnerUPN, tostring(ClientInfoString), foldersPath, tostring(MailBoxGuid)    
  );
  let relevantMailItemsBaseLine = 
      relevantMailItems
      | where Timestamp between(ago(LookBack) ..  ago(TimeFrame))    
      | distinct MailboxOwnerUPN, UserId;
  let relevantMailItemsHunting = 
      relevantMailItems
      | where Timestamp between(ago(TimeFrame) .. now())
      | distinct ClientIP, UserId, MailboxOwnerUPN, ClientInfoString, foldersPath, MailBoxGuid; 
  relevantMailItemsBaseLine 
      | join kind=rightanti relevantMailItemsHunting
      on MailboxOwnerUPN, UserId
      | summarize FolderCount = dcount(tostring(foldersPath)),
                  UserCount = dcount(MailBoxGuid),
                  foldersPathSet = make_set(foldersPath),
                  ClientInfoStringSet = make_set(ClientInfoString), 
                  ClientIPSet = make_set(ClientIP),
                  MailBoxGuidSet = make_set(MailBoxGuid),
                  MailboxOwnerUPNSet = make_set(MailboxOwnerUPN)
              by UserId
      

Required Data Sources

Sentinel TableNotes
CloudAppEventsEnsure this data connector is enabled

MITRE ATT&CK Context

References

False Positive Guidance

Original source: https://github.com/Azure/Azure-Sentinel/blob/main/Hunting Queries/Microsoft 365 Defender/Collection/Anomaly of MailItemAccess by Other Users Mailbox [Nobelium].yaml