Lateral Movement Path Detection

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 13 read · keep scrolling

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

Lesson: Detecting and Mitigating Lateral Movement Paths with Microsoft Defender for Identity

Introduction: The Anatomy of a Breach

In the modern cybersecurity landscape, the perimeter-based defense model—the idea that you can keep attackers out by simply building a strong firewall—is effectively dead. Sophisticated attackers rarely breach an organization and immediately gain access to the crown jewels. Instead, they gain an initial foothold, often through a low-privilege user account or a compromised workstation, and then move laterally across the network to escalate their privileges. This process of moving from a compromised host to a high-value target is known as "lateral movement."

Lateral movement is the stage of a cyberattack where the intruder seeks to discover, access, and control additional systems, applications, and data within your environment. By hopping from machine to machine, attackers aim to reach the Domain Controller, the identity store, or the cloud infrastructure management plane. Once they reach these targets, they can compromise the entire organization, exfiltrate sensitive data, or deploy ransomware.

Microsoft Defender for Identity (MDI) is a cloud-based security solution that leverages your on-premises Active Directory signals to identify, detect, and investigate advanced threats. One of its most powerful capabilities is the identification of "Lateral Movement Paths" (LMPs). An LMP is a graphical representation of the vulnerabilities and relationships in your network that an attacker could exploit to move from a compromised entity to a sensitive one. Understanding and mitigating these paths is critical because it allows security teams to proactively close gaps before an attacker ever arrives.


Not read yet

Understanding Lateral Movement Paths

To effectively defend against lateral movement, you must first understand how attackers think. They look for "chains of trust." If a user is logged into a computer, that computer has a token for that user. If an attacker gains local administrator rights on that computer, they can harvest that token or credentials from memory using tools like Mimikatz. With those credentials, they can then authenticate to other servers or services where that user has access.

Microsoft Defender for Identity maps these relationships continuously. It looks at:

  1. Account Logons: Who is logging into which machines?
  2. Administrative Rights: Who has local admin rights on which servers?
  3. Session Information: Where are active sessions currently residing?
  4. Group Memberships: Who belongs to privileged groups like "Domain Admins" or "Server Operators"?

When MDI sees a pattern where a non-sensitive account has an active session on a machine, and that machine is also accessible by a high-privilege account, it creates a potential path. If an attacker compromises the non-sensitive account, they can use the machine as a pivot point to compromise the high-privilege account.

Callout: Lateral Movement vs. Privilege Escalation While these terms are often used together, they are distinct. Privilege escalation is the act of gaining higher permissions on a single system (e.g., going from a standard user to a local administrator on a workstation). Lateral movement is the act of moving from one system to another across the network. In an LMP scenario, an attacker usually performs privilege escalation on the local host first, which then facilitates the lateral movement to the next target.

Why Visualizing Paths Matters

Most organizations have thousands of users and machines. It is impossible for a human administrator to manually audit every single permission and session to determine if a path exists. Defender for Identity automates this by providing a visual graph. You can click on a user, and the console will show you every machine that user has logged into in the last 30 days. If any of those machines are also accessed by a Domain Admin, you have a direct lateral movement path to a domain controller.


Not read yet

Navigating the Microsoft Defender for Identity Portal

To begin mitigating these threats, you must first locate the information within the Microsoft Defender portal. The interface is designed to help you move from a broad overview of your identity security posture to specific, actionable tasks.

Step-by-Step: Accessing Lateral Movement Information

  1. Log in to the Microsoft Defender portal.
  2. In the left-hand navigation pane, locate the Identities section.
  3. Click on Entities to view a list of all users, computers, and groups currently tracked by Defender for Identity.
  4. Select a user or a computer. This will open the Entity Profile Page.
  5. If the entity is part of an identified lateral movement path, you will see a tab labeled Lateral movement paths.

When you click this tab, you will see a graphical representation. The graph shows the compromised entity on the left and the sensitive target on the right. The nodes in between represent the machines or accounts that bridge the gap.

Note: The "Lateral movement paths" tab only appears if Defender for Identity has detected a path. If a user is highly secure and has no links to sensitive accounts, the tab will not be visible for that specific entity.


Not read yet

Practical Scenarios of Lateral Movement

