Deprecated - Unusual File Creation by Web Server

This rule detects unusual file creations from a web server parent process. Adversaries may attempt to create files from a web server parent process to establish persistence, execute malicious scripts, or exfiltrate data. ES|QL rules have limited fields available in its alert documents. Make sure to review the original documents to aid in the investigation of this alert.

Elastic rule (View on GitHub)

  1[metadata]
  2bypass_bbr_timing = true
  3creation_date = "2025/03/06"
  4deprecation_date = "2026/11/26"
  5deprecated_reason = "This rule is very noisy and has been superseded by the more targeted new-terms rule, Unusual File Creation via Web Server."
  6integration = ["endpoint"]
  7maturity = "deprecated"
  8updated_date = "2026/11/26"
  9
 10[rule]
 11author = ["Elastic"]
 12building_block_type = "default"
 13description = """
 14This rule detects unusual file creations from a web server parent process. Adversaries may attempt to create files from
 15a web server parent process to establish persistence, execute malicious scripts, or exfiltrate data. ES|QL rules have
 16limited fields available in its alert documents. Make sure to review the original documents to aid in the investigation
 17of this alert.
 18"""
 19from = "now-61m"
 20interval = "1h"
 21language = "esql"
 22license = "Elastic License v2"
 23name = "Deprecated - Unusual File Creation by Web Server"
 24note = """## Triage and analysis
 25
 26**Deprecated Notice** - This rule has been deprecated because it produces a high volume of false positives and has been
 27superseded by "Unusual File Creation via Web Server" (`9ab15ca6-be79-4718-bae6-5978a3ac6a46`). The replacement uses a
 287-day new-terms history and more targeted web-server process, file-path, file-type, cache, session, upload, and media
 29filters to provide a better signal-to-noise ratio.
 30"""
 31risk_score = 21
 32rule_id = "894b7cc9-040b-427c-aca5-36b40d3667bf"
 33setup = """## Setup
 34
 35This rule requires data coming in from Elastic Defend.
 36
 37### Elastic Defend Integration Setup
 38Elastic Defend is integrated into the Elastic Agent using Fleet. Upon configuration, the integration allows the Elastic Agent to monitor events on your host and send data to the Elastic Security app.
 39
 40#### Prerequisite Requirements:
 41- Fleet is required for Elastic Defend.
 42- To configure Fleet Server refer to the [documentation](https://www.elastic.co/guide/en/fleet/current/fleet-server.html).
 43
 44#### The following steps should be executed in order to add the Elastic Defend integration on a Linux System:
 45- Go to the Kibana home page and click "Add integrations".
 46- In the query bar, search for "Elastic Defend" and select the integration to see more details about it.
 47- Click "Add Elastic Defend".
 48- Configure the integration name and optionally add a description.
 49- Select the type of environment you want to protect, either "Traditional Endpoints" or "Cloud Workloads".
 50- Select a configuration preset. Each preset comes with different default settings for Elastic Agent, you can further customize these later by configuring the Elastic Defend integration policy. [Helper guide](https://www.elastic.co/guide/en/security/current/configure-endpoint-integration-policy.html).
 51- We suggest selecting "Complete EDR (Endpoint Detection and Response)" as a configuration setting, that provides "All events; all preventions"
 52- Enter a name for the agent policy in "New agent policy name". If other agent policies already exist, you can click the "Existing hosts" tab and select an existing policy instead.
 53For more details on Elastic Agent configuration settings, refer to the [helper guide](https://www.elastic.co/guide/en/fleet/8.10/agent-policy.html).
 54- Click "Save and Continue".
 55- To complete the integration, select "Add Elastic Agent to your hosts" and continue to the next section to install the Elastic Agent on your hosts.
 56For more details on Elastic Defend refer to the [helper guide](https://www.elastic.co/guide/en/security/current/install-endpoint.html).
 57"""
 58severity = "low"
 59tags = [
 60    "Domain: Endpoint",
 61    "OS: Linux",
 62    "Use Case: Threat Detection",
 63    "Tactic: Persistence",
 64    "Tactic: Execution",
 65    "Tactic: Command and Control",
 66    "Data Source: Elastic Defend",
 67    "Rule Type: BBR",
 68    "Rule Type: ES|QL",
 69    "Platform: Linux",
 70]
 71timestamp_override = "event.ingested"
 72type = "esql"
 73
 74query = '''
 75from logs-endpoint.events.file-* metadata _id, _index, _version
 76
 77// Ensure event.action values in a list are expanded
 78| mv_expand event.action 
 79
 80| where
 81    host.os.type == "linux" and
 82    event.action == "creation" and (
 83        process.name in (
 84            "apache", "nginx", "apache2", "httpd", "lighttpd", "caddy", "mongrel_rails", "gunicorn",
 85            "uwsgi", "openresty", "cherokee", "h2o", "resin", "puma", "unicorn", "traefik", "tornado", "hypercorn",
 86            "daphne", "twistd", "yaws", "webfsd", "httpd.worker", "flask", "rails", "mongrel", "php-cgi",
 87            "php-fcgi", "php-cgi.cagefs", "catalina.sh", "hiawatha", "lswsctrl"
 88        ) or
 89        process.name like "php-fpm*" or
 90        user.name in ("apache", "www-data", "httpd", "nginx", "lighttpd", "tomcat", "tomcat8", "tomcat9") or
 91        user.id in ("33", "498", "48")
 92      )
 93
 94| keep
 95    @timestamp,
 96    _id,
 97    _index,
 98    _version,
 99    host.os.type,
100    event.action,
101    user.name,
102    user.id,
103    process.name,
104    process.executable,
105    file.path,
106    agent.id,
107    host.name,
108    event.dataset,
109    data_stream.namespace
110
111| stats
112    Esql.event_count = count(),
113    Esql.agent_id_count_distinct = count_distinct(agent.id),
114    Esql.host_name_values = values(host.name),
115    Esql.agent_id_values = values(agent.id),
116    Esql.event_dataset_values = values(event.dataset),
117    Esql.data_stream_namespace_values = values(data_stream.namespace)
118
119  by process.executable, file.path
120
121| where
122    Esql.agent_id_count_distinct == 1 and
123    Esql.event_count < 5
124'''
125
126
127[[rule.threat]]
128framework = "MITRE ATT&CK"
129[[rule.threat.technique]]
130id = "T1505"
131name = "Server Software Component"
132reference = "https://attack.mitre.org/techniques/T1505/"
133[[rule.threat.technique.subtechnique]]
134id = "T1505.003"
135name = "Web Shell"
136reference = "https://attack.mitre.org/techniques/T1505/003/"
137
138
139
140[rule.threat.tactic]
141id = "TA0003"
142name = "Persistence"
143reference = "https://attack.mitre.org/tactics/TA0003/"
144[[rule.threat]]
145framework = "MITRE ATT&CK"
146[[rule.threat.technique]]
147id = "T1059"
148name = "Command and Scripting Interpreter"
149reference = "https://attack.mitre.org/techniques/T1059/"
150[[rule.threat.technique.subtechnique]]
151id = "T1059.004"
152name = "Unix Shell"
153reference = "https://attack.mitre.org/techniques/T1059/004/"
154
155
156
157[rule.threat.tactic]
158id = "TA0002"
159name = "Execution"
160reference = "https://attack.mitre.org/tactics/TA0002/"
161[[rule.threat]]
162framework = "MITRE ATT&CK"
163[[rule.threat.technique]]
164id = "T1071"
165name = "Application Layer Protocol"
166reference = "https://attack.mitre.org/techniques/T1071/"
167
168
169[rule.threat.tactic]
170id = "TA0011"
171name = "Command and Control"
172reference = "https://attack.mitre.org/tactics/TA0011/"
173[[rule.threat]]
174framework = "MITRE ATT&CK"
175[[rule.threat.technique]]
176id = "T1190"
177name = "Exploit Public-Facing Application"
178reference = "https://attack.mitre.org/techniques/T1190/"
179
180
181[rule.threat.tactic]
182id = "TA0001"
183name = "Initial Access"
184reference = "https://attack.mitre.org/tactics/TA0001/"

Triage and analysis

Deprecated Notice - This rule has been deprecated because it produces a high volume of false positives and has been superseded by "Unusual File Creation via Web Server" (9ab15ca6-be79-4718-bae6-5978a3ac6a46). The replacement uses a 7-day new-terms history and more targeted web-server process, file-path, file-type, cache, session, upload, and media filters to provide a better signal-to-noise ratio.

Related rules

to-top