Microsoft Defender

Microsoft Defender Series · Part 2

Defender for Endpoint Deep Dive – Part 2 | Modern Workplace Security
Microsoft Defender Series · Part 2

Defender for Endpoint Deep Dive

Advanced ASR rules, Live Response for real-time incident work, and KQL hunting playbooks — built from what I’ve actually used in production.

Advanced ASR Live Response KQL Hunting MDE Defender for Endpoint Threat Hunting
By Anand · modernworkplacesecurity.com · 15+ min read · Series: Microsoft Defender Family

In Part 1 of this series I walked through the Microsoft Defender product ecosystem — what each product does, how the pieces fit together, and why the integrated stack matters more than any single tool. Part 2 is where things get hands-on.

I’m going to cover three areas that I’ve spent a lot of time with in production environments: Attack Surface Reduction (ASR) rules beyond the basic toggles, Live Response for real-time investigation and containment, and KQL hunting playbooks in the Defender portal. These aren’t theoretical — every example here comes from something I’ve actually run against a tenant or used during a real incident.

Let’s get into it.

1 — Advanced ASR: Beyond the Basic Toggles

Most guides tell you to enable ASR rules and move on. In practice, that’s where the headaches start. ASR rules touch real behaviour on endpoints — Office macros, LOB applications, PowerShell execution patterns, process injection — and if you push everything to Block without understanding the blast radius, you will break things. I’ve seen it happen more than once.

The approach I use is a proper audit-first, ring-based rollout. It’s not glamorous, but it’s the only way to avoid a 2am call from someone saying Outlook stopped launching.

The ASR Rules That Actually Matter

There are 16+ ASR rules, but in my experience these are the ones that carry the most defensive weight — and also the most compatibility risk if you enable them blind:

Rule Name GUID (short) My Default Mode Risk Level
Block Office macros from spawning child processes d4f940ab… Block High — breaks legacy macro-heavy workflows
Block credential stealing from LSASS 9e6c4e1f… Block Low — negligible app compat issues
Block process creations originating from PSExec and WMI d1e49aac… Audit Very high — breaks RMM tools and automation
Block JavaScript/VBScript from launching downloaded executables d3e037e1… Block Low
Block execution of potentially obfuscated scripts 5beb7efe… Audit Medium — legitimate PowerShell scripts can trigger this
Block Office applications from injecting code into other processes 75668c1f… Block Medium — some PDF plugins, dictation tools
Block abuse of exploited vulnerable signed drivers 56a863a9… Block Low
Block untrusted and unsigned processes from USB b2b3f03d… Warn Environment-dependent
Field Note
The PSExec/WMI rule (d1e49aac) is the one I’ve seen cause the most disruption in environments using any RMM tool — ConnectWise, N-able, even some SCCM configurations. Always run this in Audit mode first for at least 30 days and review the events in MDE before promoting to Block.

Deploying via Intune: The Ring Approach

I deploy ASR rules through Intune Endpoint Security policies, not Group Policy — it gives me per-device status, reporting, and the ability to assign to dynamic AAD groups for ring control. The deployment structure I use looks like this:

1
Ring 0 — IT / Security team devices (Audit everything) Deploy all rules in Audit mode. Let it run for 2 weeks and collect baseline events. This is your canary group.
2
Ring 1 — Pilot group (~50 users) Promote low-risk rules to Block based on Ring 0 findings. Keep high-risk rules in Audit. Wider event volume, real user workflows.
3
Ring 2 — Broad rollout (all managed endpoints) Promote remaining rules after reviewing Ring 1 events. Add per-rule exclusions only where genuinely needed — don’t blanket-exclude.

Reviewing ASR Events in MDE

You can see ASR events in the MDE portal under Reports > Attack Surface Reduction, but I find KQL in Advanced Hunting much more useful because I can filter by rule GUID, group by device or user, and identify patterns quickly. Here’s the query I use for an ASR audit review:

KQL — Advanced Hunting
// ASR audit events — last 30 days
DeviceEvents
| where Timestamp > ago(30d)
| where ActionType == "AsrOfficeChildProcessAudited"
     or ActionType startswith "Asr"
| summarize EventCount = count(),
            AffectedDevices = dcount(DeviceName),
            AffectedUsers = dcount(InitiatingProcessAccountName)
     by ActionType, InitiatingProcessFileName, InitiatingProcessFolderPath
| sort by EventCount desc

The output tells me which processes are triggering which rules, across how many devices, and who’s running them. If I see a legitimate LOB app hitting 40+ events a day, that’s a rule exclusion candidate. If I see something unexpected in an unusual path, that’s a hunt lead.

2 — Live Response: Real-Time Investigation and Containment