To understand how to mitigate these paths, let's walk through two common real-world scenarios.

Scenario A: The "Shared Admin" Problem

In many organizations, IT staff use the same "Domain Admin" account to log into workstations to perform maintenance. An attacker compromises a workstation where a Domain Admin has left a cached credential or an active session.

  • The Path: Attacker -> Compromised Workstation -> Domain Admin Credential -> Domain Controller.
  • The Mitigation: Implement the "Tiered Administration Model." Ensure that Domain Admin accounts are never used to log into standard workstations. Use "Privileged Access Workstations" (PAWs) for administrative tasks, and restrict Domain Admin logins to only the most secure, hardened machines.

Scenario B: Over-privileged Service Accounts

A service account is used to run a backup application. This account is a member of the "Backup Operators" group on dozens of servers. An attacker compromises a low-security server where the backup service account is running and uses that access to pivot to the backup server itself.

  • The Path: Attacker -> Server A (with Service Account) -> Service Account Token -> Backup Server.
  • The Mitigation: Implement "Group Managed Service Accounts" (gMSAs). gMSAs provide automatic password management and prevent the service account from being used for interactive logins. Furthermore, apply the principle of least privilege: only grant the backup account the specific permissions it needs, rather than making it a member of a broad administrative group.

Not read yet

Best Practices for Remediation

Mitigation is not a one-time event; it is a continuous hardening process. Follow these industry-standard practices to reduce your attack surface.

1. Enforce Tiered Administration

Adopt a model where administrative accounts have restricted scopes.

  • Tier 0: Domain Controllers and identity management systems. Only accessible by Tier 0 admins.
  • Tier 1: Servers and applications. Accessible by Tier 1 admins.
  • Tier 2: Workstations and end-user devices. Accessible by Tier 2 admins or standard users.
  • Rule: Never allow a higher-tier account to log into a lower-tier device.

2. Monitor and Clean Up Local Admin Groups

Attackers rely on local administrator access to dump memory (LSASS) and steal credentials. Use Group Policy Objects (GPOs) or Microsoft Intune to strictly control who is in the local Administrators group on your machines. Use the "Restricted Groups" or "Group Policy Preferences" features to ensure that unauthorized local accounts are removed automatically if they are added.

3. Use Credential Guard

Windows Defender Credential Guard uses virtualization-based security to isolate secrets so that only privileged system software can access them. This prevents tools like Mimikatz from reading credentials from the memory of the LSASS process. Enabling this on all workstations is one of the most effective ways to break the "credential theft" link in a lateral movement path.

4. Implement Just-In-Time (JIT) Access

Instead of giving users permanent administrative rights, use tools like Microsoft Entra Privileged Identity Management (PIM). Users request access for a limited time, and the access is automatically revoked afterward. If an attacker compromises a user account that doesn't have permanent admin rights, the lateral movement path is blocked.


Not read yet

Common Pitfalls and How to Avoid Them

Even with the best tools, organizations often stumble during the remediation process. Here are the most common mistakes:

Mistake 1: Ignoring "Service Account" Alerts

Many administrators see an alert for a service account and assume it is a "false positive" because the account is "supposed to be there." While it is true that the account is legitimate, the path it creates might be unnecessary.

  • How to avoid: Always investigate the permissions of the service account. If it has local admin rights, ask why. Often, the answer is "we just added it to the admin group to make it work." This is a security failure. Use granular permissions instead.

Mistake 2: Focusing Only on the "End" of the Path

Some teams focus only on protecting the Domain Controller. While that is the ultimate prize, the lateral movement path starts at the user's workstation.

  • How to avoid: Hardening the workstation environment is just as important as hardening the server environment. If the workstations are insecure, the path to the server will always exist.

Mistake 3: Failing to Audit Regularly

An environment changes daily. New software is installed, new service accounts are created, and users move between departments. A path that was clean yesterday might be dangerous today.

  • How to avoid: Set a recurring schedule—monthly or quarterly—to review the Defender for Identity dashboard. Look for new "red lines" appearing in your graph and address them immediately.

Not read yet

Technical Deep Dive: Using PowerShell for Remediation

While the Defender portal is excellent for visualization, PowerShell is your best tool for remediation at scale. For example, if you identify that a specific user has local administrator rights on hundreds of machines, you can use PowerShell to audit and remove those rights.

