Suspicious File Renamed via SMB

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

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

to-top