Potential Ransomware Behavior - Note Files by System
This rule identifies the creation of multiple files with same name and over SMB by the same user. This behavior may indicate the successful remote execution of a ransomware dropping file notes to different folders.
Elastic rule (View on GitHub)
1[metadata]
2creation_date = "2024/05/03"
3integration = ["endpoint"]
4maturity = "production"
5updated_date = "2025/09/30"
6
7[rule]
8author = ["Elastic"]
9description = """
10This rule identifies the creation of multiple files with same name and over SMB by the same user. This behavior may indicate the
11successful remote execution of a ransomware dropping file notes to different folders.
12"""
13from = "now-9m"
14language = "esql"
15license = "Elastic License v2"
16name = "Potential Ransomware Behavior - Note Files by System"
17note = """## Triage and analysis
18
19#### Possible investigation steps
20
21- Investigate the content of the dropped files.
22- Investigate any file names with unusual extensions.
23- Investigate any incoming network connection to port 445 on this host.
24- Investigate any network logon events to this host.
25- Identify the total number and type of modified files by pid 4.
26- If the number of files is too high and source.ip connecting over SMB is unusual isolate the host and block the used credentials.
27- Investigate other alerts associated with the user/host during the past 48 hours.
28
29### False positive analysis
30
31- Local file modification from a Kernel mode driver.
32
33### Related rules
34
35- Third-party Backup Files Deleted via Unexpected Process - 11ea6bec-ebde-4d71-a8e9-784948f8e3e9
36- Volume Shadow Copy Deleted or Resized via VssAdmin - b5ea4bfe-a1b2-421f-9d47-22a75a6f2921
37- Volume Shadow Copy Deletion via PowerShell - d99a037b-c8e2-47a5-97b9-170d076827c4
38- Volume Shadow Copy Deletion via WMIC - dc9c1f74-dac3-48e3-b47f-eb79db358f57
39- Potential Ransomware Note File Dropped via SMB - 02bab13d-fb14-4d7c-b6fe-4a28874d37c5
40- Suspicious File Renamed via SMB - 78e9b5d5-7c07-40a7-a591-3dbbf464c386
41
42### Response and remediation
43
44- Initiate the incident response process based on the outcome of the triage.
45- Consider isolating the involved host to prevent destructive behavior, which is commonly associated with this activity.
46- Investigate credential exposure on systems compromised or used by the attacker to ensure all compromised accounts are identified. Reset passwords for these accounts and other potentially compromised credentials, such as email, business systems, and web services.
47- If any other destructive action was identified on the host, it is recommended to prioritize the investigation and look for ransomware preparation and execution activities.
48- If any backups were affected:
49 - Perform data recovery locally or restore the backups from replicated copies (cloud, other servers, etc.).
50- Determine the initial vector abused by the attacker and take action to prevent reinfection through the same vector.
51- Using the incident response data, update logging and audit policies to improve the mean time to detect (MTTD) and the mean time to respond (MTTR).
52"""
53references = ["https://news.sophos.com/en-us/2023/12/21/akira-again-the-ransomware-that-keeps-on-taking/"]
54risk_score = 47
55rule_id = "1397e1b9-0c90-4d24-8d7b-80598eb9bc9a"
56severity = "medium"
57tags = [
58 "Domain: Endpoint",
59 "OS: Windows",
60 "Use Case: Threat Detection",
61 "Tactic: Impact",
62 "Resources: Investigation Guide",
63 "Data Source: Elastic Defend"
64]
65timestamp_override = "event.ingested"
66type = "esql"
67
68query = '''
69from logs-endpoint.events.file-* metadata _id, _version, _index
70
71// filter for file creation event done remotely over SMB with common user readable file types used to place ransomware notes
72| where event.category == "file" and host.os.type == "windows" and event.action == "creation" and process.pid == 4 and user.id != "S-1-5-18" and
73 file.extension in ("txt", "htm", "html", "hta", "pdf", "jpg", "bmp", "png", "pdf")
74
75// truncate the timestamp to a 60-second window
76| eval Esql.time_window_date_trunc = date_trunc(60 seconds, @timestamp)
77
78| keep file.path, file.name, process.entity_id, Esql.time_window_date_trunc
79
80// filter for same file name dropped in at least 3 unique paths by the System virtual process
81| stats Esql.file_path_count_distinct = COUNT_DISTINCT(file.path), Esql.file_path_values = VALUES(file.path) by process.entity_id , file.name, Esql.time_window_date_trunc
82| where Esql.file_path_count_distinct >= 3
83'''
84
85
86[[rule.threat]]
87framework = "MITRE ATT&CK"
88[[rule.threat.technique]]
89id = "T1485"
90name = "Data Destruction"
91reference = "https://attack.mitre.org/techniques/T1485/"
92
93
94[rule.threat.tactic]
95id = "TA0040"
96name = "Impact"
97reference = "https://attack.mitre.org/tactics/TA0040/"
98[[rule.threat]]
99framework = "MITRE ATT&CK"
100[[rule.threat.technique]]
101id = "T1021"
102name = "Remote Services"
103reference = "https://attack.mitre.org/techniques/T1021/"
104[[rule.threat.technique.subtechnique]]
105id = "T1021.002"
106name = "SMB/Windows Admin Shares"
107reference = "https://attack.mitre.org/techniques/T1021/002/"
108
109[rule.threat.tactic]
110id = "TA0008"
111name = "Lateral Movement"
112reference = "https://attack.mitre.org/tactics/TA0008/"
Triage and analysis
Possible investigation steps
- Investigate the content of the dropped files.
- Investigate any file names with unusual extensions.
- Investigate any incoming network connection to port 445 on this host.
- Investigate any network logon events to this host.
- Identify the total number and type of modified files by pid 4.
- If the number of files is too high and source.ip connecting over SMB is unusual isolate the host and block the used credentials.
- Investigate other alerts associated with the user/host during the past 48 hours.
False positive analysis
- Local file modification from a Kernel mode driver.
Related rules
- Third-party Backup Files Deleted via Unexpected Process - 11ea6bec-ebde-4d71-a8e9-784948f8e3e9
- Volume Shadow Copy Deleted or Resized via VssAdmin - b5ea4bfe-a1b2-421f-9d47-22a75a6f2921
- Volume Shadow Copy Deletion via PowerShell - d99a037b-c8e2-47a5-97b9-170d076827c4
- Volume Shadow Copy Deletion via WMIC - dc9c1f74-dac3-48e3-b47f-eb79db358f57
- Potential Ransomware Note File Dropped via SMB - 02bab13d-fb14-4d7c-b6fe-4a28874d37c5
- Suspicious File Renamed via SMB - 78e9b5d5-7c07-40a7-a591-3dbbf464c386
Response and remediation
- Initiate the incident response process based on the outcome of the triage.
- Consider isolating the involved host to prevent destructive behavior, which is commonly associated with this activity.
- Investigate credential exposure on systems compromised or used by the attacker to ensure all compromised accounts are identified. Reset passwords for these accounts and other potentially compromised credentials, such as email, business systems, and web services.
- If any other destructive action was identified on the host, it is recommended to prioritize the investigation and look for ransomware preparation and execution activities.
- If any backups were affected:
- Perform data recovery locally or restore the backups from replicated copies (cloud, other servers, etc.).
- Determine the initial vector abused by the attacker and take action to prevent reinfection through the same vector.
- Using the incident response data, update logging and audit policies to improve the mean time to detect (MTTD) and the mean time to respond (MTTR).
References
Related rules
- Potential System Tampering via File Modification
- Potential Secure File Deletion via SDelete Utility
- Third-party Backup Files Deleted via Unexpected Process
- High Number of Process and/or Service Terminations
- Backup Deletion with Wbadmin