Example: Identifying Local Administrators

You can use the Get-LocalGroupMember cmdlet to audit local admin groups, but this must be run on each machine. To do this across the network, you would typically use a script that iterates through your computer list.

# Example: Checking local administrators on a remote machine
$ComputerName = "Workstation01"
Invoke-Command -ComputerName $ComputerName -ScriptBlock {
    Get-LocalGroupMember -Group "Administrators" | Select-Object Name, PrincipalSource
}

Explanation:

  • Invoke-Command: This allows you to run the script on a remote target.
  • Get-LocalGroupMember: This retrieves the list of members of the specified group.
  • Select-Object: This filters the output to show the account name and where the account comes from (e.g., local or domain).

Warning: Running scripts across your entire fleet can be resource-intensive. Always test your scripts on a small subset of machines (a pilot group) before deploying them to production.


Not read yet

Comparison: Traditional Auditing vs. Defender for Identity

Feature Traditional Auditing (Manual) Defender for Identity
Visibility Siloed (logs, GPOs, user lists) Unified, graphical view
Speed Slow, reactive Real-time, proactive
Context Requires manual correlation Provides identity-based context
Accuracy High risk of human error Automates discovery of relationships
Scope Often limited to domain objects Includes workstations, servers, and cloud

Callout Boxes: Strategic Insights

Callout: The "Sensitive" Label In Defender for Identity, you can mark specific accounts or groups as "Sensitive." This is a manual process, but it is vital. By default, MDI marks standard groups like "Domain Admins" as sensitive. However, you should also manually tag your CEO’s account, your HR directors, and your payroll service accounts as sensitive. Once tagged, any lateral movement path leading to these entities will be highlighted with higher priority in the portal.

Callout: Why Lateral Movement is Difficult to Detect Most traditional security tools focus on "inbound" traffic (e.g., firewall logs). Lateral movement, however, often stays entirely within the internal network. Because the traffic is "east-west" (server to server) rather than "north-south" (internet to internal), it rarely passes through a security gateway. Defender for Identity is unique because it monitors the identity layer, which is the common thread in all lateral movement, regardless of which network protocols are used.


Not read yet

Frequently Asked Questions (FAQ)

Q: If I see a lateral movement path, does it mean I am currently being hacked? A: Not necessarily. An LMP identifies a vulnerability, not an active exploit. It shows you the path an attacker could take. However, you should treat it as a high-priority task because you are essentially leaving the front door unlocked.

Q: How often does Microsoft Defender for Identity update the path graph? A: Defender for Identity processes data continuously. As new logon events are captured by your sensors, the map is updated. Generally, you will see changes reflected in the dashboard within a few hours of the activity occurring.

Q: Can I remove a path by just deleting the user? A: No. While removing the user would remove the path, it is rarely the correct solution. The goal is to keep the user productive while removing the privilege that creates the path. Use the principle of least privilege to modify group memberships instead.

Q: Does Defender for Identity block the movement automatically? A: Defender for Identity is primarily a detection and investigation tool. It will alert you to the path, but it does not automatically change your GPOs or local admin groups. You must take the action to remediate the underlying configuration issue.


Not read yet

Best Practices Checklist for Security Teams

To ensure your environment remains resilient, follow this checklist when addressing lateral movement paths:

  • Identify: Review the "Lateral movement paths" tab in the Defender portal weekly.
  • Prioritize: Focus on paths that lead to Tier 0 assets (Domain Controllers) first.
  • Standardize: Ensure that administrative accounts are excluded from local admin groups on workstations.
  • Harden: Enable Credential Guard on all Windows 10/11 machines to prevent memory-based credential theft.
  • Verify: After making a change, check the portal again after 24 hours to ensure the path has disappeared from the graph.
  • Document: If you must have a specific path for business reasons, document the exception and review it quarterly.

Detailed Technical Analysis: The Role of Sensors

The efficacy of Defender for Identity relies on the "Sensors" you install. These sensors are lightweight agents that sit on your Domain Controllers (or AD FS/AD CS servers). They read the traffic directly from the network wire, specifically looking for Kerberos, NTLM, and LDAP traffic.

