Detect DeviceNetworkEvents for LOLBAS with Download or Upload Functions
Description of the Query:
KQL Query:
// Detect DeviceNetworkEvents from LOLBAS with Download or Upload Functions
DeviceNetworkEvents
| where Timestamp > ago(1d) // Limit results to the last 24 hours
| where InitiatingProcessFileName has_any (
"certutil.exe",
"bitsadmin.exe",
"mshta.exe",
"powershell.exe",
"cmd.exe",
"cscript.exe",
"wscript.exe",
"curl.exe",
"wget.exe",
"ftp.exe"
) // Filter for known LOLBAS tools with download/upload capabilities
| extend UserName = tostring(split(InitiatingProcessAccountName, @"\")[1]) // Extract username for context
| extend IsDownloadOrUpload = iff(InitiatingProcessCommandLine has_any ("download", "upload", "http", "https", "ftp"), true, false)
| where IsDownloadOrUpload == true // Focus on events involving download or upload activity
| project
Timestamp,
DeviceName,
UserName,
InitiatingProcessAccountName,
InitiatingProcessFileName,
InitiatingProcessCommandLine,
RemoteIP,
RemotePort,
LocalIP,
LocalPort,
ActionType
| sort by Timestamp descExplanation of the Query:
Use Case:
Notes:
PreviousIdentify Processes Launched by PowerShell Remoting (WSMProvHost.exe)NextDetect Execution of PSEXESVC via Remote Systems
Last updated