Windows Registry File Creation in SMB Share

Identifies the creation or modification of a medium-size registry hive file on a Server Message Block (SMB) share, which may indicate an exfiltration attempt of a previously dumped Security Account Manager (SAM) registry hive for credential extraction on an attacker-controlled system.

Elastic rule (View on GitHub)

  1[metadata]
  2creation_date = "2022/02/16"
  3integration = ["endpoint"]
  4maturity = "production"
  5min_stack_comments = "New fields added: required_fields, related_integrations, setup"
  6min_stack_version = "8.3.0"
  7updated_date = "2024/03/28"
  8
  9[rule]
 10author = ["Elastic"]
 11description = """
 12Identifies the creation or modification of a medium-size registry hive file on a Server Message Block (SMB) share, which
 13may indicate an exfiltration attempt of a previously dumped Security Account Manager (SAM) registry hive for credential
 14extraction on an attacker-controlled system.
 15"""
 16from = "now-9m"
 17index = ["logs-endpoint.events.file-*"]
 18language = "eql"
 19license = "Elastic License v2"
 20name = "Windows Registry File Creation in SMB Share"
 21note = """## Triage and analysis
 22
 23### Investigating Windows Registry File Creation in SMB Share
 24
 25Dumping registry hives is a common way to access credential information. Some hives store credential material, as is the case for the SAM hive, which stores locally cached credentials (SAM secrets), and the SECURITY hive, which stores domain cached credentials (LSA secrets). Dumping these hives in combination with the SYSTEM hive enables the attacker to decrypt these secrets.
 26
 27Attackers can try to evade detection on the host by transferring this data to a system that is not monitored to be parsed and decrypted. This rule identifies the creation or modification of a medium-size registry hive file on an SMB share, which may indicate this kind of exfiltration attempt.
 28
 29#### Possible investigation steps
 30
 31- Investigate other alerts associated with the user/source host during the past 48 hours.
 32- Identify the user account that performed the action and whether it should perform this kind of action.
 33- Contact the account owner and confirm whether they are aware of this activity.
 34- Inspect the source host for suspicious or abnormal behaviors in the alert timeframe.
 35- Capture the registry file(s) to determine the extent of the credential compromise in an eventual incident response.
 36
 37### False positive analysis
 38
 39- Administrators can export registry hives for backup purposes. Check whether the user should be performing this kind of activity and is aware of it.
 40
 41### Related rules
 42
 43- Credential Acquisition via Registry Hive Dumping - a7e7bfa3-088e-4f13-b29e-3986e0e756b8
 44
 45### Response and remediation
 46
 47- Initiate the incident response process based on the outcome of the triage.
 48- Isolate the involved hosts to prevent further post-compromise behavior.
 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- Reimage the host operating system and restore compromised files to clean versions.
 51- Run a full antimalware scan. This may reveal additional artifacts left in the system, persistence mechanisms, and malware components.
 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"""
 55references = ["https://www.elastic.co/security-labs/detect-credential-access"]
 56risk_score = 47
 57rule_id = "a4c7473a-5cb4-4bc1-9d06-e4a75adbc494"
 58severity = "medium"
 59tags = [
 60    "Domain: Endpoint",
 61    "OS: Windows",
 62    "Use Case: Threat Detection",
 63    "Tactic: Lateral Movement",
 64    "Tactic: Credential Access",
 65    "Resources: Investigation Guide",
 66    "Data Source: Elastic Defend"
 67]
 68timestamp_override = "event.ingested"
 69type = "eql"
 70
 71query = '''
 72file where host.os.type == "windows" and event.type == "creation" and
 73 /* regf file header */
 74 file.Ext.header_bytes : "72656766*" and file.size >= 30000 and
 75 process.pid == 4 and user.id : ("S-1-5-21*", "S-1-12-1-*") and
 76 not file.path : (
 77    "?:\\*\\UPM_Profile\\NTUSER.DAT",
 78    "?:\\*\\UPM_Profile\\NTUSER.DAT.LASTGOOD.LOAD",
 79    "?:\\Windows\\Netwrix\\Temp\\????????.???.offreg",
 80    "?:\\*\\AppData\\Local\\Packages\\Microsoft.*\\Settings\\settings.dat*"
 81 )
 82'''
 83
 84
 85[[rule.threat]]
 86framework = "MITRE ATT&CK"
 87[[rule.threat.technique]]
 88id = "T1003"
 89name = "OS Credential Dumping"
 90reference = "https://attack.mitre.org/techniques/T1003/"
 91[[rule.threat.technique.subtechnique]]
 92id = "T1003.002"
 93name = "Security Account Manager"
 94reference = "https://attack.mitre.org/techniques/T1003/002/"
 95
 96
 97
 98[rule.threat.tactic]
 99id = "TA0006"
100name = "Credential Access"
101reference = "https://attack.mitre.org/tactics/TA0006/"
102[[rule.threat]]
103framework = "MITRE ATT&CK"
104[[rule.threat.technique]]
105id = "T1021"
106name = "Remote Services"
107reference = "https://attack.mitre.org/techniques/T1021/"
108[[rule.threat.technique.subtechnique]]
109id = "T1021.002"
110name = "SMB/Windows Admin Shares"
111reference = "https://attack.mitre.org/techniques/T1021/002/"
112
113
114
115[rule.threat.tactic]
116id = "TA0008"
117name = "Lateral Movement"
118reference = "https://attack.mitre.org/tactics/TA0008/"

Triage and analysis

Investigating Windows Registry File Creation in SMB Share

Dumping registry hives is a common way to access credential information. Some hives store credential material, as is the case for the SAM hive, which stores locally cached credentials (SAM secrets), and the SECURITY hive, which stores domain cached credentials (LSA secrets). Dumping these hives in combination with the SYSTEM hive enables the attacker to decrypt these secrets.

Attackers can try to evade detection on the host by transferring this data to a system that is not monitored to be parsed and decrypted. This rule identifies the creation or modification of a medium-size registry hive file on an SMB share, which may indicate this kind of exfiltration attempt.

Possible investigation steps

  • Investigate other alerts associated with the user/source host during the past 48 hours.
  • Identify the user account that performed the action and whether it should perform this kind of action.
  • Contact the account owner and confirm whether they are aware of this activity.
  • Inspect the source host for suspicious or abnormal behaviors in the alert timeframe.
  • Capture the registry file(s) to determine the extent of the credential compromise in an eventual incident response.

False positive analysis

  • Administrators can export registry hives for backup purposes. Check whether the user should be performing this kind of activity and is aware of it.
  • Credential Acquisition via Registry Hive Dumping - a7e7bfa3-088e-4f13-b29e-3986e0e756b8

Response and remediation

  • Initiate the incident response process based on the outcome of the triage.
  • Isolate the involved hosts to prevent further post-compromise behavior.
  • 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.
  • Reimage the host operating system and restore compromised files to clean versions.
  • Run a full antimalware scan. This may reveal additional artifacts left in the system, persistence mechanisms, and malware components.
  • 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