Live Response is one of MDE’s most powerful capabilities and also one of the most underused. It gives you a remote shell into any onboarded device — without needing RDP, VPN, or a third-party tool. During an incident, this is the difference between hours of back-and-forth and getting answers in minutes.

I’ve used Live Response to pull suspicious files for analysis, terminate malicious processes, drop remediation scripts, collect forensic artefacts, and contain a device while the user stays on a call with us. It’s become a standard part of my incident workflow.

Before You Enable This
Live Response needs to be explicitly enabled in MDE Settings → Advanced Features. You also need to enable Live Response for servers separately if you’re covering server endpoints. The capability requires appropriate permissions — I assign it through the MDE RBAC roles, not just Defender admin.

Commands I Actually Use

Live Response has a command set that’s a mix of file operations, process management, and script execution. Here are the ones that come up most in real incidents:

Live Response — File Collection
# Pull a suspicious file to the portal library for analysis
getfile "C:\Users\victim\AppData\Local\Temp\sus.exe"

# Check file hash on device before pulling
run Get-FileHash.ps1 -parameters "-Path 'C:\Temp\sus.exe'"

# List running processes — pipe to findstr for quick filter
processes

# Terminate a specific process by PID
remediate process 4812

# Collect prefetch files (useful for execution timeline)
getfile "C:\Windows\Prefetch\SUS.EXE-*.pf"
Live Response — Drop and Run Remediation Script
# Upload a script to the library first (MDE portal → Library)
# Then run it on the device:
run Remediate-PersistenceKeys.ps1

# With parameters:
run Collect-ForensicArtefacts.ps1 -parameters "-OutputPath 'C:\Temp\forensics'"

My Incident Workflow with Live Response

When I get an alert that warrants direct device access, this is the rough sequence I follow:

1
Don’t contain immediately Isolating the device kills the Live Response session. Gather what you need first — processes, network connections, suspicious files, registry run keys — then isolate if required.
2
Pull the process tree Run processes and cross-reference with the alert’s initiating process chain. Look for anything running from Temp, AppData, or a user-writable path.
3
Collect artefacts before touching anything Pull suspicious binaries with getfile, collect prefetch/event logs if relevant. These get submitted for sandbox analysis in the MDE portal.
4
Remediate, then isolate Drop remediation scripts for persistence cleanup. Terminate malicious processes. Then isolate the device if you need to prevent lateral movement.
5
Document everything in the incident MDE logs Live Response session activity, but I note the specific commands and findings in the incident comments for the post-incident report.
Tip
Build a script library in the MDE portal for common remediation tasks — clearing Temp folders, checking scheduled tasks, pulling event log exports. Having these pre-built means you’re not writing PowerShell under pressure during an incident.

3 — KQL Hunting Playbooks

Advanced Hunting in MDE (and Sentinel) runs on KQL — the Kusto Query Language. If you’re new to it, it looks intimidating. Once it clicks, you won’t want to go back to clicking through dashboards. KQL lets me ask specific questions of endpoint telemetry at scale: “which devices ran a PowerShell command that downloaded something in the last 7 days?” That’s a query, not a manual process.

Below are the playbook queries I reach for most often. These aren’t academic — they’ve all surfaced real findings at some point.

Playbook 1: PowerShell Download Cradle Detection

Malware loves PowerShell download cradles — IEX (New-Object Net.WebClient).DownloadString(), Invoke-WebRequest, curl wrappers, and so on. This query hunts for PowerShell processes with command lines containing download patterns:

KQL — PS Download Cradle Hunt
DeviceProcessEvents
| where Timestamp > ago(7d)
| where FileName in~ ("powershell.exe", "pwsh.exe")
| where ProcessCommandLine has_any (
    "DownloadString", "DownloadFile", "WebClient",
    "Invoke-WebRequest", "iwr ", "curl ", "wget ",
    "BitsTransfer", "Start-BitsTransfer"
)
| project Timestamp, DeviceName, AccountName,
          ProcessCommandLine, InitiatingProcessFileName,
          InitiatingProcessCommandLine
| sort by Timestamp desc

Playbook 2: LSASS Access Attempts

Credential dumping against LSASS is a staple of post-exploitation. Even with Credential Guard and ASR protecting LSASS, I hunt for access attempts as an early indicator — sometimes the attempt alone is worth an alert.

KQL — LSASS Access Hunt
DeviceEvents
| where Timestamp > ago(7d)
| where ActionType == "OpenProcessApiCall"
| where FileName == "lsass.exe"
| where InitiatingProcessFileName !in (
    "MsMpEng.exe", "svchost.exe", "csrss.exe",
    "wininit.exe", "lsm.exe", "services.exe"
)
| project Timestamp, DeviceName, InitiatingProcessFileName,
          InitiatingProcessCommandLine, InitiatingProcessFolderPath,
          AccountName
