Potential Web Server Compromise from Multiple Alerts

Identifies a potential web server compromise by correlating multiple suspicious or unusual process-execution alerts on the same Linux host within 10 minutes. Unusual file-creation alerts can strengthen the correlation, but cannot trigger it without sufficient process-execution activity.

Elastic rule (View on GitHub)

  1[metadata]
  2creation_date = "2026/11/26"
  3integration = ["endpoint"]
  4maturity = "production"
  5updated_date = "2026/11/26"
  6
  7[rule]
  8author = ["Elastic"]
  9description = """
 10Identifies a potential web server compromise by correlating multiple suspicious or unusual process-execution alerts on
 11the same Linux host within 10 minutes. Unusual file-creation alerts can strengthen the correlation, but cannot trigger
 12it without sufficient process-execution activity.
 13"""
 14false_positives = [
 15    """
 16    Authorized deployments, administrative actions, vulnerability scans, application diagnostics, and new web
 17    application features may generate several unusual process or file alerts in a short period.
 18    """,
 19]
 20from = "now-10m"
 21interval = "1m"
 22language = "esql"
 23license = "Elastic License v2"
 24name = "Potential Web Server Compromise from Multiple Alerts"
 25note = """## Triage and analysis
 26
 27### Investigating Potential Web Server Compromise from Multiple Alerts
 28
 29This higher-order rule correlates alerts from five web server behavior rules on the same host. It uses a weighted model
 30to prioritize combinations that are more likely to represent exploitation, web shell activity, or attacker command
 31execution:
 32
 33- Each alert from "Suspicious Child Execution via Web Server" or "Suspicious Command Execution via Web Server"
 34  contributes 3 points.
 35- Each alert from "Unusual Child Execution via Web Server" or "Unusual Command Execution via Web Server" contributes
 36  2 points. These are new-terms alerts and therefore represent activity that was not observed for the host during the
 37  source rule's history window.
 38- One or more alerts from "Unusual File Creation via Web Server" contribute a total of 1 point. The contribution is
 39  capped because web applications commonly create new files.
 40
 41The rule requires at least three source alerts, at least two process-execution alerts, a score of at least 6, and no
 42more than 10 minutes between the first and last contributing alert. The resulting alert is grouped by `host.id`.
 43Multivalued `Esql.*_values` fields summarize the contributing alerts and should not be interpreted as preserving the
 44relationship between individual field values.
 45
 46### Possible investigation steps
 47
 48- Review `Esql.kibana_alert_rule_name_values`, the component counts, and `Esql.correlation_score` to understand why the
 49  correlation triggered. Open the contributing source alerts and reconstruct their original order using the first and
 50  last alert timestamps.
 51- Examine the process command lines, executables, parents, users, and process trees. Look for shells, interpreters,
 52  downloaders, encoded commands, reconnaissance, credential access, reverse shells, or execution from writable paths.
 53- Inspect the file paths surfaced in `Esql.file_path_values`. Collect suspicious files and review their contents,
 54  hashes, ownership, permissions, and timestamps for web shells, scripts, payloads, or unauthorized application changes.
 55- Correlate the activity with web server, reverse-proxy, WAF, and application logs. Identify the request, source IP,
 56  URI, parameters, headers, authenticated session, upload, or application error that preceded the activity.
 57- Review outbound network connections, listening sockets, credential access, privilege escalation, persistence, and
 58  lateral movement around the correlation window. Search peer web servers for the same commands, files, or indicators.
 59
 60### False positive analysis
 61
 62- Confirm whether the activity coincides with an approved deployment, plugin installation, maintenance operation,
 63  diagnostics workflow, vulnerability assessment, or penetration test.
 64- Determine whether the web application legitimately invokes operating-system utilities or creates uncommon files in
 65  response to user actions. Compare the behavior with peer hosts and prior approved changes.
 66- If a recurring benign workflow is identified, tune the relevant source rule so that the higher-order rule continues
 67  to benefit from the source rules' behavioral filtering.
 68
 69### Response and remediation
 70
 71- If the activity is unauthorized, isolate the host or remove it from the load balancer while preserving volatile and
 72  disk evidence.
 73- Block associated source addresses and command-and-control destinations, terminate attacker-controlled processes, and
 74  remove web shells, payloads, and persistence only after collecting required evidence.
 75- Patch or disable the exploited application component, restore the service from a known-good source, and rotate
 76  application, database, cloud, API, and other credentials accessible to the web service.
 77- Hunt for the same activity across other internet-facing systems and escalate according to the affected data and
 78  observed post-compromise behavior.
 79"""
 80references = ["https://www.elastic.co/docs/solutions/security/detect-and-alert/about-building-block-rules"]
 81risk_score = 73
 82rule_id = "21853f73-e3c1-4914-b61d-0c4eca1a57c1"
 83setup = """## Setup
 84
 85This rule requires alert data from Elastic Security and process and file events from Elastic Defend. Enable the
 86following source rules:
 87
 88- Suspicious Child Execution via Web Server
 89- Suspicious Command Execution via Web Server
 90- Unusual Child Execution via Web Server
 91- Unusual Command Execution via Web Server
 92- Unusual File Creation via Web Server
 93
 94The unusual child and command execution rules are building-block rules whose alerts are intended for correlation and
 95are not displayed with ordinary detection alerts by default.
 96
 97The rule searches `.alerts-security.*`. Users configuring this rule must have permission to read Elastic Security alert
 98indices.
 99"""
