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