Potential Ransomware Note File Dropped via SMB

Identifies an incoming SMB connection followed by the creation of a file with a name similar to ransomware note files. This may indicate a remote ransomware attack via the SMB protocol.

Elastic rule (View on GitHub)

  1[metadata]
  2creation_date = "2024/05/02"
  3integration = ["endpoint"]
  4maturity = "production"
  5updated_date = "2024/05/21"
  6
  7[rule]
  8author = ["Elastic"]
  9description = """
 10Identifies an incoming SMB connection followed by the creation of a file with a name similar to ransomware note files.
 11This may indicate a remote ransomware attack via the SMB protocol.
 12"""
 13from = "now-9m"
 14index = ["logs-endpoint.events.*"]
 15language = "eql"
 16license = "Elastic License v2"
 17name = "Potential Ransomware Note File Dropped via SMB"
 18note = """## Triage and analysis
 19
 20## Performance
 21
 22- This rule may cause medium to high performance impact due to logic scoping all icoming SMB network events.
 23
 24#### Possible investigation steps
 25
 26- Investigate the source.ip address connecting to port 445 on this host.
 27- Identify the user account that performed the file creation via SMB.
 28- If the number of files is too high and source.ip connecting over SMB is unusual isolate the host and block the used credentials.
 29- Investigate other alerts associated with the user/host during the past 48 hours.
 30
 31### False positive analysis
 32
 33- Remote file creation with similar file naming convention via SMB.
 34
 35
 36### Related rules
 37
 38- Third-party Backup Files Deleted via Unexpected Process - 11ea6bec-ebde-4d71-a8e9-784948f8e3e9
 39- Volume Shadow Copy Deleted or Resized via VssAdmin - b5ea4bfe-a1b2-421f-9d47-22a75a6f2921
 40- Volume Shadow Copy Deletion via PowerShell - d99a037b-c8e2-47a5-97b9-170d076827c4
 41- Volume Shadow Copy Deletion via WMIC - dc9c1f74-dac3-48e3-b47f-eb79db358f57
 42- Suspicious File Renamed via SMB - 78e9b5d5-7c07-40a7-a591-3dbbf464c386
 43
 44### Response and remediation
 45
 46- Initiate the incident response process based on the outcome of the triage.
 47- Consider isolating the involved host to prevent destructive behavior, which is commonly associated with this activity.
 48- 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.
 49- 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.
 50- If any backups were affected:
 51  - Perform data recovery locally or restore the backups from replicated copies (cloud, other servers, etc.).
 52- Determine the initial vector abused by the attacker and take action to prevent reinfection through the same vector.
 53- 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).
 54"""
 55risk_score = 73
 56rule_id = "02bab13d-fb14-4d7c-b6fe-4a28874d37c5"
 57severity = "high"
 58tags = [
 59    "Domain: Endpoint",
 60    "OS: Windows",
 61    "Use Case: Threat Detection",
 62    "Tactic: Impact",
 63    "Resources: Investigation Guide",
 64    "Data Source: Elastic Defend",
 65]
 66timestamp_override = "event.ingested"
 67type = "eql"
 68
 69query = '''
 70sequence by host.id with maxspan=1s
 71 [network where host.os.type == "windows" and
 72  event.action == "connection_accepted" and destination.port == 445 and source.port >= 49152 and process.pid == 4 and
 73  source.ip != "127.0.0.1" and source.ip != "::1"]
 74 [file where host.os.type == "windows" and event.action == "creation" and
 75  process.pid == 4 and user.id : ("S-1-5-21*", "S-1-12-*") and file.extension : ("hta", "txt", "readme", "htm*") and
 76   /* ransom file name keywords */
 77    file.name : ("*read*me*", "*lock*", "*@*", "*RECOVER*", "*decrypt*", "*restore*file*", "*FILES_BACK*", "*how*to*")] with runs=3
 78'''
 79
 80
 81[[rule.threat]]
 82framework = "MITRE ATT&CK"
 83[[rule.threat.technique]]
 84id = "T1485"
 85name = "Data Destruction"
 86reference = "https://attack.mitre.org/techniques/T1485/"
 87
 88[[rule.threat.technique]]
 89id = "T1490"
 90name = "Inhibit System Recovery"
 91reference = "https://attack.mitre.org/techniques/T1490/"
 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
110
111[rule.threat.tactic]
112id = "TA0008"
113name = "Lateral Movement"
114reference = "https://attack.mitre.org/tactics/TA0008/"

Triage and analysis

Performance

  • This rule may cause medium to high performance impact due to logic scoping all icoming SMB network events.

Possible investigation steps

  • Investigate the source.ip address connecting to port 445 on this host.
  • Identify the user account that performed the file creation via SMB.
  • 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

  • Remote file creation with similar file naming convention via SMB.
  • 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
  • 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).

Related rules

to-top