100severity = "high"
101tags = [
102    "Domain: Endpoint",
103    "Domain: Web",
104    "OS: Linux",
105    "Platform: Linux",
106    "Use Case: Threat Detection",
107    "Use Case: Vulnerability",
108    "Tactic: Initial Access",
109    "Tactic: Execution",
110    "Tactic: Persistence",
111    "Rule Type: Higher-Order Rule",
112    "Rule Type: ES|QL",
113    "Data Source: Elastic Security",
114    "Data Source: Elastic Defend",
115    "Resources: Investigation Guide",
116    "Threat: Web Shell",
117]
118timestamp_override = "event.ingested"
119type = "esql"
120
121query = '''
122FROM .alerts-security.*
123| WHERE event.kind == "signal"
124    AND host.os.type == "linux"
125    AND host.id IS NOT NULL
126    AND kibana.alert.rule.rule_id IN (
127      "f16fca20-4d6c-43f9-aec1-20b6de3b0aeb",
128      "6148b9f5-5b12-4704-9ef7-f4b4c5dd9bb5",
129      "b2f0ea08-2b60-4a2d-93d7-fe996a30031a",
130      "65f28c4d-cfc8-4847-9cca-f2fb1e319151",
131      "9ab15ca6-be79-4718-bae6-5978a3ac6a46"
132    )
133| EVAL
134    Esql.is_suspicious_process_alert = kibana.alert.rule.rule_id IN (
135      "f16fca20-4d6c-43f9-aec1-20b6de3b0aeb",
136      "6148b9f5-5b12-4704-9ef7-f4b4c5dd9bb5"
137    ),
138    Esql.is_unusual_process_alert = kibana.alert.rule.rule_id IN (
139      "b2f0ea08-2b60-4a2d-93d7-fe996a30031a",
140      "65f28c4d-cfc8-4847-9cca-f2fb1e319151"
141    ),
142    Esql.is_unusual_file_alert = kibana.alert.rule.rule_id == "9ab15ca6-be79-4718-bae6-5978a3ac6a46"
143| STATS
144    Esql.alerts_count = COUNT(*),
145    Esql.suspicious_process_alert_count = SUM(CASE(Esql.is_suspicious_process_alert, 1, 0)),
146    Esql.unusual_process_alert_count = SUM(CASE(Esql.is_unusual_process_alert, 1, 0)),
147    Esql.unusual_file_alert_count = SUM(CASE(Esql.is_unusual_file_alert, 1, 0)),
148    Esql.kibana_alert_rule_id_distinct_count = COUNT_DISTINCT(kibana.alert.rule.rule_id),
149    Esql.process_entity_id_distinct_count = COUNT_DISTINCT(process.entity_id),
150    Esql.first_alert_timestamp = MIN(@timestamp),
151    Esql.last_alert_timestamp = MAX(@timestamp),
152    Esql.host_name_values = VALUES(host.name),
153    Esql.kibana_alert_rule_name_values = VALUES(kibana.alert.rule.name),
154    Esql.kibana_alert_rule_id_values = VALUES(kibana.alert.rule.rule_id),
155    Esql.user_name_values = VALUES(user.name),
156    Esql.process_entity_id_values = VALUES(process.entity_id),
157    Esql.process_executable_values = VALUES(process.executable),
158    Esql.process_command_line_values = VALUES(process.command_line),
159    Esql.process_parent_executable_values = VALUES(process.parent.executable),
160    Esql.process_parent_command_line_values = VALUES(process.parent.command_line),
161    Esql.file_path_values = VALUES(file.path)
162  BY host.id
163| EVAL
164    Esql.process_alert_count = Esql.suspicious_process_alert_count + Esql.unusual_process_alert_count,
165    Esql.unusual_file_alert_score = CASE(Esql.unusual_file_alert_count > 0, 1, 0),
166    Esql.correlation_duration_seconds = DATE_DIFF(
167      "second", Esql.first_alert_timestamp, Esql.last_alert_timestamp
168    )
169| EVAL Esql.correlation_score = (
170    Esql.suspicious_process_alert_count * 3
171    + Esql.unusual_process_alert_count * 2
172    + Esql.unusual_file_alert_score
173  )
174| WHERE Esql.alerts_count >= 3
175    AND Esql.process_alert_count >= 2
176    AND Esql.correlation_score >= 6
177    AND Esql.correlation_duration_seconds <= 600
178| EVAL host.name = MV_FIRST(Esql.host_name_values)
179| KEEP
180    host.id,
181    host.name,
182    Esql.*
183'''
184
185[[rule.threat]]
186framework = "MITRE ATT&CK"
187
188[[rule.threat.technique]]
189id = "T1190"
190name = "Exploit Public-Facing Application"
191reference = "https://attack.mitre.org/techniques/T1190/"
192
193[rule.threat.tactic]
194id = "TA0001"
195name = "Initial Access"
196reference = "https://attack.mitre.org/tactics/TA0001/"
197
198[[rule.threat]]
199framework = "MITRE ATT&CK"
200
201[[rule.threat.technique]]
202id = "T1059"
203name = "Command and Scripting Interpreter"
204reference = "https://attack.mitre.org/techniques/T1059/"
205
206[[rule.threat.technique.subtechnique]]
207id = "T1059.004"
208name = "Unix Shell"
209reference = "https://attack.mitre.org/techniques/T1059/004/"
210
211[rule.threat.tactic]
212id = "TA0002"
213name = "Execution"
214reference = "https://attack.mitre.org/tactics/TA0002/"
215
216[[rule.threat]]
217framework = "MITRE ATT&CK"
218
219[[rule.threat.technique]]
220id = "T1505"
221name = "Server Software Component"
222reference = "https://attack.mitre.org/techniques/T1505/"
223
224[[rule.threat.technique.subtechnique]]
225id = "T1505.003"
226name = "Web Shell"
227reference = "https://attack.mitre.org/techniques/T1505/003/"
228
229[rule.threat.tactic]
230id = "TA0003"
231name = "Persistence"
232reference = "https://attack.mitre.org/tactics/TA0003/"
233
234[rule.alert_suppression]
235group_by = ["host.id"]
236missing_fields_strategy = "suppress"
237
238[rule.investigation_fields]
239field_names = [
240    "host.name",
241    "host.id",
242    "Esql.correlation_score",
243    "Esql.alerts_count",
244    "Esql.suspicious_process_alert_count",
245    "Esql.unusual_process_alert_count",
246    "Esql.unusual_file_alert_count",
247    "Esql.first_alert_timestamp",
248    "Esql.last_alert_timestamp",
249    "Esql.kibana_alert_rule_name_values",
250    "Esql.process_command_line_values",
251    "Esql.file_path_values",
252]
253
254[rule.alert_suppression.duration]
255unit = "m"
256value = 15

