PowerShell downloads (Normalized Process Events)
Description
'Finds PowerShell execution events that could involve a download'
Query · kql
imProcessCreate
| where Process has_any ("powershell.exe", "powershell_ise.exe") // perfromance pre-filtering
| extend FileName=tostring(split(TargetProcessName, '\\')[-1])
| where FileName in~ ("powershell.exe", "powershell_ise.exe")
| where CommandLine has_any ("Net.WebClient", "DownloadFile", "Invoke-WebRequest", "Invoke-Shellcode", "http:", "https:")
| project TimeGenerated, Dvc, User, ActingProcessName, FileName, CommandLine, EventVendor, EventProduct
| top 100 by TimeGenerated
| extend timestamp = TimeGenerated