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 = "2023/06/22"
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.*"]
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-*")
76'''
77
78
79[[rule.threat]]
80framework = "MITRE ATT&CK"
81[[rule.threat.technique]]
82id = "T1003"
83name = "OS Credential Dumping"
84reference = "https://attack.mitre.org/techniques/T1003/"
85[[rule.threat.technique.subtechnique]]
86id = "T1003.002"
87name = "Security Account Manager"
88reference = "https://attack.mitre.org/techniques/T1003/002/"
89
90
91
92[rule.threat.tactic]
93id = "TA0006"
94name = "Credential Access"
95reference = "https://attack.mitre.org/tactics/TA0006/"
96[[rule.threat]]
97framework = "MITRE ATT&CK"
98[[rule.threat.technique]]
99id = "T1021"
100name = "Remote Services"
101reference = "https://attack.mitre.org/techniques/T1021/"
102[[rule.threat.technique.subtechnique]]
103id = "T1021.002"
104name = "SMB/Windows Admin Shares"
105reference = "https://attack.mitre.org/techniques/T1021/002/"
106
107
108
109[rule.threat.tactic]
110id = "TA0008"
111name = "Lateral Movement"
112reference = "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.
Related rules
- 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
- Potential Remote Credential Access via Registry
- Credential Acquisition via Registry Hive Dumping
- Direct Outbound SMB Connection
- Kerberos Traffic from Unusual Process
- LSASS Memory Dump Creation