Triage and analysis

Investigating Potential Web Server Compromise from Multiple Alerts

This higher-order rule correlates alerts from five web server behavior rules on the same host. It uses a weighted model to prioritize combinations that are more likely to represent exploitation, web shell activity, or attacker command execution:

  • Each alert from "Suspicious Child Execution via Web Server" or "Suspicious Command Execution via Web Server" contributes 3 points.
  • Each alert from "Unusual Child Execution via Web Server" or "Unusual Command Execution via Web Server" contributes 2 points. These are new-terms alerts and therefore represent activity that was not observed for the host during the source rule's history window.
  • One or more alerts from "Unusual File Creation via Web Server" contribute a total of 1 point. The contribution is capped because web applications commonly create new files.

The rule requires at least three source alerts, at least two process-execution alerts, a score of at least 6, and no more than 10 minutes between the first and last contributing alert. The resulting alert is grouped by host.id. Multivalued Esql.*_values fields summarize the contributing alerts and should not be interpreted as preserving the relationship between individual field values.

Possible investigation steps

  • Review Esql.kibana_alert_rule_name_values, the component counts, and Esql.correlation_score to understand why the correlation triggered. Open the contributing source alerts and reconstruct their original order using the first and last alert timestamps.
  • Examine the process command lines, executables, parents, users, and process trees. Look for shells, interpreters, downloaders, encoded commands, reconnaissance, credential access, reverse shells, or execution from writable paths.
  • Inspect the file paths surfaced in Esql.file_path_values. Collect suspicious files and review their contents, hashes, ownership, permissions, and timestamps for web shells, scripts, payloads, or unauthorized application changes.
  • Correlate the activity with web server, reverse-proxy, WAF, and application logs. Identify the request, source IP, URI, parameters, headers, authenticated session, upload, or application error that preceded the activity.
  • Review outbound network connections, listening sockets, credential access, privilege escalation, persistence, and lateral movement around the correlation window. Search peer web servers for the same commands, files, or indicators.

False positive analysis

  • Confirm whether the activity coincides with an approved deployment, plugin installation, maintenance operation, diagnostics workflow, vulnerability assessment, or penetration test.
  • Determine whether the web application legitimately invokes operating-system utilities or creates uncommon files in response to user actions. Compare the behavior with peer hosts and prior approved changes.
  • If a recurring benign workflow is identified, tune the relevant source rule so that the higher-order rule continues to benefit from the source rules' behavioral filtering.

Response and remediation

  • If the activity is unauthorized, isolate the host or remove it from the load balancer while preserving volatile and disk evidence.
  • Block associated source addresses and command-and-control destinations, terminate attacker-controlled processes, and remove web shells, payloads, and persistence only after collecting required evidence.
  • Patch or disable the exploited application component, restore the service from a known-good source, and rotate application, database, cloud, API, and other credentials accessible to the web service.
  • Hunt for the same activity across other internet-facing systems and escalate according to the affected data and observed post-compromise behavior.

References

Related rules

to-top