Investigating Email and Collaboration Threats

Earn 25 points (50 with Pro) in two steps

  1. ① Read through the lesson — each section gets a ✓ as you scroll through it.
  2. ② When every section has a ✓, tap Complete lesson.

0 of 9 read · keep scrolling

✦ See fewer ads and earn double points — 50 a lesson instead of 25 — with Pro

Investigating Email and Collaboration Threats in Microsoft Defender XDR

Introduction: The Changing Landscape of Digital Communication Security

In the modern workplace, email and collaboration platforms like Microsoft Teams, SharePoint, and OneDrive serve as the primary nervous system for organizational communication. Because these platforms contain the most sensitive intellectual property, financial data, and personal information, they have become the primary targets for attackers. Threat actors no longer rely solely on simple malware attachments; they employ sophisticated social engineering, business email compromise (BEC), and supply chain attacks that exploit the trust inherent in collaborative environments.

Investigating these threats is a critical competency for security operations center (SOC) analysts and system administrators. Microsoft Defender XDR provides an integrated platform that brings together signals from across the Microsoft 365 ecosystem. By learning how to investigate email and collaboration threats within this environment, you move from a reactive posture—where you are simply cleaning up after an incident—to a proactive, investigative stance where you can identify root causes, scope the blast radius, and prevent future occurrences.

This lesson explores the mechanics of investigating threats within Microsoft Defender XDR. We will cover the tools available for hunting, the methodology for analyzing suspicious emails, the process of investigating collaboration-based threats in Teams and SharePoint, and the best practices for remediation.


Not read yet

The Anatomy of an Email-Based Threat

Before diving into the tools, it is essential to understand what we are looking for. Email threats have evolved significantly over the last decade. While "spray and pray" spam still exists, the threats that cause the most damage are highly targeted.

Common Threat Vectors

  • Business Email Compromise (BEC): This involves an attacker impersonating an executive or a trusted vendor to request fraudulent payments or sensitive data. Because these emails often contain no malicious links or attachments, they are difficult for traditional signature-based filters to catch.
  • Credential Phishing: Attackers send emails that appear to be from legitimate services (e.g., "Your password has expired" or "View this shared document") to lure users to fake login pages.
  • Malicious Attachments: These range from macro-enabled Office documents to sophisticated LNK files or ISO images designed to bypass standard gateway scanning.
  • Supply Chain Compromise: An attacker compromises a legitimate partner’s account and uses that trusted relationship to send malicious files or links to your employees.

Callout: The Difference Between Malware and Phishing Malware focuses on technical exploitation, such as installing a keylogger or ransomware on a host machine. Phishing, by contrast, focuses on psychological exploitation, tricking the user into revealing credentials or performing a harmful action voluntarily. Investigating malware requires looking at file hashes and process trees, while investigating phishing requires analyzing headers, URL reputations, and user behavior.


Not read yet

Using Explorer for Threat Investigation

Microsoft Defender for Office 365 includes a powerful tool called Threat Explorer. This is your primary dashboard for investigating email-based threats. Explorer allows you to view, filter, and analyze threats in real-time.

Navigating the Explorer Interface

When you open Threat Explorer, you are presented with a view that categorizes threats by type: Malware, Phishing, or All Email.

  1. View Selection: Start by choosing the appropriate view. If you are investigating a reported phishing campaign, select "Phishing." If you are investigating a series of alerts related to malicious attachments, select "Malware."
  2. Filtering: You can filter by date range, sender, recipient, subject, or delivery location. For instance, if a user reports a suspicious email, you can search for the specific sender address to see if other users in the organization received the same message.
  3. The "Email Details" Pane: When you click on a specific email, the details pane provides a wealth of information. You can see the delivery status (e.g., Delivered, Blocked, or Junked), the policy that determined that status, and the "Threats" tab, which explains why the system flagged the item.

Step-by-Step Investigation Workflow

  1. Identify the Scope: Check if the message was delivered to one person or many. If multiple people received it, you are looking at a campaign.
  2. Analyze the Headers: Review the message headers to identify the source IP address and the path the email took through the internet. Look for discrepancies in the "Return-Path" and "From" addresses, which often indicate spoofing.
  3. Inspect the URL/Attachment: If the email contains a URL, do not click it. Instead, use the "URL protection" report in Explorer to see if Defender has already analyzed the site. If it is an attachment, use the "File" tab to see if the file hash matches known malicious patterns.
  4. Check Delivery Location: See if the email was delivered to the Inbox, the Junk folder, or if it was quarantined. If it reached the Inbox, you need to initiate a search and purge action immediately.

Not read yet

Investigating Collaboration Threats (Teams, SharePoint, OneDrive)

