Hunts & Detections

Source dated

Microsoft documents ARTEX abuse across multiple threat groups

Original query

Microsoft Defender XDR ยท KQL

Looks for clustered shell or download-tool starts associated with web server processes. Review expected deployment and build workloads.

Telemetry DeviceProcessEvents

KQL

// Shells and download tools started by web or application server processes
let WebServerProcesses = dynamic(["w3wp.exe", "httpd", "apache2", "nginx", "lighttpd",
    "java", "node"]);
let ShellsAndTools = dynamic(["sh", "bash", "dash", "zsh", "cmd.exe", "powershell.exe",
    "pwsh", "pwsh.exe", "curl", "wget", "nc", "ncat", "certutil.exe", "python3", "perl"]);
DeviceProcessEvents
| where InitiatingProcessFileName in~ (WebServerProcesses)
    or InitiatingProcessFileName startswith "php"
| where FileName in~ (ShellsAndTools)
| summarize DistinctCommands = dcount(ProcessCommandLine), Tools = make_set(FileName, 20),
    SampleCommands = make_set(ProcessCommandLine, 25), FirstSeen = min(Timestamp),
    LastSeen = max(Timestamp)
    by DeviceId, DeviceName, InitiatingProcessFileName, bin(Timestamp, 5m)
| where DistinctCommands >= 10
| order by DistinctCommands desc