When an attacker attempts to move laterally, they often use protocols like SMB or WMI. The sensor sees the authentication attempt and the associated ticket. It then correlates this with the source machine and the destination machine. If the destination machine is a sensitive target, the sensor flags the activity.

If you have gaps in your sensor coverage—for instance, if you have a Domain Controller that does not have a sensor installed—your lateral movement path map will be incomplete. You might see a path that starts at a workstation, but you won't be able to see where it goes once it hits that unmonitored Domain Controller. This is why it is critical to ensure that every domain controller in your forest has a healthy, up-to-date Defender for Identity sensor.

Monitoring Health

You can monitor the health of your sensors in the Defender portal under Settings > Identities > Sensors.

  • Status: Ensure all sensors are "Running."
  • Version: Keep sensors updated to the latest version to ensure you are capturing the latest threat patterns.
  • Traffic: If a sensor shows "0 traffic," it is likely misconfigured or blocked by a local firewall.

Not read yet

The Role of Group Policy in Mitigation

Group Policy is your primary mechanism for implementing the changes required to break lateral movement paths. Once you have identified a path, the remediation usually involves changing a GPO.

Example: Removing a User from Local Administrators

  1. Open Group Policy Management.
  2. Navigate to the GPO that applies to the workstations in question.
  3. Go to Computer Configuration > Preferences > Control Panel Settings > Local Users and Groups.
  4. Right-click, select New > Local Group.
  5. Select Administrators (Built-in).
  6. Add the specific groups or users that should be there, and ensure the action is set to Update.
  7. Crucially, ensure that you are not adding the user identified in the lateral movement path.

By using the "Update" action with the correct membership list, you force the workstation to match your desired state. If an attacker manually adds themselves to the local admin group, the next GPO refresh will automatically strip that access away.


Not read yet

Advanced Threat Hunting with Advanced Hunting

Beyond the visual graphs, you can use the Advanced Hunting section in the Defender portal to write Kusto Query Language (KQL) queries to find lateral movement activity. This is for more advanced investigations where you want to look for specific "signals" rather than just the "paths."

Example KQL Query: Detecting Potential Lateral Movement

IdentityLogonEvents
| where LogonType == "Network"
| where DeviceName != DestinationDeviceName
| summarize count() by AccountName, DeviceName, DestinationDeviceName
| where count_ > 5

Explanation:

  • IdentityLogonEvents: This table contains all logon activity.
  • LogonType == "Network": We are looking for network logons, which are frequently used for lateral movement.
  • DeviceName != DestinationDeviceName: We are looking for movement between different machines.
  • summarize count() by...: We are looking for accounts that connect to many different devices, which is a common sign of a "living off the land" attacker.

This type of query allows you to find "noisy" accounts that might be creating dozens of potential lateral movement paths across your environment.


Not read yet

Key Takeaways for Success

  1. Lateral movement is the bridge to total compromise: Stopping lateral movement is the most effective way to prevent a minor security incident from becoming a catastrophic data breach.
  2. Visualization is your greatest asset: Use the Microsoft Defender for Identity portal to see the "chains of trust" that exist in your network. You cannot fix what you cannot see.
  3. Tiered Administration is the gold standard: By strictly separating administrative duties based on the sensitivity of the resource, you break the most common lateral movement paths used by attackers.
  4. Least Privilege is not optional: Service accounts and user accounts should only have the minimum permissions required for their tasks. Over-privileged accounts are the primary vehicles for lateral movement.
  5. Automation and GPOs are your enforcement tools: Do not rely on manual configuration. Use Group Policy or configuration management tools to ensure that your security posture is enforced consistently across all machines.
  6. Continuous Monitoring is required: The threat landscape changes as your environment grows. Review your lateral movement paths regularly to ensure new vulnerabilities are not introduced as you add new users, servers, and services.
  7. Sensors are the eyes of your defense: Ensure that every domain controller is monitored by a healthy, updated Defender for Identity sensor to maintain full visibility across your identity infrastructure.

By following these principles and utilizing the tools provided within Microsoft Defender XDR, you transition from a reactive security posture to a proactive, hardened defense. The goal is to make the cost of movement for an attacker so high—and the probability of detection so certain—that they move on to an easier target.

Not read yet

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