Skip to content

Commit a614da5

Browse files
authored
[New Rule] Remote File Creation in World Writeable Directory (#4475)
* [New Rule] Remote File Creation in World Writeable Directory * Update rules/linux/lateral_movement_remote_file_creation_world_writeable_dir.toml * Update lateral_movement_remote_file_creation_world_writeable_dir.toml * Update rules/linux/lateral_movement_remote_file_creation_world_writeable_dir.toml
1 parent 59473f0 commit a614da5

File tree

1 file changed

+95
-0
lines changed

1 file changed

+95
-0
lines changed
Lines changed: 95 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,95 @@
1+
[metadata]
2+
creation_date = "2025/02/20"
3+
integration = ["endpoint"]
4+
maturity = "production"
5+
updated_date = "2025/02/20"
6+
7+
[rule]
8+
author = ["Elastic"]
9+
description = """
10+
This rule detects the creation of a file in a world-writeable directory through a service that is
11+
commonly used for file transfer. This behavior is often associated with lateral movement and can
12+
be an indicator of an attacker attempting to move laterally within a network.
13+
"""
14+
from = "now-9m"
15+
index = ["logs-endpoint.events.file*", "auditbeat-*"]
16+
language = "eql"
17+
license = "Elastic License v2"
18+
name = "Remote File Creation in World Writeable Directory"
19+
risk_score = 47
20+
rule_id = "3e528511-7316-4a6e-83da-61b5f1c07fd4"
21+
setup = """## Setup
22+
23+
This rule requires data coming in from one of the following integrations:
24+
- Elastic Defend
25+
- Auditbeat
26+
27+
### Elastic Defend Integration Setup
28+
Elastic 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.
29+
30+
#### Prerequisite Requirements:
31+
- Fleet is required for Elastic Defend.
32+
- To configure Fleet Server refer to the [documentation](https://www.elastic.co/guide/en/fleet/current/fleet-server.html).
33+
34+
#### The following steps should be executed in order to add the Elastic Defend integration on a Linux System:
35+
- Go to the Kibana home page and click "Add integrations".
36+
- In the query bar, search for "Elastic Defend" and select the integration to see more details about it.
37+
- Click "Add Elastic Defend".
38+
- Configure the integration name and optionally add a description.
39+
- Select the type of environment you want to protect, either "Traditional Endpoints" or "Cloud Workloads".
40+
- 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).
41+
- We suggest selecting "Complete EDR (Endpoint Detection and Response)" as a configuration setting, that provides "All events; all preventions"
42+
- 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.
43+
For more details on Elastic Agent configuration settings, refer to the [helper guide](https://www.elastic.co/guide/en/fleet/8.10/agent-policy.html).
44+
- Click "Save and Continue".
45+
- 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.
46+
For more details on Elastic Defend refer to the [helper guide](https://www.elastic.co/guide/en/security/current/install-endpoint.html).
47+
48+
### Auditbeat Setup
49+
Auditbeat is a lightweight shipper that you can install on your servers to audit the activities of users and processes on your systems. For example, you can use Auditbeat to collect and centralize audit events from the Linux Audit Framework. You can also use Auditbeat to detect changes to critical files, like binaries and configuration files, and identify potential security policy violations.
50+
51+
#### The following steps should be executed in order to add the Auditbeat on a Linux System:
52+
- Elastic provides repositories available for APT and YUM-based distributions. Note that we provide binary packages, but no source packages.
53+
- To install the APT and YUM repositories follow the setup instructions in this [helper guide](https://www.elastic.co/guide/en/beats/auditbeat/current/setup-repositories.html).
54+
- To run Auditbeat on Docker follow the setup instructions in the [helper guide](https://www.elastic.co/guide/en/beats/auditbeat/current/running-on-docker.html).
55+
- To run Auditbeat on Kubernetes follow the setup instructions in the [helper guide](https://www.elastic.co/guide/en/beats/auditbeat/current/running-on-kubernetes.html).
56+
- For complete “Setup and Run Auditbeat” information refer to the [helper guide](https://www.elastic.co/guide/en/beats/auditbeat/current/setting-up-and-running.html).
57+
"""
58+
severity = "medium"
59+
tags = [
60+
"Domain: Endpoint",
61+
"OS: Linux",
62+
"Use Case: Threat Detection",
63+
"Tactic: Lateral Movement",
64+
"Data Source: Elastic Defend",
65+
]
66+
timestamp_override = "event.ingested"
67+
type = "eql"
68+
query = '''
69+
file where host.os.type == "linux" and event.action == "creation" and
70+
process.name in ("scp", "sshd", "ssh", "ftp", "sftp", "vsftpd", "sftp-server", "rsync") and
71+
file.path like~ ("/tmp*", "/var/tmp*", "/dev/shm/*", "/home/.*") and user.id != "0"
72+
'''
73+
74+
[[rule.threat]]
75+
framework = "MITRE ATT&CK"
76+
77+
[[rule.threat.technique]]
78+
id = "T1021"
79+
name = "Remote Services"
80+
reference = "https://attack.mitre.org/techniques/T1021/"
81+
82+
[[rule.threat.technique.subtechnique]]
83+
id = "T1021.004"
84+
name = "SSH"
85+
reference = "https://attack.mitre.org/techniques/T1021/004/"
86+
87+
[[rule.threat.technique]]
88+
id = "T1570"
89+
name = "Lateral Tool Transfer"
90+
reference = "https://attack.mitre.org/techniques/T1570/"
91+
92+
[rule.threat.tactic]
93+
id = "TA0008"
94+
name = "Lateral Movement"
95+
reference = "https://attack.mitre.org/tactics/TA0008/"

0 commit comments

Comments
 (0)