Web shell file alert enrichment
Description
'Extracts MDATP Alert for a web shell being placed on the server and then enriches this event with information from W3CIISLog to idnetigy the Attacker that placed the shell'
Query · kql
let scriptExtensions = dynamic([".php", ".jsp", ".js", ".aspx", ".asmx", ".asax", ".cfm", ".shtml"]); SecurityAlert | where ProviderName =~ "MDATP" | extend alertData = parse_json(Entities) | mvexpand alertData // Get only the file type from the JSON, this gives us the file name | where alertData.Type =~ "file" // This can be expanded to include other script extensions | where alertData.Name has_any(scriptExtensions) | extend FileName = alertData.Name | project TimeGenerated, tostring(FileName), alertData.Directory | join ( W3CIISLog | where csUriStem has_any(scriptExtensions) | extend splitUriStem = split(csUriStem, "/") | extend FileName = splitUriStem[-1] | summarize StartTime=min(TimeGenerated), EndTime=max(TimeGenerated) by AttackerIP=cIP, AttackerUserAgent=csUserAgent, SiteName=sSiteName, ShellLocation=csUriStem, tostring(FileName) ) on FileName | project StartTime, EndTime, AttackerIP, AttackerUserAgent, SiteName, ShellLocation | extend timestamp = StartTime, IPCustomEntity = AttackerIP
Rule dependencies
Depends on
-
correlates · Sentinel SecurityAlert
An external product alert, not indexed on this site.