| sort by Timestamp desc
Field Note
The whitelist in the !in clause above is a starting point. In your environment you may see legitimate processes like AV engines, EDR agents, or backup tools accessing LSASS. Tune the exclusion list during your first week of running this query before turning it into a scheduled detection.

Playbook 3: Lateral Movement via PsExec / SMB

PsExec-style lateral movement leaves a recognisable pattern in network and process events. This query joins network connections to process events to surface the combination of remote execution and SMB connectivity:

KQL — Lateral Movement Hunt
// Devices making remote service/process creation over SMB
let SuspiciousProcs = DeviceProcessEvents
| where Timestamp > ago(1d)
| where InitiatingProcessFileName in~ (
    "psexec.exe", "psexec64.exe", "paexec.exe"
)
| project DeviceName, AccountName, ProcessCommandLine, Timestamp;
let SMBConns = DeviceNetworkEvents
| where Timestamp > ago(1d)
| where RemotePort == 445
| project DeviceName, RemoteIP, RemoteUrl, Timestamp;
SuspiciousProcs
| join kind=inner SMBConns on DeviceName
| where abs(Timestamp - Timestamp1) < 5m
| project DeviceName, AccountName, ProcessCommandLine,
          RemoteIP, RemoteUrl, Timestamp
| sort by Timestamp desc

Playbook 4: Persistence via Scheduled Tasks

Scheduled task creation is a classic persistence mechanism. Attackers love it because it survives reboots and is easy to blend into legitimate noise. This query surfaces new scheduled task creations along with the command they execute — the payload is almost always in the task action:

KQL — Scheduled Task Persistence Hunt
DeviceEvents
| where Timestamp > ago(7d)
| where ActionType == "ScheduledTaskCreated"
| extend TaskDetails = parse_json(AdditionalFields)
| extend TaskName    = tostring(TaskDetails.TaskName),
         TaskContent  = tostring(TaskDetails.TaskContent)
| where TaskContent has_any (
    "powershell", "cmd.exe", "wscript",
    "cscript", "mshta", "regsvr32", "rundll32"
)
| project Timestamp, DeviceName, AccountName,
          TaskName, TaskContent, InitiatingProcessFileName
| sort by Timestamp desc

Turning Playbooks into Custom Detections

Any query in Advanced Hunting can be promoted to a Custom Detection rule — MDE will run it on a schedule and generate alerts automatically. I do this for the high-signal queries once I’ve tuned out the false positives. Go to the query in Advanced Hunting, click Create detection rule, set the frequency (I usually start at 24h for noisy queries, 1h for high-confidence ones), and map the alert entity to a device or user.

The scheduled task persistence query above is one I have running as a custom detection in every tenant I manage. It’s generated real findings — not just in red team exercises.

16+
ASR rules available in MDE
~30
Days recommended for ASR audit phase
4
Core KQL playbooks in this post

Wrapping Up

ASR, Live Response, and KQL hunting aren’t separate features — they’re part of a continuous loop. ASR generates events that you hunt with KQL. KQL surfaces indicators that you investigate with Live Response. Live Response findings inform ASR exclusions and custom detection rules. Once you build that loop into your workflow, Defender for Endpoint stops feeling like a compliance checkbox and starts functioning like a genuine investigation platform.

In Part 3 I’ll be covering Defender for Identity — lateral movement detection, attack paths in Entra, and how the identity-layer telemetry slots into the incidents you’re already seeing in MDE.

If anything in this post maps to something you’ve hit in your environment, or if you have a KQL query you’d add to the playbook list, drop it in the comments — I always read them.

Microsoft Defender Family Series

  • Part 1 The Microsoft Defender Product Ecosystem — What It Is and How It All Fits Together
  • Part 2 Defender for Endpoint Deep Dive — Advanced ASR, Live Response & KQL Hunting
  • Part 3 Defender for Identity — Lateral Movement Detection & Attack Paths
  • Part 4 Defender for Office 365 — Safe Links, Safe Attachments & Attack Simulation
  • Part 5 Defender for Cloud Apps — CASB, Shadow IT & Session Controls
  • Part 6 Defender for Cloud — CSPM, CWPP & Workload Protection
  • Part 7 Defender XDR — Unified Incidents, Auto-Remediation & Threat Intelligence
I
Written by
itanand21
Microsoft Security Consultant and IT EUC Engineer with 15+ years helping organisations modernise endpoint management and lock down Microsoft 365 using Zero Trust principles.

Leave a Comment

Your email address will not be published. Required fields are marked *