Potential Linux Ransomware Note Creation Detected

This rule identifies a sequence of a mass file encryption event in conjunction with the creation of a .txt file with a file name containing ransomware keywords executed by the same process in a 1 second timespan. Ransomware is a type of malware that encrypts a victim's files or systems and demands payment (usually in cryptocurrency) in exchange for the decryption key. One important indicator of a ransomware attack is the mass encryption of the file system, after which a new file extension is added to the file.

Elastic rule (View on GitHub)

 1[metadata]
 2creation_date = "2023/03/20"
 3integration = ["endpoint"]
 4maturity = "production"
 5min_stack_comments = "New fields added: required_fields, related_integrations, setup"
 6min_stack_version = "8.3.0"
 7updated_date = "2024/02/21"
 8
 9[rule]
10author = ["Elastic"]
11description = """
12This rule identifies a sequence of a mass file encryption event in conjunction with the creation of a .txt file with 
13a file name containing ransomware keywords executed by the same process in a 1 second timespan. Ransomware is a type of
14malware that encrypts a victim's files or systems and demands payment (usually in cryptocurrency) in exchange for the
15decryption key. One important indicator of a ransomware attack is the mass encryption of the file system, after which a
16new file extension is added to the file. 
17"""
18from = "now-9m"
19index = ["logs-endpoint.events.*"]
20language = "eql"
21license = "Elastic License v2"
22name = "Potential Linux Ransomware Note Creation Detected"
23risk_score = 47
24rule_id = "c8935a8b-634a-4449-98f7-bb24d3b2c0af"
25setup = """## Setup
26
27This rule requires data coming in from Elastic Defend.
28
29### Elastic Defend Integration Setup
30Elastic 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.
31
32#### Prerequisite Requirements:
33- Fleet is required for Elastic Defend.
34- To configure Fleet Server refer to the [documentation](https://www.elastic.co/guide/en/fleet/current/fleet-server.html).
35
36#### The following steps should be executed in order to add the Elastic Defend integration on a Linux System:
37- Go to the Kibana home page and click "Add integrations".
38- In the query bar, search for "Elastic Defend" and select the integration to see more details about it.
39- Click "Add Elastic Defend".
40- Configure the integration name and optionally add a description.
41- Select the type of environment you want to protect, either "Traditional Endpoints" or "Cloud Workloads".
42- 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).
43- We suggest selecting "Complete EDR (Endpoint Detection and Response)" as a configuration setting, that provides "All events; all preventions"
44- 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.
45For more details on Elastic Agent configuration settings, refer to the [helper guide](https://www.elastic.co/guide/en/fleet/8.10/agent-policy.html).
46- Click "Save and Continue".
47- 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.
48For more details on Elastic Defend refer to the [helper guide](https://www.elastic.co/guide/en/security/current/install-endpoint.html).
49"""
50severity = "medium"
51tags = [
52        "Domain: Endpoint",
53        "OS: Linux",
54        "Use Case: Threat Detection",
55        "Tactic: Impact",
56        "Data Source: Elastic Defend"
57        ]
58type = "eql"
59query = '''
60sequence by process.entity_id, host.id with maxspan=1s 
61  [file where host.os.type == "linux" and event.type == "change" and event.action == "rename" and file.extension : "?*" 
62   and process.executable : ("./*", "/tmp/*", "/var/tmp/*", "/dev/shm/*", "/var/run/*", "/boot/*", "/srv/*", "/run/*") and
63   file.path : (
64     "/home/*/Downloads/*", "/home/*/Documents/*", "/root/*", "/bin/*", "/usr/bin/*", "/var/log/*", "/var/lib/log/*",
65     "/var/backup/*", "/var/www/*") and
66   not process.name : (
67     "dpkg", "yum", "dnf", "rpm", "dockerd", "go", "java", "pip*", "python*", "node", "containerd", "php", "p4d",
68     "conda", "chrome", "imap", "cmake", "firefox", "semanage", "semodule", "ansible-galaxy", "fc-cache", "jammy", "git",
69     "systemsettings", "vmis-launcher", "bundle", "kudu-tserver", "suldownloader"
70    )
71  ] with runs=25
72  [file where host.os.type == "linux" and event.action == "creation" and file.name : (
73     "*crypt*", "*restore*", "*lock*", "*recovery*", "*data*", "*read*", "*instruction*", "*how_to*", "*ransom*"
74    )
75  ]
76'''
77
78[[rule.threat]]
79framework = "MITRE ATT&CK"
80
81[[rule.threat.technique]]
82id = "T1486"
83name = "Data Encrypted for Impact"
84reference = "https://attack.mitre.org/techniques/T1486/"
85
86[rule.threat.tactic]
87id = "TA0040"
88name = "Impact"
89reference = "https://attack.mitre.org/tactics/TA0040/"

Related rules

to-top