A web server’s job is narrow, so exploitation of the server or its applications (T1190) tends to produce behaviour that no legitimate workload does: launching a command interpreter, writing an executable to disk, or connecting to an arbitrary address. If you build a baseline for each application and alert on departures, you detect exploitation by effect rather than by vulnerability, which is what you need for the flaw you have not heard about yet.
Signals at a Glance
| Signal | Where | ATT&CK |
|---|---|---|
| Web server process spawning cmd, PowerShell, sh, bash, certutil, curl or wget | Sysmon 1, auditd, EDR | T1059 |
| A child process never seen before for this application | Process telemetry baseline | T1505.003 |
| Web server account writing executables, scripts or archives | File events | T1105 |
| Web server initiating outbound connections to non-application destinations | Firewall, EDR network events | T1071.001 |
| Web server account reading credential stores or configuration outside its directory | File and audit events | T1552.001 |
Baselining Child Processes
The strongest generic detection is rarity. For each web server host and parent process, build a list of child process names over a few weeks of normal activity, then alert on new entries. The same query works as a hunt before it works as an alert:
// Defender (KQL) - first-seen child processes of web server processes
let baseline = DeviceProcessEvents
| where Timestamp between (ago(30d) .. ago(1d))
| where InitiatingProcessFileName in~ ("w3wp.exe", "httpd.exe", "nginx.exe", "tomcat9.exe", "java.exe", "php-cgi.exe")
| summarize by DeviceName, InitiatingProcessFileName, FileName;
DeviceProcessEvents
| where Timestamp > ago(1d)
| where InitiatingProcessFileName in~ ("w3wp.exe", "httpd.exe", "nginx.exe", "tomcat9.exe", "java.exe", "php-cgi.exe")
| join kind=leftanti baseline on DeviceName, InitiatingProcessFileName, FileName
| project Timestamp, DeviceName, InitiatingProcessFileName, FileName, ProcessCommandLine, AccountName
// Tune/validate: app deployments and patching legitimately add new children.
Add a high-severity override list of known abused binaries that should alert even when they appear in the baseline, because attackers sometimes cause an application to spawn them early enough to pollute it:
| tstats summariesonly=true count from datamodel=Endpoint.Processes
where Processes.parent_process_name IN ("w3wp.exe","httpd","nginx","php-fpm","java","tomcat9.exe")
AND Processes.process_name IN ("cmd.exe","powershell.exe","pwsh.exe","certutil.exe","bitsadmin.exe",
"mshta.exe","rundll32.exe","regsvr32.exe","sh","bash","curl","wget","nc","whoami","id")
by Processes.dest Processes.user Processes.parent_process_name Processes.process_name Processes.process
| `drop_dm_object_name(Processes)`
# Tune/validate: tune per application pool; add allow-list for verified helper scripts.
Add File and Network Context
- Pair each process alert with file events from the same host in the previous few minutes. A new script plus a new child is far stronger than either alone.
- Egress is the cheapest corroboration. Web tier servers should talk to a small, stable set of internal systems; add a rule for any other destination (see the DMZ outbound page).
- Alert on unusual parent-child chains involving the web account, for example a web process starting a scheduler or service creation tool (T1053).
- Keep a per-application baseline owner. When an application team ships a feature that launches a helper, the baseline update is a change-management step.
- Record the web server user’s privileges, and reduce them. A baseline helps detection, but least privilege limits damage when detection is late.
Use the SigmaHQ web server child-process rules, Elastic behavioural rules for web server processes, Splunk ESCU analytics on web server spawning, and CISA guidance on hunting exploited web applications. The baseline must be your own; no generic list can know which helper scripts your applications use.
Build Detections That Fire
Mjolnir Security helps blue teams turn threat intelligence into high-fidelity detections across endpoint, network, identity and cloud telemetry.
- Detection Engineering We build and tune detections mapped to ATT&CK from your own telemetry.
- Threat Hunting as a Service Hypothesis-driven hunts for the behaviours on this page.
- 24/7 Incident Response Containment when a detection fires. Call +1 833 403 5875.
Stay ahead of emerging threats. Get notified when we publish new intelligence reports and advisories.
Subscribe to Alerts