Threats do not stay in the inbox. Attackers frequently move to collaboration platforms to exploit the fact that users are generally more trusting of files shared within Teams or SharePoint.

Understanding the Collaboration Attack Path

An attacker might compromise a user's account and then use that access to upload a malicious file to a shared SharePoint site. They then share a link to that file in a Teams chat. Because the link comes from a trusted internal source, the recipient is far more likely to open it.

Investigation Steps for Collaboration

  1. Audit Logs: Use the Unified Audit Log (UAL) to search for suspicious activities. Look for unusual file downloads, large-scale file deletions, or the creation of new sharing links.
  2. Defender for Cloud Apps: If you have the appropriate licensing, use Microsoft Defender for Cloud Apps to investigate file-sharing patterns. You can look for "impossible travel" scenarios or mass file access that deviates from a user's typical behavior.
  3. Teams Message Analysis: If a malicious link was shared in Teams, you need to identify all members of that chat. You may need to perform a "Search and Purge" on the Teams messages to prevent other users from clicking the link.

Note: When investigating collaboration threats, always check the "Sharing" settings. Often, attackers will modify the sharing permissions on a sensitive file to make it public or share it with an external guest account they control.


Not read yet

Advanced Hunting with KQL (Kusto Query Language)

While the GUI-based Explorer is excellent for quick tasks, advanced investigations require the use of KQL. This allows you to perform complex cross-platform queries that the standard interface cannot handle.

The Power of KQL

KQL allows you to join tables, aggregate data, and perform statistical analysis on logs. For example, you can join EmailEvents with EmailAttachmentInfo to find all users who received a specific malicious file.

Example Query: Finding Users Who Clicked a Specific URL

If you have identified a malicious URL, you can use the following query to determine if anyone in your organization interacted with it:

EmailUrlInfo
| where UrlDomain == "malicious-site.com"
| join kind=inner EmailClickEvents on NetworkMessageId
| project Timestamp, RecipientEmailAddress, Url, ActionType

Explanation of the code:

  • EmailUrlInfo: This table contains information about the URLs found in emails.
  • where UrlDomain == "...": This filters the results to the specific domain you are investigating.
  • join kind=inner EmailClickEvents: This joins the URL data with the actual click events. We use NetworkMessageId as the common key because every email has a unique identifier.
  • project: This selects only the columns we need to see for our investigation.

Example Query: Identifying Potential BEC Activity

BEC attacks often involve "mismatched" sender domains or unusual login locations. You can use the following to look for suspicious sign-ins associated with email activity:

let SuspiciousUsers = OfficeActivity
| where Operation == "MailItemsAccessed"
| summarize count() by UserId
| where count_ > 50;
SigninLogs
| where UserPrincipalName in (SuspiciousUsers)
| where ResultType != 0
| project TimeGenerated, UserPrincipalName, IPAddress, AppDisplayName

Explanation of the code:

  • This query first identifies users who accessed an unusually high number of mail items (a common sign of an account takeover).
  • It then takes that list of users and checks the SigninLogs to see if those users had failed login attempts or logged in from suspicious IP addresses.

Not read yet

Best Practices for Threat Investigation

To be effective, your investigation process must be structured and repeatable. Here are the industry-standard best practices for managing email and collaboration threats.

1. Establish a Standardized Triage Process

Every alert should be treated with a consistent methodology. Do not jump straight to "Delete" or "Block." Start by gathering context: Who is the sender? Who is the target? Has this user been targeted before? By following a checklist, you ensure that you don't miss critical indicators of compromise (IOCs).

2. Use Automated Response Capabilities

Microsoft Defender for Office 365 includes automated investigation and response (AIR) playbooks. When an alert triggers, the system can automatically investigate the threat, look for similar emails, and suggest remediation actions. Always review these suggestions, but leverage them to save time.

3. Maintain an IOC Library

Keep a running list of malicious domains, file hashes, and sender IP addresses that have targeted your organization. You can feed this information into your custom detection rules within Defender. If an attacker tries to use the same infrastructure again, your rules will flag it immediately.

4. Continuous User Education

Investigation is only one half of the battle; the other half is prevention. Use the data you gather during investigations to create targeted training for your users. If you see a rise in "invoice-themed" phishing, conduct a simulated phishing exercise specifically focusing on that theme.

5. Review Sharing Policies

Collaboration threats often stem from overly permissive sharing settings. Regularly audit your SharePoint and OneDrive sharing links. Ensure that "Everyone" links are disabled and that external sharing is restricted to specific, verified domains whenever possible.


Not read yet

Common Pitfalls and How to Avoid Them

Even experienced analysts can fall into traps when investigating threats. Being aware of these pitfalls will help you maintain a high level of security.

