← Back to SOC feed Coverage →

PowerShell downloads

kql MEDIUM Azure-Sentinel
DeviceProcessEvents
huntingmicrosoftofficialpowershell
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-20T11:00:00Z · Confidence: medium

Hunt Hypothesis

Unusual PowerShell execution events that involve downloading files may indicate an adversary attempting to exfiltrate data or deploy malicious payloads. SOC teams should proactively hunt for this behavior in Azure Sentinel to identify potential compromise early and prevent lateral movement or data theft.

KQL Query

DeviceProcessEvents
| where Timestamp > ago(7d)
| where FileName in~ ("powershell.exe", "powershell_ise.exe")
| where ProcessCommandLine has "Net.WebClient"
   or ProcessCommandLine has "DownloadFile"
   or ProcessCommandLine has "Invoke-WebRequest"
   or ProcessCommandLine has "Invoke-Shellcode"
   or ProcessCommandLine has "http"
   or ProcessCommandLine has "IEX"
   or ProcessCommandLine has "Start-BitsTransfer"
   or ProcessCommandLine has "mpcmdrun.exe"
| project Timestamp, DeviceName, InitiatingProcessFileName, FileName, ProcessCommandLine
| top 100 by Timestamp

Analytic Rule Definition

id: c34d1d0e-1cf4-45d0-b628-a2cfde329182
name: PowerShell downloads
description: |
  Finds PowerShell execution events that could involve a download.
requiredDataConnectors:
- connectorId: MicrosoftThreatProtection
  dataTypes:
  - DeviceProcessEvents
query: |
  DeviceProcessEvents
  | where Timestamp > ago(7d)
  | where FileName in~ ("powershell.exe", "powershell_ise.exe")
  | where ProcessCommandLine has "Net.WebClient"
     or ProcessCommandLine has "DownloadFile"
     or ProcessCommandLine has "Invoke-WebRequest"
     or ProcessCommandLine has "Invoke-Shellcode"
     or ProcessCommandLine has "http"
     or ProcessCommandLine has "IEX"
     or ProcessCommandLine has "Start-BitsTransfer"
     or ProcessCommandLine has "mpcmdrun.exe"
  | project Timestamp, DeviceName, InitiatingProcessFileName, FileName, ProcessCommandLine
  | top 100 by Timestamp

Required Data Sources

Sentinel TableNotes
DeviceProcessEventsEnsure this data connector is enabled

References

False Positive Guidance

Original source: https://github.com/Azure/Azure-Sentinel/blob/main/Hunting Queries/Microsoft 365 Defender/Execution/PowerShell downloads.yaml