Pitfall 1: Focusing Only on the "Bad" File

Many analysts find a malicious file, delete the email, and mark the ticket as "Resolved." However, they fail to look at the intent. Did the user download the file? Did it execute? You must check the DeviceFileEvents table to see if the file actually ran on a machine. If it did, the investigation must escalate from an "email incident" to a "host compromise incident."

Pitfall 2: Ignoring the "Long Tail" of an Attack

Attackers often send emails in waves to avoid detection. If you find one malicious email, don't assume it was a one-off event. Search for the sender's domain, the subject line, or the attachment name across the last 30 days to see if the attack has been ongoing.

Pitfall 3: Failing to Verify Permissions

During an investigation, you might need to access a user's mailbox to inspect a message. Always ensure you have the proper authorization and that your actions are logged. Unauthorized access, even during an investigation, can lead to compliance violations.

Pitfall 4: Over-blocking

When you identify a malicious sender, the instinct is to block the entire domain. However, if that domain is a large, shared provider (like Gmail or a major SaaS platform), you might accidentally block legitimate business communication. Always verify the reputation of the domain before applying a global block.

Warning: Be extremely cautious when using "Search and Purge" commands. If you accidentally target the wrong criteria, you could end up deleting legitimate, critical business emails across the entire organization. Always test your search query first to see how many messages it returns before executing the purge.


Not read yet

Comparison: Manual vs. Automated Investigation

Feature Manual Investigation Automated Investigation (AIR)
Speed Slow; requires human input Fast; occurs in seconds/minutes
Accuracy High (if analyst is expert) Consistent; reduces human error
Scope Limited to what the analyst checks Broad; checks all mailboxes/nodes
Context Excellent for nuanced social engineering Good for known patterns/IOCs
Effort High; manual labor required Low; requires review only

Summary of Key Takeaways

  1. Context is King: Never look at an email in isolation. Always consider the sender, the target, the headers, and the behavior of the user. Use the Threat Explorer to build a holistic view of the attack.
  2. Cross-Platform Awareness: Understand that threats move seamlessly between email, Teams, and SharePoint. An investigation is not complete until you have checked all relevant collaboration surfaces.
  3. KQL is Your Force Multiplier: While the interface is helpful, learning KQL allows you to perform deep, meaningful hunts that reveal the true scope of an attack. Always look for ways to automate your common query patterns.
  4. Prioritize Remediation: Once a threat is confirmed, move quickly to limit the blast radius. Use the "Search and Purge" functionality to remove malicious content from user inboxes before more people interact with it.
  5. Learn from the Data: Every investigation should feed back into your security posture. Use the lessons learned to update your detection rules, refine your blocking policies, and educate your users.
  6. Don't Forget the Endpoint: An email threat is often just the entry point. Always verify if the threat successfully compromised an endpoint by cross-referencing email data with device logs.
  7. Maintain Ethical Standards: Always ensure that your investigations are performed within the legal and ethical guidelines of your organization. Transparency and proper logging of your own actions are vital for compliance.

By mastering these investigative techniques, you provide a critical layer of defense for your organization. Security is not a static state, but a continuous process of learning, adapting, and responding to the threats that emerge in our digital collaborative spaces. Use the tools provided in Microsoft Defender XDR to stay ahead of attackers and ensure that your organization remains a secure place to do business.


Not read yet

Frequently Asked Questions (FAQ)

Q: How long should I keep logs for investigation? A: Microsoft 365 generally keeps audit logs for 90 days by default. For compliance and advanced threat hunting, it is highly recommended to export these logs to a workspace like Azure Sentinel (Microsoft Sentinel), where they can be retained for longer periods (e.g., 1–2 years).

Q: What should I do if I find a false positive? A: If a legitimate email was blocked, report it to Microsoft through the "Report as clean" feature in the submission portal. This helps train the machine learning models to prevent similar false positives in the future.

Q: Is it safe to open a suspicious email in a virtual machine? A: While it is safer than opening it on your primary machine, it is still risky. Modern malware can detect if it is running in a virtual environment and may behave differently or attempt to escape the VM. It is always better to use the sandboxing tools provided within Defender to analyze attachments safely.

Q: Can I automate the response to all phishing emails? A: While you can automate the response to high-confidence threats, you should always keep a human-in-the-loop for lower-confidence alerts. Over-automation can lead to unintended consequences, such as blocking critical business processes.

Q: Where can I see if a user has been compromised after clicking a link? A: Check the "User Entities" page in the Defender portal. It provides a risk score for every user based on their activities. If a user's risk score spikes, it is a strong indicator that their account has been compromised.

Not read yet

Each section gets a ✓ as you scroll through it. Tap the button to jump to the next one.